diff --git a/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs b/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs index a4f7b7694..b96e2cbbb 100644 --- a/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs +++ b/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs @@ -233,7 +233,7 @@ systemTheme is SystemTheme.HC1 or SystemTheme.HC2 or SystemTheme.HCBlack or Syst themeToSet = ApplicationTheme.HighContrast; } - Apply(themeToSet); + Apply(themeToSet, updateAccent: updateAccent); } /// diff --git a/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml b/src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml index d63fb518d..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 @@ - @@ -101,10 +100,10 @@ - + + @@ -45,9 +46,6 @@ - - - @@ -74,14 +72,6 @@ - - - - - - - - @@ -193,6 +183,7 @@ x:Name="PART_CloseButton" Grid.Column="4" ButtonType="Close" + MouseOverButtonsForeground="White" MouseOverBackground="{DynamicResource PaletteRedBrush}" /> diff --git a/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs b/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs index 876352858..e85dc4169 100644 --- a/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs +++ b/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs @@ -36,6 +36,19 @@ internal class TitleBarButton : Wpf.Ui.Controls.Button ) ); + /// + /// Property for . + /// + public static readonly DependencyProperty MouseOverButtonsForegroundProperty = DependencyProperty.Register( + nameof(MouseOverButtonsForeground), + typeof(Brush), + typeof(TitleBarButton), + new FrameworkPropertyMetadata( + SystemColors.ControlTextBrush, + FrameworkPropertyMetadataOptions.Inherits + ) + ); + /// /// Sets or gets the /// @@ -53,11 +66,20 @@ public Brush ButtonsForeground get => (Brush)GetValue(ButtonsForegroundProperty); set => SetValue(ButtonsForegroundProperty, value); } + /// + /// Foreground of the navigation buttons while mouse over. + /// + public Brush MouseOverButtonsForeground + { + get => (Brush)GetValue(MouseOverButtonsForegroundProperty); + set => SetValue(MouseOverButtonsForegroundProperty, value); + } public bool IsHovered { get; private set; } private User32.WM_NCHITTEST _returnValue; private Brush _defaultBackgroundBrush = Brushes.Transparent; //Should it be transparent? + private Brush _cacheButtonsForeground = SystemColors.ControlTextBrush; // cache ButtonsForeground while mouse over private bool _isClickedDown; @@ -70,6 +92,8 @@ public void Hover() return; Background = MouseOverBackground; + _cacheButtonsForeground = ButtonsForeground; + ButtonsForeground = MouseOverButtonsForeground; IsHovered = true; } @@ -82,6 +106,7 @@ public void RemoveHover() return; Background = _defaultBackgroundBrush; + ButtonsForeground = _cacheButtonsForeground; IsHovered = false; _isClickedDown = false; @@ -119,7 +144,6 @@ internal bool ReactToHwndHook(User32.WM msg, IntPtr lParam, out IntPtr returnInt RemoveHover(); return false; - case User32.WM.NCMOUSELEAVE: // Mouse leaves the window RemoveHover(); return false; 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)