From 6fc0d122f577f5807070b1f08030786129227efa Mon Sep 17 00:00:00 2001 From: James Willock Date: Mon, 4 Jan 2016 20:29:08 +0000 Subject: [PATCH 1/3] start of chip stuff --- MainDemo.Wpf/Chips.xaml | 13 ++++++ MainDemo.Wpf/Chips.xaml.cs | 28 ++++++++++++ MainDemo.Wpf/MainDemo.Wpf.csproj | 7 +++ MainDemo.Wpf/MainWindow.xaml | 5 +++ MaterialDesignThemes.Wpf/Chip.cs | 45 +++++++++++++++++++ .../MaterialDesignThemes.Wpf.csproj | 1 + MaterialDesignThemes.Wpf/Themes/Generic.xaml | 21 +++++++++ 7 files changed, 120 insertions(+) create mode 100644 MainDemo.Wpf/Chips.xaml create mode 100644 MainDemo.Wpf/Chips.xaml.cs create mode 100644 MaterialDesignThemes.Wpf/Chip.cs diff --git a/MainDemo.Wpf/Chips.xaml b/MainDemo.Wpf/Chips.xaml new file mode 100644 index 0000000000..aaed3f7aee --- /dev/null +++ b/MainDemo.Wpf/Chips.xaml @@ -0,0 +1,13 @@ + + + + + diff --git a/MainDemo.Wpf/Chips.xaml.cs b/MainDemo.Wpf/Chips.xaml.cs new file mode 100644 index 0000000000..98a89c07ec --- /dev/null +++ b/MainDemo.Wpf/Chips.xaml.cs @@ -0,0 +1,28 @@ +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 MaterialDesignColors.WpfExample +{ + /// + /// Interaction logic for Chips.xaml + /// + public partial class Chips : UserControl + { + public Chips() + { + InitializeComponent(); + } + } +} diff --git a/MainDemo.Wpf/MainDemo.Wpf.csproj b/MainDemo.Wpf/MainDemo.Wpf.csproj index dfeb289fdf..b2ad498755 100644 --- a/MainDemo.Wpf/MainDemo.Wpf.csproj +++ b/MainDemo.Wpf/MainDemo.Wpf.csproj @@ -75,6 +75,9 @@ Cards.xaml + + Chips.xaml + ColorZones.xaml @@ -154,6 +157,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/MainDemo.Wpf/MainWindow.xaml b/MainDemo.Wpf/MainWindow.xaml index f5eff0116f..b51a1a29a1 100644 --- a/MainDemo.Wpf/MainWindow.xaml +++ b/MainDemo.Wpf/MainWindow.xaml @@ -95,6 +95,11 @@ + + + + + diff --git a/MaterialDesignThemes.Wpf/Chip.cs b/MaterialDesignThemes.Wpf/Chip.cs new file mode 100644 index 0000000000..f85c395320 --- /dev/null +++ b/MaterialDesignThemes.Wpf/Chip.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace MaterialDesignThemes.Wpf +{ + public class Chip : Control + { + static Chip() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(Chip), new FrameworkPropertyMetadata(typeof(Chip))); + } + + public static readonly DependencyProperty IconProperty = DependencyProperty.Register( + "Icon", typeof (object), typeof (Chip), new PropertyMetadata(default(object))); + + public object Icon + { + get { return (object) GetValue(IconProperty); } + set { SetValue(IconProperty, value); } + } + + public static readonly DependencyProperty TextProperty = DependencyProperty.Register( + "Text", typeof (string), typeof (Chip), new PropertyMetadata(default(string))); + + public string Text + { + get { return (string) GetValue(TextProperty); } + set { SetValue(TextProperty, value); } + } + + public static readonly DependencyProperty IsDeletableProperty = DependencyProperty.Register( + "IsDeletable", typeof (bool), typeof (Chip), new PropertyMetadata(default(bool))); + + public bool IsDeletable + { + get { return (bool) GetValue(IsDeletableProperty); } + set { SetValue(IsDeletableProperty, value); } + } + } +} diff --git a/MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj b/MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj index d592463542..16cbab6736 100644 --- a/MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj +++ b/MaterialDesignThemes.Wpf/MaterialDesignThemes.Wpf.csproj @@ -207,6 +207,7 @@ + diff --git a/MaterialDesignThemes.Wpf/Themes/Generic.xaml b/MaterialDesignThemes.Wpf/Themes/Generic.xaml index 94044d2934..c698e9de9e 100644 --- a/MaterialDesignThemes.Wpf/Themes/Generic.xaml +++ b/MaterialDesignThemes.Wpf/Themes/Generic.xaml @@ -366,6 +366,27 @@ + + - - + --> + + + \ No newline at end of file diff --git a/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Dark.xaml b/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Dark.xaml index 12d5d50f5a..204dcbee9f 100644 --- a/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Dark.xaml +++ b/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Dark.xaml @@ -26,4 +26,6 @@ + + \ No newline at end of file diff --git a/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Light.xaml b/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Light.xaml index ad8ce333fd..d4c388ce47 100644 --- a/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Light.xaml +++ b/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Light.xaml @@ -23,5 +23,7 @@ - + + + \ No newline at end of file