diff --git a/PacticeSolution/ListBoxSortFilterSearch/ViewModel/EmpViewModel.cs b/PacticeSolution/ListBoxSortFilterSearch/ViewModel/EmpViewModel.cs index 38d1891..e41274c 100644 --- a/PacticeSolution/ListBoxSortFilterSearch/ViewModel/EmpViewModel.cs +++ b/PacticeSolution/ListBoxSortFilterSearch/ViewModel/EmpViewModel.cs @@ -19,6 +19,5 @@ namespace ListBoxSortFilterSearch.ViewModel this.Add(new Emp() { EmpNo = 5, Name = "Smith", Job = "Guard" }); this.Add(new Emp() { EmpNo = 6, Name = "Michel", Job = "Manager" }); } - } } diff --git a/PacticeSolution/PacticeSolution.sln b/PacticeSolution/PacticeSolution.sln index f7ec801..fabcbf2 100644 --- a/PacticeSolution/PacticeSolution.sln +++ b/PacticeSolution/PacticeSolution.sln @@ -81,6 +81,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ValueConverterSample", "Val EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListBoxSortFilterSearch", "ListBoxSortFilterSearch\ListBoxSortFilterSearch.csproj", "{31C1503F-1735-4A7E-A5AC-2935E0076160}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgressBarMVVMSample", "ProgressBarMVVMSample\ProgressBarMVVMSample.csproj", "{AAF51128-FFDA-495A-947F-0206993C1814}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -243,6 +245,10 @@ Global {31C1503F-1735-4A7E-A5AC-2935E0076160}.Debug|Any CPU.Build.0 = Debug|Any CPU {31C1503F-1735-4A7E-A5AC-2935E0076160}.Release|Any CPU.ActiveCfg = Release|Any CPU {31C1503F-1735-4A7E-A5AC-2935E0076160}.Release|Any CPU.Build.0 = Release|Any CPU + {AAF51128-FFDA-495A-947F-0206993C1814}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AAF51128-FFDA-495A-947F-0206993C1814}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAF51128-FFDA-495A-947F-0206993C1814}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AAF51128-FFDA-495A-947F-0206993C1814}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PacticeSolution/ProgressBarMVVMSample/App.config b/PacticeSolution/ProgressBarMVVMSample/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/PacticeSolution/ProgressBarMVVMSample/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PacticeSolution/ProgressBarMVVMSample/App.xaml b/PacticeSolution/ProgressBarMVVMSample/App.xaml new file mode 100644 index 0000000..e608a24 --- /dev/null +++ b/PacticeSolution/ProgressBarMVVMSample/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/PacticeSolution/ProgressBarMVVMSample/App.xaml.cs b/PacticeSolution/ProgressBarMVVMSample/App.xaml.cs new file mode 100644 index 0000000..3d595d5 --- /dev/null +++ b/PacticeSolution/ProgressBarMVVMSample/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 ProgressBarMVVMSample +{ + /// + /// App.xaml에 대한 상호 작용 논리 + /// + public partial class App : Application + { + } +} diff --git a/PacticeSolution/ProgressBarMVVMSample/Command/DelegateCommand.cs b/PacticeSolution/ProgressBarMVVMSample/Command/DelegateCommand.cs new file mode 100644 index 0000000..4926e0e --- /dev/null +++ b/PacticeSolution/ProgressBarMVVMSample/Command/DelegateCommand.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; + +namespace ProgressBarMVVMSample.Command +{ + internal class DelegateCommand : ICommand + { + private readonly Action _execute; + private readonly Predicate _canExecute; + + public event EventHandler CanExecuteChanged; + //{ + // add { CommandManager.RequerySuggested += value; } + // remove { CommandManager.RequerySuggested -= value; } + //} + + public DelegateCommand(Action execute, Predicate canExecute) + { + _execute = execute; + _canExecute = canExecute; + } + + public DelegateCommand(Action execute) : this(execute, null) + { + + } + + public DelegateCommand(Action execute, bool b) : this(execute, null) + { + + } + + public bool CanExecute(object parameter) + { + return _canExecute == null ? true : _canExecute(parameter); + } + + public void Execute(object parameter) + { + _execute.Invoke(parameter); + } + } +} diff --git a/PacticeSolution/ProgressBarMVVMSample/MainWindow.xaml b/PacticeSolution/ProgressBarMVVMSample/MainWindow.xaml new file mode 100644 index 0000000..9336e36 --- /dev/null +++ b/PacticeSolution/ProgressBarMVVMSample/MainWindow.xaml @@ -0,0 +1,32 @@ + + + + + + + + + + + +