diff --git a/Neumorphism.Avalonia/Styles/Assists/ComboBoxAssist.cs b/Neumorphism.Avalonia/Styles/Assists/ComboBoxAssist.cs index f55a589..7068470 100644 --- a/Neumorphism.Avalonia/Styles/Assists/ComboBoxAssist.cs +++ b/Neumorphism.Avalonia/Styles/Assists/ComboBoxAssist.cs @@ -1,11 +1,12 @@ using Avalonia; using Avalonia.Controls; +using Avalonia.Media; namespace Neumorphism.Avalonia.Styles.Assists { public class ComboBoxAssist { - public static AvaloniaProperty LabelProperty = AvaloniaProperty.RegisterAttached("Label", typeof(ComboBox)); + public static AvaloniaProperty LabelProperty = AvaloniaProperty.RegisterAttached("Label", typeof(ComboBoxAssist)); public static void SetLabel(AvaloniaObject element, string value) => element.SetValue(LabelProperty, value); @@ -14,10 +15,75 @@ public class ComboBoxAssist - public static AvaloniaProperty UseFloatingWatermarkProperty = AvaloniaProperty.RegisterAttached("UseFloatingWatermark", typeof(ComboBox)); + public static AvaloniaProperty UseFloatingWatermarkProperty = AvaloniaProperty.RegisterAttached("UseFloatingWatermark", typeof(ComboBoxAssist)); public static void SetUseFloatingWatermark(AvaloniaObject element, bool value) => element.SetValue(UseFloatingWatermarkProperty, value); public static bool GetUseFloatingWatermark(AvaloniaObject element) => (bool)element.GetValue(UseFloatingWatermarkProperty); + + + + public static readonly AvaloniaProperty InnerLeftContentProperty = AvaloniaProperty.RegisterAttached( + "InnerLeftContent", typeof(ComboBoxAssist), null, true); + + public static object GetInnerLeftContent(AvaloniaObject element) + { + return (object)element.GetValue(InnerLeftContentProperty); + } + + public static void SetInnerLeftContent(AvaloniaObject element, object value) + { + element.SetValue(InnerLeftContentProperty, value); + } + + + + public static AvaloniaProperty InnerLeftBackgroundProperty = AvaloniaProperty.RegisterAttached( + "InnerLeftBackground", typeof(ComboBoxAssist)); + + public static void SetInnerLeftBackground(AvaloniaObject element, IBrush value) => element.SetValue(InnerLeftBackgroundProperty, value); + + public static IBrush GetInnerLeftBackground(AvaloniaObject element) => (IBrush)element.GetValue(InnerLeftBackgroundProperty); + + + + public static AvaloniaProperty InnerLeftPaddingProperty = AvaloniaProperty.RegisterAttached( + "InnerLeftPadding", typeof(ComboBoxAssist)); + + public static void SetInnerLeftPadding(AvaloniaObject element, Thickness value) => element.SetValue(InnerLeftPaddingProperty, value); + + public static Thickness GetInnerLeftPadding(AvaloniaObject element) => (Thickness)element.GetValue(InnerLeftPaddingProperty); + + + + public static readonly AvaloniaProperty InnerRightContentProperty = AvaloniaProperty.RegisterAttached( + "InnerRightContent", typeof(ComboBoxAssist), null, true); + + public static object GetInnerRightContent(AvaloniaObject element) + { + return (object)element.GetValue(InnerRightContentProperty); + } + + public static void SetInnerRightContent(AvaloniaObject element, object value) + { + element.SetValue(InnerRightContentProperty, value); + } + + + + public static AvaloniaProperty InnerRightBackgroundProperty = AvaloniaProperty.RegisterAttached( + "InnerRightBackground", typeof(ComboBoxAssist)); + + public static void SetInnerRightBackground(AvaloniaObject element, IBrush value) => element.SetValue(InnerRightBackgroundProperty, value); + + public static IBrush GetInnerRightBackground(AvaloniaObject element) => (IBrush)element.GetValue(InnerRightBackgroundProperty); + + + public static AvaloniaProperty InnerRightPaddingProperty = AvaloniaProperty.RegisterAttached( + "InnerRightPadding", typeof(ComboBoxAssist)); + + public static void SetInnerRightPadding(AvaloniaObject element, Thickness value) => element.SetValue(InnerRightPaddingProperty, value); + + public static Thickness GetInnerRightPadding(AvaloniaObject element) => (Thickness)element.GetValue(InnerRightPaddingProperty); } } \ No newline at end of file diff --git a/Neumorphism.Avalonia/Styles/ComboBox.xaml b/Neumorphism.Avalonia/Styles/ComboBox.xaml index dd2242d..8d724d9 100644 --- a/Neumorphism.Avalonia/Styles/ComboBox.xaml +++ b/Neumorphism.Avalonia/Styles/ComboBox.xaml @@ -10,11 +10,12 @@ + - - + + + + + + + + - + + + diff --git a/Neumorphism.Avalonia/Styles/TextBlock.xaml b/Neumorphism.Avalonia/Styles/TextBlock.xaml index 1c1cac3..15724c0 100644 --- a/Neumorphism.Avalonia/Styles/TextBlock.xaml +++ b/Neumorphism.Avalonia/Styles/TextBlock.xaml @@ -101,4 +101,26 @@ + + + + + + + diff --git a/Neumorphism.Demo/Neumorphism.Avalonia.Demo.csproj b/Neumorphism.Demo/Neumorphism.Avalonia.Demo.csproj index aca173c..e9a3148 100644 --- a/Neumorphism.Demo/Neumorphism.Avalonia.Demo.csproj +++ b/Neumorphism.Demo/Neumorphism.Avalonia.Demo.csproj @@ -30,9 +30,21 @@ Designer + + + + + %(Filename) + + + %(Filename) + + + PanelSmallUIDemo.axaml + SideSheetDemo.axaml Code diff --git a/Neumorphism.Demo/Pages/ComboBoxesDemo.axaml b/Neumorphism.Demo/Pages/ComboBoxesDemo.axaml index 90d8a4f..7fd0bb5 100644 --- a/Neumorphism.Demo/Pages/ComboBoxesDemo.axaml +++ b/Neumorphism.Demo/Pages/ComboBoxesDemo.axaml @@ -26,11 +26,35 @@ - - - - - + + + + + + + + + + + + + + + + + + + @@ -67,6 +91,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Neumorphism.Demo/Pages/ComboBoxesDemo.axaml.cs b/Neumorphism.Demo/Pages/ComboBoxesDemo.axaml.cs index 402ea2f..a14dd09 100644 --- a/Neumorphism.Demo/Pages/ComboBoxesDemo.axaml.cs +++ b/Neumorphism.Demo/Pages/ComboBoxesDemo.axaml.cs @@ -14,5 +14,21 @@ private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } + + private void ClassicComboBoxes1SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (e.AddedItems != null && e.AddedItems.Count > 0) + { + var item = e.AddedItems[0] as ComboBoxItem; + if (item != null && item.Tag is string) + { + if ((string)item.Tag == "-1") + { + // deselect item + ((ComboBox)sender).SelectedIndex = -1; + } + } + } + } } } \ No newline at end of file diff --git a/Neumorphism.Demo/Pages/Home.axaml b/Neumorphism.Demo/Pages/Home.axaml index 8e48995..9eab4b2 100644 --- a/Neumorphism.Demo/Pages/Home.axaml +++ b/Neumorphism.Demo/Pages/Home.axaml @@ -9,6 +9,7 @@ xmlns:models="clr-namespace:Neumorphism.Avalonia.Demo.Models" xmlns:conv="clr-namespace:Neumorphism.Avalonia.Demo.Converters" xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia" + xmlns:fullpanels="clr-namespace:Neumorphism.Avalonia.Demo.Pages.Panels" xmlns:wpf="clr-namespace:Neumorphism.Avalonia.Styles.Assists;assembly=Neumorphism.Avalonia" x:Class="Neumorphism.Avalonia.Demo.Pages.Home"> @@ -73,5 +74,15 @@ + + + + + + + + + + diff --git a/Neumorphism.Demo/Pages/Panels/PanelLargeUIDemo.axaml b/Neumorphism.Demo/Pages/Panels/PanelLargeUIDemo.axaml new file mode 100644 index 0000000..b2538a6 --- /dev/null +++ b/Neumorphism.Demo/Pages/Panels/PanelLargeUIDemo.axaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Neumorphism.Demo/Pages/Panels/PanelLargeUIDemo.axaml.cs b/Neumorphism.Demo/Pages/Panels/PanelLargeUIDemo.axaml.cs new file mode 100644 index 0000000..7cfeb5a --- /dev/null +++ b/Neumorphism.Demo/Pages/Panels/PanelLargeUIDemo.axaml.cs @@ -0,0 +1,21 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using Neumorphism.Avalonia.Demo.ViewModels; + +namespace Neumorphism.Avalonia.Demo.Pages.Panels +{ + public class PanelLargeUIDemo : UserControl + { + public PanelLargeUIDemo() + { + this.InitializeComponent(); + + DataContext = new ButtonFieldsViewModel(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + } +} \ No newline at end of file diff --git a/Neumorphism.Demo/Pages/Panels/PanelMediumUIDemo.axaml b/Neumorphism.Demo/Pages/Panels/PanelMediumUIDemo.axaml new file mode 100644 index 0000000..511b0e0 --- /dev/null +++ b/Neumorphism.Demo/Pages/Panels/PanelMediumUIDemo.axaml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Neumorphism.Demo/Pages/Panels/PanelMediumUIDemo.axaml.cs b/Neumorphism.Demo/Pages/Panels/PanelMediumUIDemo.axaml.cs new file mode 100644 index 0000000..4cce1e2 --- /dev/null +++ b/Neumorphism.Demo/Pages/Panels/PanelMediumUIDemo.axaml.cs @@ -0,0 +1,21 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using Neumorphism.Avalonia.Demo.ViewModels; + +namespace Neumorphism.Avalonia.Demo.Pages.Panels +{ + public class PanelMediumUIDemo : UserControl + { + public PanelMediumUIDemo() + { + this.InitializeComponent(); + + DataContext = new ButtonFieldsViewModel(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + } +} \ No newline at end of file diff --git a/Neumorphism.Demo/Pages/Panels/PanelSmallUIDemo.axaml b/Neumorphism.Demo/Pages/Panels/PanelSmallUIDemo.axaml new file mode 100644 index 0000000..74ed018 --- /dev/null +++ b/Neumorphism.Demo/Pages/Panels/PanelSmallUIDemo.axaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Neumorphism.Demo/Pages/Panels/PanelSmallUIDemo.axaml.cs b/Neumorphism.Demo/Pages/Panels/PanelSmallUIDemo.axaml.cs new file mode 100644 index 0000000..74e8d58 --- /dev/null +++ b/Neumorphism.Demo/Pages/Panels/PanelSmallUIDemo.axaml.cs @@ -0,0 +1,21 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using Neumorphism.Avalonia.Demo.ViewModels; + +namespace Neumorphism.Avalonia.Demo.Pages.Panels +{ + public class PanelSmallUIDemo : UserControl + { + public PanelSmallUIDemo() + { + this.InitializeComponent(); + + DataContext = new ButtonFieldsViewModel(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + } +} \ No newline at end of file diff --git a/Neumorphism.Demo/Pages/SlidersDemo.axaml b/Neumorphism.Demo/Pages/SlidersDemo.axaml index 6512820..38bf8da 100644 --- a/Neumorphism.Demo/Pages/SlidersDemo.axaml +++ b/Neumorphism.Demo/Pages/SlidersDemo.axaml @@ -47,7 +47,7 @@ - +