diff --git a/PacticeSolution/PacticeSolution.sln b/PacticeSolution/PacticeSolution.sln
index 1a44b39..92602cf 100644
--- a/PacticeSolution/PacticeSolution.sln
+++ b/PacticeSolution/PacticeSolution.sln
@@ -51,6 +51,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeyboardInputSample", "Keyb
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TabControlSample", "TabControlSample\TabControlSample.csproj", "{7A148D37-36D1-43B5-A133-B02CE5CB743F}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgressBarSample", "ProgressBarSample\ProgressBarSample.csproj", "{EB304FB7-67EA-467E-9BE4-E55187415CAB}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -153,6 +155,10 @@ Global
{7A148D37-36D1-43B5-A133-B02CE5CB743F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A148D37-36D1-43B5-A133-B02CE5CB743F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A148D37-36D1-43B5-A133-B02CE5CB743F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EB304FB7-67EA-467E-9BE4-E55187415CAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EB304FB7-67EA-467E-9BE4-E55187415CAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EB304FB7-67EA-467E-9BE4-E55187415CAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EB304FB7-67EA-467E-9BE4-E55187415CAB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/PacticeSolution/ProgressBarSample/App.xaml b/PacticeSolution/ProgressBarSample/App.xaml
new file mode 100644
index 0000000..e6c7828
--- /dev/null
+++ b/PacticeSolution/ProgressBarSample/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/PacticeSolution/ProgressBarSample/App.xaml.cs b/PacticeSolution/ProgressBarSample/App.xaml.cs
new file mode 100644
index 0000000..3cd04eb
--- /dev/null
+++ b/PacticeSolution/ProgressBarSample/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace ProgressBarSample
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/PacticeSolution/ProgressBarSample/AssemblyInfo.cs b/PacticeSolution/ProgressBarSample/AssemblyInfo.cs
new file mode 100644
index 0000000..8b5504e
--- /dev/null
+++ b/PacticeSolution/ProgressBarSample/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/PacticeSolution/ProgressBarSample/MainWindow.xaml b/PacticeSolution/ProgressBarSample/MainWindow.xaml
new file mode 100644
index 0000000..bfa515d
--- /dev/null
+++ b/PacticeSolution/ProgressBarSample/MainWindow.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/PacticeSolution/ProgressBarSample/MainWindow.xaml.cs b/PacticeSolution/ProgressBarSample/MainWindow.xaml.cs
new file mode 100644
index 0000000..c8ed650
--- /dev/null
+++ b/PacticeSolution/ProgressBarSample/MainWindow.xaml.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace ProgressBarSample
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ private BackgroundWorker _worker;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ InitInstance();
+ }
+
+ private void InitInstance()
+ {
+ _worker = new BackgroundWorker();
+ _worker.WorkerReportsProgress = true;
+ _worker.DoWork -= OnWorker_DoWork;
+ _worker.ProgressChanged -= OnWorker_ProgressChanged;
+ _worker.RunWorkerCompleted -= OnWorker_RunWorkerCompleted;
+ _worker.DoWork += OnWorker_DoWork;
+ _worker.ProgressChanged += OnWorker_ProgressChanged;
+ _worker.RunWorkerCompleted += OnWorker_RunWorkerCompleted;
+ }
+
+ private void btnStart_Click(object sender, RoutedEventArgs e)
+ {
+ if (_worker.IsBusy)
+ return;
+
+ _worker.RunWorkerAsync();
+ }
+
+ private void OnWorker_RunWorkerCompleted(object? sender, RunWorkerCompletedEventArgs e)
+ {
+ pgbMain.Value = pgbMain.Maximum;
+ }
+
+ private void OnWorker_ProgressChanged(object? sender, ProgressChangedEventArgs e)
+ {
+ pgbMain.Value = (double)e.ProgressPercentage / 10.0;
+ }
+
+ private void OnWorker_DoWork(object? sender, DoWorkEventArgs e)
+ {
+ for (int i = 0; i < 1000; i++)
+ {
+ _worker.ReportProgress(i);
+ Thread.Sleep(10);
+ }
+ }
+ }
+}
diff --git a/PacticeSolution/ProgressBarSample/ProgressBarSample.csproj b/PacticeSolution/ProgressBarSample/ProgressBarSample.csproj
new file mode 100644
index 0000000..4106cb0
--- /dev/null
+++ b/PacticeSolution/ProgressBarSample/ProgressBarSample.csproj
@@ -0,0 +1,10 @@
+
+
+
+ WinExe
+ net6.0-windows
+ enable
+ true
+
+
+