From b1c1eb8021f45a7dfcdc152b151f8219b3baecd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=83=E5=80=BE?= <38943319+LHTXQ@users.noreply.github.com> Date: Sat, 6 May 2023 21:51:34 +0800 Subject: [PATCH 01/30] Show 'SystemMenu' on mouse right button up. --- Commit by LHTXQ --- src/Wpf.Ui/Controls/TitleBar.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/TitleBar.cs b/src/Wpf.Ui/Controls/TitleBar.cs index f95153e60..306c00768 100644 --- a/src/Wpf.Ui/Controls/TitleBar.cs +++ b/src/Wpf.Ui/Controls/TitleBar.cs @@ -27,6 +27,10 @@ public class TitleBar : System.Windows.Controls.Control, IThemeControl private const string ElementRestoreButton = "PART_RestoreButton"; + private static DpiScale? dpiScale; + + private DependencyObject? parentWindow; + private System.Windows.Window _parent; internal Interop.WinDef.POINT _doubleClickPoint; @@ -380,7 +384,7 @@ public event RoutedEventHandler HelpClicked public TitleBar() { SetValue(TemplateButtonCommandProperty, new Common.RelayCommand(o => OnTemplateButtonClick(o ?? String.Empty))); - + dpiScale ??= VisualTreeHelper.GetDpi(this); Loaded += OnLoaded; } @@ -407,6 +411,13 @@ public override void OnApplyTemplate() { base.OnApplyTemplate(); + parentWindow = VisualTreeHelper.GetParent(this); + while (parentWindow != null && parentWindow is not Window) + { + parentWindow = VisualTreeHelper.GetParent(parentWindow); + } + this.MouseRightButtonUp += TitleBar_MouseRightButtonUp; + var mainGrid = GetTemplateChild(ElementMainGrid) as System.Windows.Controls.Grid; var maximizeButton = GetTemplateChild(ElementMaximizeButton) as Wpf.Ui.Controls.Button; var restoreButton = GetTemplateChild(ElementRestoreButton) as Wpf.Ui.Controls.Button; @@ -421,6 +432,15 @@ public override void OnApplyTemplate() InitializeSnapLayout(maximizeButton, restoreButton); } + /// + /// Show 'SystemMenu' on mouse right button up. + /// + private void TitleBar_MouseRightButtonUp(object sender, MouseButtonEventArgs e) + { + var point = PointToScreen(e.GetPosition(this)); + SystemCommands.ShowSystemMenu(parentWindow as Window, new Point(point.X / dpiScale.Value.DpiScaleX, point.Y / dpiScale.Value.DpiScaleY)); + } + /// /// This virtual method is triggered when the app's theme changes. /// From fe0e1429075276808523640cba025fc4d0401cf8 Mon Sep 17 00:00:00 2001 From: pomianowski <13592821+pomianowski@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:15:05 +0100 Subject: [PATCH 02/30] Rollback changes --- src/Wpf.Ui/Controls/TitleBar/TitleBar.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Wpf.Ui/Controls/TitleBar/TitleBar.cs b/src/Wpf.Ui/Controls/TitleBar/TitleBar.cs index 82e301b9e..ecf090b11 100644 --- a/src/Wpf.Ui/Controls/TitleBar/TitleBar.cs +++ b/src/Wpf.Ui/Controls/TitleBar/TitleBar.cs @@ -32,6 +32,10 @@ public class TitleBar : System.Windows.Controls.Control, IThemeControl private const string ElementRestoreButton = "PART_RestoreButton"; private const string ElementCloseButton = "PART_CloseButton"; + private static DpiScale? dpiScale; + + private DependencyObject? parentWindow; + #region Static properties /// @@ -423,6 +427,8 @@ public TitleBar() { SetValue(TemplateButtonCommandProperty, new RelayCommand(OnTemplateButtonClick)); + dpiScale ??= VisualTreeHelper.GetDpi(this); + Loaded += OnLoaded; Unloaded += OnUnloaded; } @@ -469,6 +475,15 @@ public override void OnApplyTemplate() { base.OnApplyTemplate(); + parentWindow = VisualTreeHelper.GetParent(this); + + while (parentWindow != null && parentWindow is not Window) + { + parentWindow = VisualTreeHelper.GetParent(parentWindow); + } + + this.MouseRightButtonUp += TitleBar_MouseRightButtonUp; + _mainGrid = GetTemplateChild(ElementMainGrid); _icon = GetTemplateChild(ElementIcon); @@ -642,6 +657,15 @@ or User32.WM.NCLBUTTONUP } } + /// + /// Show 'SystemMenu' on mouse right button up. + /// + private void TitleBar_MouseRightButtonUp(object sender, MouseButtonEventArgs e) + { + var point = PointToScreen(e.GetPosition(this)); + SystemCommands.ShowSystemMenu(parentWindow as Window, new Point(point.X / dpiScale.Value.DpiScaleX, point.Y / dpiScale.Value.DpiScaleY)); + } + private T GetTemplateChild(string name) where T : DependencyObject { From 1f4cf3a971ba86c69c71773aba558cc907d330dd Mon Sep 17 00:00:00 2001 From: jackBonadies Date: Sun, 4 Feb 2024 20:27:45 -0500 Subject: [PATCH 03/30] Fix issue where on launching content dialog, dialog is not focused. --- src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml b/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml index ddb90575e..3f5c8ff9b 100644 --- a/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml +++ b/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml @@ -24,7 +24,7 @@ - + From 1b929202a8ed9c25c842088c2e5d506e271f4973 Mon Sep 17 00:00:00 2001 From: jackBonadies Date: Sun, 4 Feb 2024 20:28:28 -0500 Subject: [PATCH 04/30] Fix issue where on tabbing focus can leave content dialog and focus background controls. --- src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml b/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml index 3f5c8ff9b..b0adce341 100644 --- a/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml +++ b/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml @@ -25,6 +25,8 @@ + + From 739a556dd9901301ed8ce322147a9b64dd67a2d6 Mon Sep 17 00:00:00 2001 From: Luiz Henrique Cassettari Date: Mon, 5 Feb 2024 10:09:53 -0300 Subject: [PATCH 05/30] Update README.md Update sample to use `ui:FluentWindow`. `ui:UiWindow` does not exist in version 3.* --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5650a4fb9..35fab7acb 100644 --- a/README.md +++ b/README.md @@ -127,15 +127,17 @@ public partial class MainWindow Now you can create fantastic apps, e.g. with one button: ```xml - - - - - + + + + + + + ``` ## Special thanks From 939e2bb3e89e29a0183b1d68de3800ae21944e6c Mon Sep 17 00:00:00 2001 From: pomian <13592821+pomianowski@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:10:49 +0100 Subject: [PATCH 06/30] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 35fab7acb..9e2eefa6c 100644 --- a/README.md +++ b/README.md @@ -133,8 +133,7 @@ Now you can create fantastic apps, e.g. with one button: - + From b8f109f70d705a39a134e508ae73e28992628238 Mon Sep 17 00:00:00 2001 From: Nirmal Date: Wed, 7 Feb 2024 23:04:11 +0530 Subject: [PATCH 07/30] Update NavigationViewCompact.xaml Change MinWidth = 310 to 40 of main border because it is cut while collapse menu. --- src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml b/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml index 78d2e1c60..29b31e856 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml @@ -17,7 +17,7 @@ Date: Wed, 7 Feb 2024 23:06:51 +0530 Subject: [PATCH 08/30] Update NavigationViewLeftMinimalCompact.xaml Change MinWidth = 310 to 40 of main border because it is cut while collapse menu. --- .../NavigationView/NavigationViewLeftMinimalCompact.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewLeftMinimalCompact.xaml b/src/Wpf.Ui/Controls/NavigationView/NavigationViewLeftMinimalCompact.xaml index b362c47f5..c57065f4f 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewLeftMinimalCompact.xaml +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewLeftMinimalCompact.xaml @@ -15,7 +15,7 @@ Date: Wed, 7 Feb 2024 23:37:02 +0530 Subject: [PATCH 09/30] Update TitleBar.xaml Tilebar FontSize is not able to change it was static now change to TemplateBinding FontSize --- src/Wpf.Ui/Controls/TitleBar/TitleBar.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/TitleBar/TitleBar.xaml b/src/Wpf.Ui/Controls/TitleBar/TitleBar.xaml index afdd69040..d94b9c069 100644 --- a/src/Wpf.Ui/Controls/TitleBar/TitleBar.xaml +++ b/src/Wpf.Ui/Controls/TitleBar/TitleBar.xaml @@ -146,7 +146,7 @@ From b1762cfdc47c3bd2d98e1b9116e6f23af096c5a3 Mon Sep 17 00:00:00 2001 From: Victor Tseng Date: Sat, 10 Feb 2024 01:46:24 +0800 Subject: [PATCH 10/30] [NavSvc] add dataContext to INavigationService.Navigate*() add these 3 overload methods with `dataContext` to `INavigationService` so that ```C# bool Navigate(Type pageType, object dataContext); bool Navigate(string pageIdOrTargetTag, object dataContext); bool NavigateWithHierarchy(Type pageType, object dataContext); ``` However, if the current displaying page (ie. top-most navigation stack) is `pageType`, `Navigate*(...)` returns `false` and does nothing. I managed to force-refresh the stack by doing this in client code: ```C# while (!NavSvc.NavigateWithHierarchy(typeof(SomePage), someData) { // failed, try pop the stack and try again if (!NavSvc.GoBack()) { // cannot pop stack, really failed... Log.LogCritical(...); break; } } ``` --- src/Wpf.Ui/INavigationService.cs | 24 ++++++++++++++++++++++++ src/Wpf.Ui/NavigationService.cs | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/Wpf.Ui/INavigationService.cs b/src/Wpf.Ui/INavigationService.cs index 6c3fa683c..fc6075c78 100644 --- a/src/Wpf.Ui/INavigationService.cs +++ b/src/Wpf.Ui/INavigationService.cs @@ -20,6 +20,14 @@ public interface INavigationService /// if the operation succeeds. otherwise. bool Navigate(Type pageType); + /// + /// Lets you navigate to the selected page based on it's type, Should be used with . + /// + /// of the page. + /// DataContext + /// if the operation succeeds. otherwise. + bool Navigate(Type pageType, object? dataContext); + /// /// Lets you navigate to the selected page based on it's tag. Should be used with . /// @@ -27,6 +35,14 @@ public interface INavigationService /// if the operation succeeds. otherwise. bool Navigate(string pageIdOrTargetTag); + /// + /// Lets you navigate to the selected page based on it's tag. Should be used with . + /// + /// Id or tag of the page. + /// DataContext + /// if the operation succeeds. otherwise. + bool Navigate(string pageIdOrTargetTag, object? dataContext); + /// /// Synchronously adds an element to the navigation stack and navigates current navigation Frame to the /// @@ -34,6 +50,14 @@ public interface INavigationService /// if the operation succeeds. otherwise. bool NavigateWithHierarchy(Type pageType); + /// + /// Synchronously adds an element to the navigation stack and navigates current navigation Frame to the + /// + /// Type of control to be synchronously added to the navigation stack + /// DataContext + /// if the operation succeeds. otherwise. + bool NavigateWithHierarchy(Type pageType, object? dataContext); + /// /// Provides direct access to the control responsible for navigation. /// diff --git a/src/Wpf.Ui/NavigationService.cs b/src/Wpf.Ui/NavigationService.cs index efca739bb..1f6dca3d4 100644 --- a/src/Wpf.Ui/NavigationService.cs +++ b/src/Wpf.Ui/NavigationService.cs @@ -80,6 +80,14 @@ public bool Navigate(Type pageType) return NavigationControl!.Navigate(pageType); } + /// + public bool Navigate(Type pageType, object? dataContext) + { + ThrowIfNavigationControlIsNull(); + + return NavigationControl!.Navigate(pageType, dataContext); + } + /// public bool Navigate(string pageTag) { @@ -88,6 +96,14 @@ public bool Navigate(string pageTag) return NavigationControl!.Navigate(pageTag); } + /// + public bool Navigate(string pageTag, object? dataContext) + { + ThrowIfNavigationControlIsNull(); + + return NavigationControl!.Navigate(pageTag, dataContext); + } + /// public bool GoBack() { @@ -104,6 +120,14 @@ public bool NavigateWithHierarchy(Type pageType) return NavigationControl!.NavigateWithHierarchy(pageType); } + /// + public bool NavigateWithHierarchy(Type pageType, object? dataContext) + { + ThrowIfNavigationControlIsNull(); + + return NavigationControl!.NavigateWithHierarchy(pageType, dataContext); + } + private void ThrowIfNavigationControlIsNull() { if (NavigationControl is null) From c080436e22e0ca06baaf696a239cf1dc3f141840 Mon Sep 17 00:00:00 2001 From: Victor Tseng Date: Sat, 10 Feb 2024 01:50:53 +0800 Subject: [PATCH 11/30] make `NavigationService` throw-helpers protected so derived class can use them --- src/Wpf.Ui/NavigationService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Wpf.Ui/NavigationService.cs b/src/Wpf.Ui/NavigationService.cs index efca739bb..b041cad9c 100644 --- a/src/Wpf.Ui/NavigationService.cs +++ b/src/Wpf.Ui/NavigationService.cs @@ -104,7 +104,7 @@ public bool NavigateWithHierarchy(Type pageType) return NavigationControl!.NavigateWithHierarchy(pageType); } - private void ThrowIfNavigationControlIsNull() + protected void ThrowIfNavigationControlIsNull() { if (NavigationControl is null) { @@ -112,7 +112,7 @@ private void ThrowIfNavigationControlIsNull() } } - private void ThrowIfPageServiceIsNull() + protected void ThrowIfPageServiceIsNull() { if (_pageService is null) { From 4bc17993f4b7d69a3af69febf0560c4ed45097ba Mon Sep 17 00:00:00 2001 From: Kev French Date: Sun, 11 Feb 2024 01:54:04 +0000 Subject: [PATCH 12/30] Make 'TitleBarButton' public to enable re-templating 'TitleBar'. --- src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs b/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs index 876352858..af0f0657c 100644 --- a/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs +++ b/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs @@ -11,7 +11,7 @@ // ReSharper disable once CheckNamespace namespace Wpf.Ui.Controls; -internal class TitleBarButton : Wpf.Ui.Controls.Button +public class TitleBarButton : Wpf.Ui.Controls.Button { /// /// Property for . From 5725019bd5fb3f89158e3faa4994b8daeb87c7f1 Mon Sep 17 00:00:00 2001 From: Nzroops Date: Tue, 20 Feb 2024 12:39:30 +0800 Subject: [PATCH 13/30] Update NavigationView.Properties.cs UpdateMenuItemsTemplate And AddItemsToDictionaries when MenuItems changed. --- .../NavigationView.Properties.cs | 52 ++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs index 592ef644c..5a500562c 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs @@ -7,6 +7,7 @@ // Copyright(c) Microsoft Corporation.All rights reserved. using System.Collections; +using System.Collections.Specialized; using System.Windows.Controls; using Wpf.Ui.Animations; @@ -82,7 +83,7 @@ public partial class NavigationView nameof(FooterMenuItemsProperty), typeof(IList), typeof(NavigationView), - new FrameworkPropertyMetadata(null) + new FrameworkPropertyMetadata(null, OnFooterMenuItemsPropertyChanged) ); /// @@ -513,16 +514,40 @@ private static void OnMenuItemsPropertyChanged(DependencyObject? d, DependencyPr if (navigationView.MenuItemsItemsControl is null) { + navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList); return; } if (navigationView.MenuItemsItemsControl.ItemsSource.Equals(enumerableNewValue)) { + navigationView.UpdateMenuItemsTemplate(enumerableNewValue); return; } navigationView.MenuItemsItemsControl.ItemsSource = null; navigationView.MenuItemsItemsControl.ItemsSource = enumerableNewValue; + navigationView.UpdateMenuItemsTemplate(enumerableNewValue); + navigationView.AddItemsToDictionaries(enumerableNewValue); + + navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList); + } + + private void UpdateCollectionChangedEvent(IList? oldMenuItems, IList? newMenuItems) + { + if(oldMenuItems is INotifyCollectionChanged notifyCollection) + { + notifyCollection.CollectionChanged -= OnMenuItems_CollectionChanged; + } + if(newMenuItems is INotifyCollectionChanged newNotifyCollection) + { + newNotifyCollection.CollectionChanged += OnMenuItems_CollectionChanged; + } + } + + private void OnMenuItems_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) + { + UpdateMenuItemsTemplate(e.NewItems); + AddItemsToDictionaries(e.NewItems); } private static void OnMenuItemsSourcePropertyChanged( @@ -551,6 +576,31 @@ DependencyPropertyChangedEventArgs e navigationView.FooterMenuItems = enumerableNewValue; } + private static void OnFooterMenuItemsPropertyChanged(DependencyObject? d, DependencyPropertyChangedEventArgs e) + { + if (d is not NavigationView navigationView || e.NewValue is not IList enumerableNewValue) + { + return; + } + + if (navigationView.FooterMenuItemsItemsControl is null) + { + navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList); + return; + } + + if (navigationView.FooterMenuItemsItemsControl.ItemsSource.Equals(enumerableNewValue)) + { + return; + } + + navigationView.FooterMenuItemsItemsControl.ItemsSource = null; + navigationView.FooterMenuItemsItemsControl.ItemsSource = enumerableNewValue; + navigationView.UpdateMenuItemsTemplate(enumerableNewValue); + navigationView.AddItemsToDictionaries(enumerableNewValue); + navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList); + } + private static void OnPaneDisplayModePropertyChanged( DependencyObject? d, DependencyPropertyChangedEventArgs e From 43af1005b1c4d960cdf9a2257022c058b9dcccce Mon Sep 17 00:00:00 2001 From: Nzroops Date: Tue, 20 Feb 2024 13:58:02 +0800 Subject: [PATCH 14/30] add null check befor UpdateMenuItemsTemplate/AddItemsToDictionaries when MenuItems_CollectionChanged #964 --- .../Controls/NavigationView/NavigationView.Properties.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs index 5a500562c..4c5ecd779 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs @@ -546,6 +546,11 @@ private void UpdateCollectionChangedEvent(IList? oldMenuItems, IList? newMenuIte private void OnMenuItems_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { + if (e.NewItems is null) + { + return; + } + UpdateMenuItemsTemplate(e.NewItems); AddItemsToDictionaries(e.NewItems); } From 919746ef7729316622654633cf13a4de56012768 Mon Sep 17 00:00:00 2001 From: Mijail Todorovich Date: Mon, 26 Feb 2024 16:18:55 -0300 Subject: [PATCH 15/30] Don't focus on buttons in text input controls with Tab Set `IsTabStop=False` in the `ClearButton`, `InlineIncrementButton`, `InlineDecrementButton`, and/or `RevealButton` present in `TextBox`, `AutoSuggestBox`, `NumberBox` and `PasswordBox`. --- src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml | 3 +++ src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml | 2 ++ src/Wpf.Ui/Controls/TextBox/TextBox.xaml | 1 + 3 files changed, 6 insertions(+) diff --git a/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml b/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml index 12dce7090..766231f7d 100644 --- a/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml +++ b/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml @@ -115,6 +115,7 @@ Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}" CommandParameter="clear" Cursor="Arrow" + IsTabStop="False" Foreground="{DynamicResource TextControlButtonForeground}"> @@ -138,6 +139,7 @@ CommandParameter="increment" Cursor="Arrow" Foreground="{DynamicResource TextControlButtonForeground}" + IsTabStop="False" Visibility="Collapsed"> @@ -162,6 +164,7 @@ Cursor="Arrow" FontSize="{StaticResource NumberBoxButtonIconSize}" Foreground="{DynamicResource TextControlButtonForeground}" + IsTabStop="False" Visibility="Collapsed"> diff --git a/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml b/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml index 862188d46..6d02f27e8 100644 --- a/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml +++ b/src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml @@ -206,6 +206,7 @@ Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}" CommandParameter="clear" Cursor="Arrow" + IsTabStop="False" Foreground="{DynamicResource TextControlButtonForeground}"> @@ -229,6 +230,7 @@ Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}" CommandParameter="reveal" Cursor="Arrow" + IsTabStop="False" Foreground="{DynamicResource TextControlButtonForeground}"> diff --git a/src/Wpf.Ui/Controls/TextBox/TextBox.xaml b/src/Wpf.Ui/Controls/TextBox/TextBox.xaml index d7cfcb677..bbfc4cca1 100644 --- a/src/Wpf.Ui/Controls/TextBox/TextBox.xaml +++ b/src/Wpf.Ui/Controls/TextBox/TextBox.xaml @@ -206,6 +206,7 @@ BorderBrush="Transparent" Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}" Cursor="Arrow" + IsTabStop="False" Foreground="{DynamicResource TextControlButtonForeground}"> From 232be521429c4bfe93e1374bc5202c799e6bd711 Mon Sep 17 00:00:00 2001 From: Mijail Todorovich Date: Tue, 27 Feb 2024 10:21:30 -0300 Subject: [PATCH 16/30] Don't focus on ControlIcon in NumberBox --- src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml b/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml index 766231f7d..b9788ab89 100644 --- a/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml +++ b/src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml @@ -82,6 +82,7 @@ VerticalAlignment="Top" Content="{TemplateBinding Icon}" FontSize="16" + IsTabStop="False" Foreground="{TemplateBinding Foreground}" /> From f883cd5be8411a0c7468af3522575c81b3d31c50 Mon Sep 17 00:00:00 2001 From: Mijail Todorovich Date: Tue, 27 Feb 2024 10:55:08 -0300 Subject: [PATCH 17/30] Decrease un-selectable whitespace by ensuring Grid has a background --- src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml b/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml index d63fb518d..0b44a8a4e 100644 --- a/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml +++ b/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml @@ -101,7 +101,7 @@ - + Date: Tue, 27 Feb 2024 11:11:08 -0300 Subject: [PATCH 18/30] Eliminate un-selectable whitespace by ensuring there's no margin between ComboBoxItems Currently, `ComboBoxItem` and `Border` both have margins equal to `ComboBoxItemMargin`. This gives an effective margin of `2 * ComboBoxItemMargin`. By removing the `ComboBoxItem` margin and setting `Border`'s margin to `2 * ComboBoxItemMargin` we ensure there's no space between `ComboBoxItem`s that can't be clicked to change the selection. A downside of this is that the customizability of `ComboBoxItem` is diminished. It is possible to increase the margin but not decrease it under `2 * ComboBoxItemMargin` --- src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml b/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml index 0b44a8a4e..2e8e596c6 100644 --- a/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml +++ b/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml @@ -20,7 +20,7 @@ 1,1,1,1 0,0,0,2 8,0,10,0 - 3,2,3,0 + 6,4,6,0 10,8,8,8 11.0 32.0 @@ -92,7 +92,6 @@ - @@ -104,7 +103,7 @@ Date: Tue, 5 Mar 2024 23:05:20 +0100 Subject: [PATCH 19/30] Fixed progressbar orientation property. --- .../Controls/ProgressBar/ProgressBar.xaml | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/Wpf.Ui/Controls/ProgressBar/ProgressBar.xaml b/src/Wpf.Ui/Controls/ProgressBar/ProgressBar.xaml index 9c3e1be21..cced092ad 100644 --- a/src/Wpf.Ui/Controls/ProgressBar/ProgressBar.xaml +++ b/src/Wpf.Ui/Controls/ProgressBar/ProgressBar.xaml @@ -1,4 +1,4 @@ -