From b1a369ef0522e7f2eecaad1ada5034c73b6551d5 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Mollazadeh Date: Tue, 18 Jul 2023 19:02:56 +0330 Subject: [PATCH 01/38] feat(CardControl): add CornerRadius support --- src/Wpf.Ui/Controls/CardControl.cs | 17 +++++++++++++++++ src/Wpf.Ui/Styles/Controls/CardControl.xaml | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Wpf.Ui/Controls/CardControl.cs b/src/Wpf.Ui/Controls/CardControl.cs index 0be43c400..e47aa60e2 100644 --- a/src/Wpf.Ui/Controls/CardControl.cs +++ b/src/Wpf.Ui/Controls/CardControl.cs @@ -33,6 +33,13 @@ public class CardControl : System.Windows.Controls.Primitives.ButtonBase new PropertyMetadata(null) ); + /// + /// Property for + /// + public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register(nameof(CornerRadius), + typeof(CornerRadius), typeof(CardControl), + new PropertyMetadata(new CornerRadius(0))); + /// /// Header is the data used to for the header of each item in the control. /// @@ -52,4 +59,14 @@ public IconElement? Icon get => (IconElement)GetValue(IconProperty); set => SetValue(IconProperty, value); } + + /// + /// Gets or sets the corner radius of the control. + /// + [Bindable(true), Category("Appearance")] + public CornerRadius CornerRadius + { + get => (CornerRadius)GetValue(CornerRadiusProperty); + set => SetValue(CornerRadiusProperty, value); + } } diff --git a/src/Wpf.Ui/Styles/Controls/CardControl.xaml b/src/Wpf.Ui/Styles/Controls/CardControl.xaml index 9c9799701..16f6cc07b 100644 --- a/src/Wpf.Ui/Styles/Controls/CardControl.xaml +++ b/src/Wpf.Ui/Styles/Controls/CardControl.xaml @@ -43,7 +43,7 @@ - + @@ -61,7 +61,7 @@ Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding Border.CornerRadius}"> + CornerRadius="{TemplateBinding CornerRadius}"> From 8f93196e847bdb5bbb7fee1d4e9233b50fb3e9e6 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Mollazadeh Date: Tue, 18 Jul 2023 19:32:54 +0330 Subject: [PATCH 02/38] feat(Wpf.Ui.Gallery): add CardControl --- src/Wpf.Ui.Gallery/App.xaml.cs | 4 +- .../Pages/Layout/CardControlViewModel.cs | 11 +++++ .../ViewModels/Windows/MainWindowViewModel.cs | 7 +++- .../Views/Pages/Layout/CardControlPage.xaml | 40 +++++++++++++++++++ .../Pages/Layout/CardControlPage.xaml.cs | 38 ++++++++++++++++++ src/Wpf.Ui/Styles/Controls/CardControl.xaml | 2 +- 6 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/CardControlViewModel.cs create mode 100644 src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml create mode 100644 src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml.cs diff --git a/src/Wpf.Ui.Gallery/App.xaml.cs b/src/Wpf.Ui.Gallery/App.xaml.cs index c2652ebc3..671c348ef 100644 --- a/src/Wpf.Ui.Gallery/App.xaml.cs +++ b/src/Wpf.Ui.Gallery/App.xaml.cs @@ -1,4 +1,4 @@ -// This Source Code Form is subject to the terms of the MIT License. +// This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT. // Copyright (C) Leszek Pomianowski and WPF UI Contributors. // All Rights Reserved. @@ -148,6 +148,8 @@ public partial class App : Application services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); // Web View services.AddTransient(); diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/CardControlViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/CardControlViewModel.cs new file mode 100644 index 000000000..250490978 --- /dev/null +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/CardControlViewModel.cs @@ -0,0 +1,11 @@ +// This Source Code Form is subject to the terms of the MIT License. +// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT. +// Copyright (C) Leszek Pomianowski and WPF UI Contributors. +// All Rights Reserved. + +namespace Wpf.Ui.Gallery.ViewModels.Pages.Layout; + +public partial class CardControlViewModel : ObservableObject +{ + public CardControlViewModel() { } +} diff --git a/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs index e66587531..fe06e0de2 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs @@ -1,4 +1,4 @@ -// This Source Code Form is subject to the terms of the MIT License. +// This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT. // Copyright (C) Leszek Pomianowski and WPF UI Contributors. // All Rights Reserved. @@ -219,6 +219,11 @@ public MainWindowViewModel(IServiceProvider serviceProvider) Content = "Expander", TargetPageType = typeof(ExpanderPage) }, + new NavigationViewItem + { + Content = "CardControl", + TargetPageType = typeof(CardControlPage) + }, } }, #endif diff --git a/src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml b/src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml new file mode 100644 index 000000000..d41d57c5c --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml.cs b/src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml.cs new file mode 100644 index 000000000..bc34b785b --- /dev/null +++ b/src/Wpf.Ui.Gallery/Views/Pages/Layout/CardControlPage.xaml.cs @@ -0,0 +1,38 @@ +// This Source Code Form is subject to the terms of the MIT License. +// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT. +// Copyright (C) Leszek Pomianowski and WPF UI Contributors. +// All Rights Reserved. + +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; +using Wpf.Ui.Controls; +using Wpf.Ui.Gallery.ControlsLookup; +using Wpf.Ui.Gallery.ViewModels.Pages.Layout; + +namespace Wpf.Ui.Gallery.Views.Pages.Layout; +/// +/// Interaction logic for CardControlPage.xaml +/// +[GalleryPage("Card control.", SymbolRegular.CardUi24)] +public partial class CardControlPage : INavigableView +{ + public CardControlPage(CardControlViewModel viewModel) + { + InitializeComponent(); + ViewModel = viewModel; + } + + public CardControlViewModel ViewModel { get; } +} diff --git a/src/Wpf.Ui/Styles/Controls/CardControl.xaml b/src/Wpf.Ui/Styles/Controls/CardControl.xaml index 16f6cc07b..fc735a172 100644 --- a/src/Wpf.Ui/Styles/Controls/CardControl.xaml +++ b/src/Wpf.Ui/Styles/Controls/CardControl.xaml @@ -1,4 +1,4 @@ - - + diff --git a/src/Wpf.Ui/Controls/BreadcrumbBar/BreadcrumbBar.xaml b/src/Wpf.Ui/Controls/BreadcrumbBar/BreadcrumbBar.xaml index 904f1d290..fd85e6db0 100644 --- a/src/Wpf.Ui/Controls/BreadcrumbBar/BreadcrumbBar.xaml +++ b/src/Wpf.Ui/Controls/BreadcrumbBar/BreadcrumbBar.xaml @@ -1,4 +1,4 @@ - - - - - - + + + diff --git a/src/Wpf.Ui/Resources/Theme/Light.xaml b/src/Wpf.Ui/Resources/Theme/Light.xaml index a8e6f9389..d2e28d259 100644 --- a/src/Wpf.Ui/Resources/Theme/Light.xaml +++ b/src/Wpf.Ui/Resources/Theme/Light.xaml @@ -317,15 +317,13 @@ - - - - - + + + From 8c7d9523dcb840cc4bfc14ab79dcd6c10b3ae76d Mon Sep 17 00:00:00 2001 From: Niels Laute Date: Sun, 22 Oct 2023 18:01:45 +0200 Subject: [PATCH 07/38] RichSuggestBox --- .../Controls/RichTextBox/RichTextBox.xaml | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/Wpf.Ui/Controls/RichTextBox/RichTextBox.xaml b/src/Wpf.Ui/Controls/RichTextBox/RichTextBox.xaml index e3b566cbc..36e89b880 100644 --- a/src/Wpf.Ui/Controls/RichTextBox/RichTextBox.xaml +++ b/src/Wpf.Ui/Controls/RichTextBox/RichTextBox.xaml @@ -11,21 +11,9 @@ xmlns:controls="clr-namespace:Wpf.Ui.Controls">