diff --git a/PacticeSolution/AddressBook_MVVMSample/AddressBook_MVVMSample.csproj b/PacticeSolution/AddressBook_MVVMSample/AddressBook_MVVMSample.csproj new file mode 100644 index 0000000..0ec7847 --- /dev/null +++ b/PacticeSolution/AddressBook_MVVMSample/AddressBook_MVVMSample.csproj @@ -0,0 +1,108 @@ + + + + + Debug + AnyCPU + {6A452509-3DEB-41A3-8AA3-8DB4BE948D28} + WinExe + AddressBook_MVVMSample + AddressBook_MVVMSample + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + AddViewWindow.xaml + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + Designer + MSBuild:Compile + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + \ No newline at end of file diff --git a/PacticeSolution/AddressBook_MVVMSample/App.config b/PacticeSolution/AddressBook_MVVMSample/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/PacticeSolution/AddressBook_MVVMSample/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PacticeSolution/AddressBook_MVVMSample/App.xaml b/PacticeSolution/AddressBook_MVVMSample/App.xaml new file mode 100644 index 0000000..cb15f40 --- /dev/null +++ b/PacticeSolution/AddressBook_MVVMSample/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/PacticeSolution/AddressBook_MVVMSample/App.xaml.cs b/PacticeSolution/AddressBook_MVVMSample/App.xaml.cs new file mode 100644 index 0000000..2d97a6e --- /dev/null +++ b/PacticeSolution/AddressBook_MVVMSample/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 AddressBook_MVVMSample +{ + /// + /// App.xaml에 대한 상호 작용 논리 + /// + public partial class App : Application + { + } +} diff --git a/PacticeSolution/AddressBook_MVVMSample/Command/DelegateCommand.cs b/PacticeSolution/AddressBook_MVVMSample/Command/DelegateCommand.cs new file mode 100644 index 0000000..89f45bf --- /dev/null +++ b/PacticeSolution/AddressBook_MVVMSample/Command/DelegateCommand.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; + +namespace AddressBook_MVVMSample.Command +{ + public class DelegateCommand : ICommand + { + private readonly Action _execute; + private readonly Predicate _canExecute; + + public event EventHandler CanExecuteChanged; + + public DelegateCommand(Action execute, Predicate canExecute) + { + _execute = execute; + _canExecute = canExecute; + } + + public DelegateCommand(Action execute) : 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/AddressBook_MVVMSample/MainWindow.xaml b/PacticeSolution/AddressBook_MVVMSample/MainWindow.xaml new file mode 100644 index 0000000..22f767b --- /dev/null +++ b/PacticeSolution/AddressBook_MVVMSample/MainWindow.xaml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + +