diff --git a/PacticeSolution/DependencyPropertySample2/App.xaml b/PacticeSolution/DependencyPropertySample2/App.xaml
new file mode 100644
index 0000000..b4e1438
--- /dev/null
+++ b/PacticeSolution/DependencyPropertySample2/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/PacticeSolution/DependencyPropertySample2/App.xaml.cs b/PacticeSolution/DependencyPropertySample2/App.xaml.cs
new file mode 100644
index 0000000..9471485
--- /dev/null
+++ b/PacticeSolution/DependencyPropertySample2/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 DependencyPropertySample2
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/PacticeSolution/DependencyPropertySample2/AssemblyInfo.cs b/PacticeSolution/DependencyPropertySample2/AssemblyInfo.cs
new file mode 100644
index 0000000..8b5504e
--- /dev/null
+++ b/PacticeSolution/DependencyPropertySample2/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/DependencyPropertySample2/DependencyPropertySample2.csproj b/PacticeSolution/DependencyPropertySample2/DependencyPropertySample2.csproj
new file mode 100644
index 0000000..4106cb0
--- /dev/null
+++ b/PacticeSolution/DependencyPropertySample2/DependencyPropertySample2.csproj
@@ -0,0 +1,10 @@
+
+
+
+ WinExe
+ net6.0-windows
+ enable
+ true
+
+
+
diff --git a/PacticeSolution/DependencyPropertySample2/MainWindow.xaml b/PacticeSolution/DependencyPropertySample2/MainWindow.xaml
new file mode 100644
index 0000000..3f11ef7
--- /dev/null
+++ b/PacticeSolution/DependencyPropertySample2/MainWindow.xaml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PacticeSolution/DependencyPropertySample2/MainWindow.xaml.cs b/PacticeSolution/DependencyPropertySample2/MainWindow.xaml.cs
new file mode 100644
index 0000000..13ea37b
--- /dev/null
+++ b/PacticeSolution/DependencyPropertySample2/MainWindow.xaml.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+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 DependencyPropertySample2
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ // dependency property
+ public static readonly DependencyProperty MyProperty = DependencyProperty.Register
+ ("MyColor", typeof(string), typeof(MainWindow), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnMyPropertyChanged)));
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ public string MyColor
+ {
+ get { return (string)GetValue(MyProperty); }
+ set { SetValue(MyProperty, value); }
+ }
+
+ private static void OnMyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ MainWindow win = d as MainWindow;
+ if (win == null)
+ return;
+
+ SolidColorBrush brush = new BrushConverter().ConvertFromString(e.NewValue.ToString()) as SolidColorBrush;
+ if (brush == null)
+ return;
+
+ win.Background = brush;
+ win.Title = (e.OldValue == null) ? "Previous: None" : $"Previous: {e.OldValue.ToString()}";
+ win.tbMain.Text = e.NewValue.ToString();
+ }
+
+ private void ContextMenu_Click(object sender, RoutedEventArgs e)
+ {
+ string str = (e.Source as MenuItem).Header as string;
+ if (string.IsNullOrEmpty(str))
+ return;
+
+ this.MyColor = str;
+ }
+ }
+}
diff --git a/PacticeSolution/ListBoxLinqBindingSample/App.xaml b/PacticeSolution/ListBoxLinqBindingSample/App.xaml
new file mode 100644
index 0000000..5ca1339
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/PacticeSolution/ListBoxLinqBindingSample/App.xaml.cs b/PacticeSolution/ListBoxLinqBindingSample/App.xaml.cs
new file mode 100644
index 0000000..769bf9c
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/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 ListBoxLinqBindingSample
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/PacticeSolution/ListBoxLinqBindingSample/AssemblyInfo.cs b/PacticeSolution/ListBoxLinqBindingSample/AssemblyInfo.cs
new file mode 100644
index 0000000..8b5504e
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/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/ListBoxLinqBindingSample/ListBoxLinqBindingSample.csproj b/PacticeSolution/ListBoxLinqBindingSample/ListBoxLinqBindingSample.csproj
new file mode 100644
index 0000000..4106cb0
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/ListBoxLinqBindingSample.csproj
@@ -0,0 +1,10 @@
+
+
+
+ WinExe
+ net6.0-windows
+ enable
+ true
+
+
+
diff --git a/PacticeSolution/ListBoxLinqBindingSample/MainWindow.xaml b/PacticeSolution/ListBoxLinqBindingSample/MainWindow.xaml
new file mode 100644
index 0000000..9bef5c6
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/MainWindow.xaml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PacticeSolution/ListBoxLinqBindingSample/MainWindow.xaml.cs b/PacticeSolution/ListBoxLinqBindingSample/MainWindow.xaml.cs
new file mode 100644
index 0000000..58eacd6
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/MainWindow.xaml.cs
@@ -0,0 +1,90 @@
+using ListBoxLinqBindingSample.Model;
+using ListBoxLinqBindingSample.SubWindow;
+using ListBoxLinqBindingSample.ViewModel;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+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 ListBoxLinqBindingSample
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ private static Duties _duties = new Duties();
+
+ public delegate void RefreshList(DutyType dutyType);
+ public event RefreshList RefreshListEvent;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ internal static Duties Duties
+ {
+ get { return _duties; }
+ set { _duties = value; }
+ }
+
+ private void RefreshListBox(DutyType dutyType)
+ {
+ lstType.SelectedItem = null;
+ lstType.SelectedIndex = dutyType == DutyType.Inside ? 0 : 1;
+ }
+
+ private void btnAdd_Click(object sender, RoutedEventArgs e)
+ {
+ SubWindow.SubWindow subWindow = new SubWindow.SubWindow();
+
+ this.RefreshListEvent += new RefreshList(RefreshListBox);
+ subWindow.UpdateActor = this.RefreshListEvent;
+ subWindow.Show();
+ }
+
+ private void lstType_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ListBox lb = sender as ListBox;
+ if (lb == null)
+ return;
+
+ if (lb.SelectedItem == null)
+ return;
+
+ ListBoxItem item = lb.SelectedItem as ListBoxItem;
+ string dutyType = item.Content.ToString();
+
+ this.DataContext = from duty in _duties
+ where duty.DutyType.ToString() == dutyType
+ select duty;
+ }
+
+ private void lstMain_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ListBox lb = sender as ListBox;
+ if (lb == null)
+ return;
+
+ if (lb.SelectedItem == null)
+ return;
+
+ Duty duty = lb.SelectedItem as Duty;
+ if (duty == null)
+ return;
+
+ MessageBox.Show($"{duty.Name} :: {duty.DutyType}", "Selected duty");
+ }
+ }
+}
diff --git a/PacticeSolution/ListBoxLinqBindingSample/Model/Duty.cs b/PacticeSolution/ListBoxLinqBindingSample/Model/Duty.cs
new file mode 100644
index 0000000..1ea585c
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/Model/Duty.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ListBoxLinqBindingSample.Model
+{
+ public enum DutyType
+ {
+ Inside,
+ Outside
+ }
+
+ internal class Duty
+ {
+ public string Name { get; set; }
+ public DutyType DutyType { get; set; }
+
+ public Duty(string name, DutyType dutyType)
+ {
+ this.Name = name;
+ this.DutyType = dutyType;
+ }
+
+ public Duty()
+ {
+
+ }
+ }
+}
diff --git a/PacticeSolution/ListBoxLinqBindingSample/SubWindow/SubWindow.xaml b/PacticeSolution/ListBoxLinqBindingSample/SubWindow/SubWindow.xaml
new file mode 100644
index 0000000..e75bbf7
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/SubWindow/SubWindow.xaml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PacticeSolution/ListBoxLinqBindingSample/SubWindow/SubWindow.xaml.cs b/PacticeSolution/ListBoxLinqBindingSample/SubWindow/SubWindow.xaml.cs
new file mode 100644
index 0000000..6797316
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/SubWindow/SubWindow.xaml.cs
@@ -0,0 +1,43 @@
+using ListBoxLinqBindingSample.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+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.Shapes;
+
+namespace ListBoxLinqBindingSample.SubWindow
+{
+ ///
+ /// SubWindow.xaml에 대한 상호 작용 논리
+ ///
+ public partial class SubWindow : Window
+ {
+ public Delegate UpdateActor;
+
+ public SubWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void btnSave_Click(object sender, RoutedEventArgs e)
+ {
+ if (rbInside.IsChecked == false && rbOutside.IsChecked == false)
+ {
+ MessageBox.Show("Please select duty type.");
+ return;
+ }
+
+ DutyType dutyType = rbInside.IsChecked == true ? DutyType.Inside : DutyType.Outside;
+ MainWindow.Duties.Add(new Duty(tbxDutyName.Text, dutyType));
+ UpdateActor.DynamicInvoke(dutyType);
+ }
+ }
+}
diff --git a/PacticeSolution/ListBoxLinqBindingSample/ViewModel/Duties.cs b/PacticeSolution/ListBoxLinqBindingSample/ViewModel/Duties.cs
new file mode 100644
index 0000000..e19e969
--- /dev/null
+++ b/PacticeSolution/ListBoxLinqBindingSample/ViewModel/Duties.cs
@@ -0,0 +1,23 @@
+using ListBoxLinqBindingSample.Model;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ListBoxLinqBindingSample.ViewModel
+{
+ internal class Duties : ObservableCollection
+ {
+ public Duties()
+ {
+ this.Add(new Duty("SALES", DutyType.Outside));
+ this.Add(new Duty("LOGISTICS", DutyType.Outside));
+ this.Add(new Duty("IT", DutyType.Inside));
+ this.Add(new Duty("MARKETING", DutyType.Inside));
+ this.Add(new Duty("HR", DutyType.Inside));
+ this.Add(new Duty("FEILD", DutyType.Outside));
+ }
+ }
+}
diff --git a/PacticeSolution/PacticeSolution.sln b/PacticeSolution/PacticeSolution.sln
index 4baa907..d49e36f 100644
--- a/PacticeSolution/PacticeSolution.sln
+++ b/PacticeSolution/PacticeSolution.sln
@@ -59,7 +59,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListSample", "ListSample\Li
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PropertyTriggerSample", "PropertyTriggerSample\PropertyTriggerSample.csproj", "{480DC5E9-1E18-4176-B964-FD2024C5F1C1}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataTriggerSample", "DataTriggerSample\DataTriggerSample.csproj", "{2184CBCF-A59E-4C6F-9BBF-1DC20F132B50}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataTriggerSample", "DataTriggerSample\DataTriggerSample.csproj", "{2184CBCF-A59E-4C6F-9BBF-1DC20F132B50}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ListBoxLinqBindingSample", "ListBoxLinqBindingSample\ListBoxLinqBindingSample.csproj", "{DE5F5671-AB82-4F9E-879A-6FF1FFC49D26}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyPropertySample2", "DependencyPropertySample2\DependencyPropertySample2.csproj", "{AC4DAD4D-BBAB-4E0B-9BB6-5124592BA365}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -183,6 +187,14 @@ Global
{2184CBCF-A59E-4C6F-9BBF-1DC20F132B50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2184CBCF-A59E-4C6F-9BBF-1DC20F132B50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2184CBCF-A59E-4C6F-9BBF-1DC20F132B50}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DE5F5671-AB82-4F9E-879A-6FF1FFC49D26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DE5F5671-AB82-4F9E-879A-6FF1FFC49D26}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DE5F5671-AB82-4F9E-879A-6FF1FFC49D26}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DE5F5671-AB82-4F9E-879A-6FF1FFC49D26}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AC4DAD4D-BBAB-4E0B-9BB6-5124592BA365}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AC4DAD4D-BBAB-4E0B-9BB6-5124592BA365}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AC4DAD4D-BBAB-4E0B-9BB6-5124592BA365}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AC4DAD4D-BBAB-4E0B-9BB6-5124592BA365}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE