From e9b9579eabfc4894cd2288a9f600ccba83d59b06 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 26 Jan 2021 21:03:23 +0800 Subject: [PATCH 001/456] fixed #648 --- .../Styles/Base/DatePickerBaseStyle.xaml | 4 ++- .../Styles/Base/DateTimePickerBaseStyle.xaml | 13 +++---- .../Styles/Base/NumericUpDownBaseStyle.xaml | 13 +++---- .../Styles/Base/TimePickerBaseStyle.xaml | 13 +++---- .../HandyControl_Shared/Themes/Theme.xaml | 35 +++++++++++-------- 5 files changed, 44 insertions(+), 34 deletions(-) diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/DatePickerBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/DatePickerBaseStyle.xaml index 0a10b083..4b7a442c 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/DatePickerBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/DatePickerBaseStyle.xaml @@ -15,6 +15,7 @@ + @@ -348,6 +349,7 @@ - \ No newline at end of file + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/DateTimePickerBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/DateTimePickerBaseStyle.xaml index e1495709..776b1348 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/DateTimePickerBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/DateTimePickerBaseStyle.xaml @@ -19,6 +19,7 @@ + @@ -30,7 +31,7 @@ - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12,6 +18,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + From 41c661da1a3e3508f89f619cae52c39eaffa5ccf Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Mon, 2 Aug 2021 00:06:16 +0800 Subject: [PATCH 335/456] support for tab switching --- .../HandyControl_Net_40/Themes/Theme.xaml | 2 +- .../Controls/Ribbon/Ribbon.cs | 179 +++++------------- .../Controls/Ribbon/RibbonTab.cs | 73 ++++++- .../Controls/Ribbon/RibbonTabHeader.cs | 63 +++++- .../Themes/Styles/Ribbon.xaml | 5 +- 5 files changed, 186 insertions(+), 136 deletions(-) diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml index 0ca52e76..f028b5e3 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml @@ -10867,7 +10867,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Controls/Ribbon/Ribbon.cs b/src/Shared/HandyControl_Shared/Controls/Ribbon/Ribbon.cs index 9fae196c..0578655b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Ribbon/Ribbon.cs +++ b/src/Shared/HandyControl_Shared/Controls/Ribbon/Ribbon.cs @@ -1,12 +1,9 @@ using System; using System.Collections.ObjectModel; using System.Collections.Specialized; -using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; -using System.Windows.Media; -using HandyControl.Data; namespace HandyControl.Controls { @@ -19,25 +16,48 @@ namespace HandyControl.Controls private readonly ObservableCollection _tabHeaderItemsSource = new(); + internal ItemsControl RibbonTabHeaderItemsControl => _tabHeaderItemsControl; + public Ribbon() { + SetRibbon(this, this); ItemContainerGenerator.StatusChanged += OnItemContainerGeneratorStatusChanged; - - AddHandler(SelectableItem.SelectedEvent, new RoutedEventHandler(OnTabHeaderSelected)); } - private void OnTabHeaderSelected(object sender, RoutedEventArgs e) + internal static readonly DependencyProperty RibbonProperty = DependencyProperty.RegisterAttached( + "Ribbon", typeof(Ribbon), typeof(Ribbon), + new FrameworkPropertyMetadata(default(Ribbon), FrameworkPropertyMetadataOptions.Inherits)); + + internal static void SetRibbon(DependencyObject element, Ribbon value) + => element.SetValue(RibbonProperty, value); + + internal static Ribbon GetRibbon(DependencyObject element) + => (Ribbon) element.GetValue(RibbonProperty); + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + _tabHeaderItemsControl = GetTemplateChild(TabHeaderItemsControl) as ItemsControl; + if (_tabHeaderItemsControl is {ItemsSource: null}) + { + _tabHeaderItemsControl.ItemsSource = _tabHeaderItemsSource; + } + } + + internal void ResetSelection() + { + SelectedIndex = -1; + InitializeSelection(); + } + + internal void NotifyMouseClickedOnTabHeader(RibbonTabHeader tabHeader) { if (_tabHeaderItemsControl == null) { return; } - if (e.OriginalSource is not RibbonTabHeader tabHeader) - { - return; - } - var selectedIndex = _tabHeaderItemsControl.ItemContainerGenerator.IndexFromContainer(tabHeader); var currentSelectedIndex = SelectedIndex; @@ -47,73 +67,14 @@ namespace HandyControl.Controls } } - private static readonly DependencyPropertyKey SelectedContentPropertyKey = - DependencyProperty.RegisterReadOnly("SelectedContent", typeof(object), typeof(Ribbon), - new FrameworkPropertyMetadata((object) null)); - - public static readonly DependencyProperty SelectedContentProperty = - SelectedContentPropertyKey.DependencyProperty; - - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public object SelectedContent + internal void NotifyTabHeaderChanged() { - get => GetValue(SelectedContentProperty); - internal set => SetValue(SelectedContentPropertyKey, value); - } - - public static readonly DependencyProperty IsMinimizedProperty = DependencyProperty.Register(nameof(IsMinimized), - typeof(bool), typeof(Ribbon), - new PropertyMetadata(ValueBoxes.FalseBox, OnIsMinimizedChanged, CoerceIsMinimized)); - - private static object CoerceIsMinimized(DependencyObject d, object basevalue) - { - var num = (bool) basevalue ? 1 : 0; - var ribbon = (Ribbon) d; - return num != 0 && ribbon.ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated ? ValueBoxes.FalseBox : basevalue; - } - - private static void OnIsMinimizedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - - } - - public bool IsMinimized - { - get => (bool) GetValue(IsMinimizedProperty); - set => SetValue(IsMinimizedProperty, ValueBoxes.BooleanBox(value)); - } - - public static readonly DependencyProperty IsDropDownOpenProperty = - DependencyProperty.Register(nameof(IsDropDownOpen), typeof(bool), typeof(Ribbon), - new PropertyMetadata(ValueBoxes.FalseBox, OnIsDropDownOpenChanged, CoerceIsDropDownOpen)); - - private static object CoerceIsDropDownOpen(DependencyObject d, object basevalue) - { - return ValueBoxes.FalseBox; - } - - private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - - } - - public bool IsDropDownOpen - { - get => (bool) GetValue(IsDropDownOpenProperty); - set => SetValue(IsDropDownOpenProperty, ValueBoxes.BooleanBox(value)); - } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - _tabHeaderItemsControl = GetTemplateChild(TabHeaderItemsControl) as ItemsControl; - if (_tabHeaderItemsControl is {ItemsSource: null}) + if (ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated) { - _tabHeaderItemsControl.ItemsSource = _tabHeaderItemsSource; + return; } - UpdateSelectedContent(); + RefreshHeaderCollection(); } protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e) @@ -140,6 +101,23 @@ namespace HandyControl.Controls protected override bool IsItemItsOwnContainerOverride(object item) => item is RibbonTab; + protected override void OnSelectionChanged(SelectionChangedEventArgs e) + { + base.OnSelectionChanged(e); + + if (e.AddedItems is not {Count: > 0}) + { + return; + } + + if (e.RemovedItems.Count > 0 && ItemContainerGenerator.ContainerFromItem(e.RemovedItems[0]) is RibbonTab oldRibbonTab) + { + oldRibbonTab.IsSelected = false; + } + + SelectedItem = e.AddedItems[0]; + } + private void OnItemContainerGeneratorStatusChanged(object sender, EventArgs e) { if (ItemContainerGenerator.Status != GeneratorStatus.ContainersGenerated) @@ -147,7 +125,6 @@ namespace HandyControl.Controls return; } - CoerceValue(Ribbon.IsMinimizedProperty); InitializeSelection(); RefreshHeaderCollection(); } @@ -182,58 +159,6 @@ namespace HandyControl.Controls SelectedIndex = firstVisibleTabIndex; } - private static bool EqualsEx(object o1, object o2) - { - try - { - return Equals(o1, o2); - } - catch (InvalidCastException) - { - return false; - } - } - - private RibbonTab GetSelectedRibbonTab() - { - var selectedItem = SelectedItem; - if (selectedItem != null) - { - if (selectedItem is not RibbonTab ribbonTab) - { - ribbonTab = ItemContainerGenerator.ContainerFromIndex(SelectedIndex) as RibbonTab; - - if (ribbonTab == null || !EqualsEx(selectedItem, ItemContainerGenerator.ItemFromContainer(ribbonTab))) - { - ribbonTab = ItemContainerGenerator.ContainerFromItem(selectedItem) as RibbonTab; - } - } - - return ribbonTab; - } - - return null; - } - - private void UpdateSelectedContent() - { - if (SelectedIndex < 0) - { - SelectedContent = null; - return; - } - - var ribbonTab = GetSelectedRibbonTab(); - if (ribbonTab == null) - { - return; - } - - var visualParent = VisualTreeHelper.GetParent(ribbonTab) as FrameworkElement; - - //seitem - } - private static object CreateDefaultHeaderObject() => new SingleSpaceObject(); private void RefreshHeaderCollection() diff --git a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTab.cs b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTab.cs index 2df2ee7a..1f5e3da6 100644 --- a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTab.cs +++ b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTab.cs @@ -1,13 +1,58 @@ using System.Windows; using System.Windows.Controls; +using System.Windows.Controls.Primitives; using HandyControl.Data; +using HandyControl.Tools; namespace HandyControl.Controls { public class RibbonTab : HeaderedItemsControl { + public Ribbon Ribbon => Ribbon.GetRibbon(this); + + internal RibbonTabHeader RibbonTabHeader + { + get + { + var ribbon = Ribbon; + if (ribbon == null) + { + return null; + } + + var index = ribbon.ItemContainerGenerator.IndexFromContainer(this); + if (index < 0) + { + return null; + } + + var headerItemsControl = ribbon.RibbonTabHeaderItemsControl; + return headerItemsControl?.ItemContainerGenerator.ContainerFromIndex(index) as RibbonTabHeader; + } + } + + static RibbonTab() + { + VisibilityProperty.OverrideMetadata(typeof(RibbonTab), new PropertyMetadata(Visibility.Visible, OnVisibilityChanged)); + } + public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( - "IsSelected", typeof(bool), typeof(RibbonTab), new PropertyMetadata(ValueBoxes.FalseBox)); + "IsSelected", typeof(bool), typeof(RibbonTab), new PropertyMetadata(ValueBoxes.FalseBox, OnIsSelectedChanged)); + + private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var ribbonTab = (RibbonTab) d; + if (ribbonTab.IsSelected) + { + ribbonTab.OnSelected(new RoutedEventArgs(Selector.SelectedEvent, ribbonTab)); + } + else + { + ribbonTab.OnUnselected(new RoutedEventArgs(Selector.UnselectedEvent, ribbonTab)); + } + + ribbonTab.RibbonTabHeader?.CoerceValue(RibbonTabHeader.IsSelectedProperty); + } public bool IsSelected { @@ -15,6 +60,32 @@ namespace HandyControl.Controls set => SetValue(IsSelectedProperty, value); } + protected virtual void OnSelected(RoutedEventArgs e) => RaiseEvent(e); + + protected virtual void OnUnselected(RoutedEventArgs e) => RaiseEvent(e); + + protected override void OnHeaderChanged(object oldHeader, object newHeader) + { + base.OnHeaderChanged(oldHeader, newHeader); + Ribbon?.NotifyTabHeaderChanged(); + } + + private static void OnVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var ribbonTab = (RibbonTab) d; + var ribbon = ribbonTab.Ribbon; + + if (ribbon == null || + !ribbonTab.IsSelected || + (Visibility) e.OldValue != Visibility.Visible || + (Visibility) e.NewValue == Visibility.Visible) + { + return; + } + + ribbon.ResetSelection(); + } + protected override DependencyObject GetContainerForItemOverride() => new RibbonGroup(); protected override bool IsItemItsOwnContainerOverride(object item) => item is RibbonGroup; diff --git a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeader.cs b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeader.cs index 66d8d2f4..569668d0 100644 --- a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeader.cs +++ b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeader.cs @@ -1,7 +1,62 @@ -namespace HandyControl.Controls -{ - public class RibbonTabHeader : SelectableItem - { +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using HandyControl.Data; +namespace HandyControl.Controls +{ + public class RibbonTabHeader : ContentControl + { + public Ribbon Ribbon => Ribbon.GetRibbon(this); + + internal RibbonTab RibbonTab + { + get + { + var itemsControl = ItemsControl.ItemsControlFromItemContainer(this); + var ribbon = Ribbon; + if (itemsControl == null || ribbon == null) + { + return null; + } + + var index = itemsControl.ItemContainerGenerator.IndexFromContainer(this); + return ribbon.ItemContainerGenerator.ContainerFromIndex(index) as RibbonTab; + } + } + + public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( + "IsSelected", typeof(bool), typeof(RibbonTabHeader), + new PropertyMetadata(ValueBoxes.FalseBox, OnIsSelectedChanged, CoerceIsSelected)); + + private static object CoerceIsSelected(DependencyObject d, object basevalue) + { + var ribbonTab = ((RibbonTabHeader) d).RibbonTab; + return ribbonTab != null ? ValueBoxes.BooleanBox(ribbonTab.IsSelected) : basevalue; + } + + private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ((RibbonTabHeader) d).OnIsSelectedChanged((bool) e.OldValue, (bool) e.NewValue); + } + + public bool IsSelected + { + get => (bool) GetValue(IsSelectedProperty); + set => SetValue(IsSelectedProperty, value); + } + + protected virtual void OnIsSelectedChanged(bool oldIsSelected, bool newIsSelected) + { + + } + + protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) + { + base.OnMouseLeftButtonDown(e); + + Ribbon.NotifyMouseClickedOnTabHeader(this); + RibbonTab.IsSelected = true; + } } } diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml index 1a3e598a..f5b2d876 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml @@ -51,7 +51,6 @@ - @@ -85,7 +84,7 @@ - + @@ -112,7 +111,7 @@ - + From 03a4777d293fec7bfc010c04094c06d725cd5de7 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Wed, 4 Aug 2021 23:13:43 +0800 Subject: [PATCH 336/456] optimized tab switching logic --- .../Controls/Ribbon/Ribbon.cs | 8 ++---- .../Controls/Ribbon/RibbonTab.cs | 9 ++++-- .../Controls/Ribbon/RibbonTabHeader.cs | 28 +++++++++++++++++-- .../Ribbon/RibbonTabHeaderItemsControl.cs | 10 +++++++ .../Themes/Styles/Ribbon.xaml | 5 +++- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/Shared/HandyControl_Shared/Controls/Ribbon/Ribbon.cs b/src/Shared/HandyControl_Shared/Controls/Ribbon/Ribbon.cs index 0578655b..2ae4e8ac 100644 --- a/src/Shared/HandyControl_Shared/Controls/Ribbon/Ribbon.cs +++ b/src/Shared/HandyControl_Shared/Controls/Ribbon/Ribbon.cs @@ -4,6 +4,7 @@ using System.Collections.Specialized; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; +using System.Windows.Input; namespace HandyControl.Controls { @@ -51,7 +52,7 @@ namespace HandyControl.Controls InitializeSelection(); } - internal void NotifyMouseClickedOnTabHeader(RibbonTabHeader tabHeader) + internal void NotifyMouseClickedOnTabHeader(RibbonTabHeader tabHeader, MouseButtonEventArgs e) { if (_tabHeaderItemsControl == null) { @@ -110,11 +111,6 @@ namespace HandyControl.Controls return; } - if (e.RemovedItems.Count > 0 && ItemContainerGenerator.ContainerFromItem(e.RemovedItems[0]) is RibbonTab oldRibbonTab) - { - oldRibbonTab.IsSelected = false; - } - SelectedItem = e.AddedItems[0]; } diff --git a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTab.cs b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTab.cs index 1f5e3da6..90a53309 100644 --- a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTab.cs +++ b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTab.cs @@ -36,8 +36,13 @@ namespace HandyControl.Controls VisibilityProperty.OverrideMetadata(typeof(RibbonTab), new PropertyMetadata(Visibility.Visible, OnVisibilityChanged)); } - public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( - "IsSelected", typeof(bool), typeof(RibbonTab), new PropertyMetadata(ValueBoxes.FalseBox, OnIsSelectedChanged)); + public static readonly DependencyProperty IsSelectedProperty = + Selector.IsSelectedProperty.AddOwner(typeof(RibbonTab), + new FrameworkPropertyMetadata(ValueBoxes.FalseBox, + FrameworkPropertyMetadataOptions.AffectsParentMeasure | + FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | + FrameworkPropertyMetadataOptions.Journal, + OnIsSelectedChanged)); private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { diff --git a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeader.cs b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeader.cs index 569668d0..74c2028b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeader.cs +++ b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeader.cs @@ -46,6 +46,11 @@ namespace HandyControl.Controls set => SetValue(IsSelectedProperty, value); } + internal void PrepareRibbonTabHeader() + { + CoerceValue(IsSelectedProperty); + } + protected virtual void OnIsSelectedChanged(bool oldIsSelected, bool newIsSelected) { @@ -53,10 +58,27 @@ namespace HandyControl.Controls protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { - base.OnMouseLeftButtonDown(e); + var ribbon = Ribbon; + if (ribbon != null) + { + ribbon.NotifyMouseClickedOnTabHeader(this, e); + e.Handled = true; + } - Ribbon.NotifyMouseClickedOnTabHeader(this); - RibbonTab.IsSelected = true; + base.OnMouseLeftButtonDown(e); + } + + protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e) + { + base.OnGotKeyboardFocus(e); + + var ribbonTab = RibbonTab; + if (ribbonTab == null) + { + return; + } + + ribbonTab.IsSelected = true; } } } diff --git a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeaderItemsControl.cs b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeaderItemsControl.cs index 588e2e35..5e0720fe 100644 --- a/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeaderItemsControl.cs +++ b/src/Shared/HandyControl_Shared/Controls/Ribbon/RibbonTabHeaderItemsControl.cs @@ -8,5 +8,15 @@ namespace HandyControl.Controls protected override DependencyObject GetContainerForItemOverride() => new RibbonTabHeader(); protected override bool IsItemItsOwnContainerOverride(object item) => item is RibbonTabHeader; + + protected override void PrepareContainerForItemOverride(DependencyObject element, object item) + { + base.PrepareContainerForItemOverride(element, item); + + if (element is RibbonTabHeader ribbonTabHeader) + { + ribbonTabHeader.PrepareRibbonTabHeader(); + } + } } } diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml index f5b2d876..2f0b7cf9 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml @@ -6,6 +6,7 @@ M0,0 8,0 8,1 1,1 1,8 0,8 M 3.7,3 8,7.3 8,4 9,4 9,9 4,9 4,8 7.3,8 3,3.7 @@ -7056,16 +7081,18 @@ - - + + + + + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml index b8f09c26..432d7c78 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Ribbon.xaml @@ -9,9 +9,9 @@ @@ -4707,6 +4732,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -8088,6 +8091,9 @@ + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Menu.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Menu.xaml index 1c344202..4466a2cf 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Menu.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Menu.xaml @@ -1,7 +1,14 @@ - + + diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index dd801cf5..50a0ddd0 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -6511,8 +6511,7 @@ @@ -8205,6 +8208,9 @@ + + + diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml index 1c0304de..4d01a2c0 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml @@ -9503,8 +9503,8 @@ - - + + @@ -12938,33 +12938,43 @@ + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + + diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index 50a0ddd0..edf29b4b 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -9620,8 +9620,8 @@ - - + + @@ -13079,27 +13079,28 @@ + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -13115,6 +13116,15 @@ + diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml index 4d01a2c0..20986889 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml @@ -777,7 +777,7 @@ - + + + + @@ -12630,9 +12772,9 @@ - - - + + + @@ -12724,6 +12866,8 @@ + + - + + + + + + + + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/DataGrid.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/DataGrid.xaml index 48d24bb1..78d5729c 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/DataGrid.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/DataGrid.xaml @@ -24,9 +24,9 @@ - - - + + + @@ -132,6 +132,8 @@ + + diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index edf29b4b..1d54ad3c 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -777,7 +777,7 @@ - + + + + @@ -12762,9 +12904,9 @@ - - - + + + @@ -12865,6 +13007,8 @@ + + - - diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml index 20986889..1c0ecf8e 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml @@ -13086,24 +13086,66 @@ + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml index 073f62cf..6516a8b2 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml @@ -2,41 +2,144 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:hc="clr-namespace:HandyControl.Controls"> - - - diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index 1d54ad3c..4efd9cb5 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -13227,24 +13227,66 @@ + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3e58f8adbf5ed9838ca1ee5dfc3a0ebd10512bd9 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Sat, 20 Aug 2022 17:32:21 +0800 Subject: [PATCH 353/456] fix: property grid can not show whole content issue. --- .../Controls/PropertyGrid/PropertyItemsControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItemsControl.cs b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItemsControl.cs index b1501dee..17a726ac 100644 --- a/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItemsControl.cs +++ b/src/Shared/HandyControl_Shared/Controls/PropertyGrid/PropertyItemsControl.cs @@ -11,6 +11,8 @@ public class PropertyItemsControl : ListBox #if !NET40 VirtualizingPanel.SetIsVirtualizingWhenGrouping(this, true); VirtualizingPanel.SetScrollUnit(this, ScrollUnit.Pixel); +#else + System.Windows.Controls.ScrollViewer.SetCanContentScroll(this, false); #endif } } From 7fd789380bd8b55215295e5516552a6f7cb9ba71 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Sat, 20 Aug 2022 23:51:14 +0800 Subject: [PATCH 354/456] enhance: close #1064 --- .../UserControl/Controls/PinBoxDemoCtl.xaml | 8 +- .../Controls/Input/PinBox.cs | 78 ++++++++++++++++++- 2 files changed, 79 insertions(+), 7 deletions(-) diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml index 728c99a3..7cc2a38e 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml @@ -4,9 +4,11 @@ xmlns:hc="https://handyorg.github.io/handycontrol" Background="{DynamicResource RegionBrush}"> - + - - + + + + diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs index b22795ff..0cd7810d 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs @@ -88,6 +88,11 @@ public class PinBox : Control if (e.OriginalSource is System.Windows.Controls.PasswordBox passwordBox) { + if (!IsSafeEnabled) + { + SetCurrentValue(UnsafePasswordProperty, Password); + } + if (passwordBox.Password.Length > 0) { if (++_inputIndex >= Length) @@ -192,7 +197,9 @@ public class PinBox : Control { get { - return string.Join("", _panel.Children.OfType().Select(item => item.Password)); + return _panel == null + ? string.Empty + : string.Join(string.Empty, _panel.Children.OfType().Select(item => item.Password)); } set { @@ -212,14 +219,31 @@ public class PinBox : Control return; } - var length = Length; - if (string.IsNullOrEmpty(value) || value.Length != length || value.Length != _panel.Children.Count) + _isInternalAction = true; + + if (string.IsNullOrEmpty(value)) { _panel.Children.OfType().Do(item => item.Clear()); } else { - _panel.Children.OfType().DoWithIndex((item, index) => item.Password = value[index].ToString()); + _panel.Children + .OfType() + .Take(Math.Min(Length, value.Length)) + .DoWithIndex((item, index) => item.Password = value[index].ToString()); + + _panel.Children + .OfType() + .Skip(value.Length) + .Take(Length - value.Length) + .Do(item => item.Clear()); + } + + _isInternalAction = false; + + if (!IsSafeEnabled) + { + SetCurrentValue(UnsafePasswordProperty, Password); } } } @@ -321,6 +345,50 @@ public class PinBox : Control set => SetValue(CaretBrushProperty, value); } + public static readonly DependencyProperty IsSafeEnabledProperty = PasswordBox.IsSafeEnabledProperty + .AddOwner(typeof(PinBox), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, OnIsSafeEnabledChanged)); + + private static void OnIsSafeEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var p = (PinBox) d; + p.OnIsSafeEnabledChanged((bool)e.NewValue); + } + + private void OnIsSafeEnabledChanged(bool newValue) + { + if (_panel == null) + { + return; + } + + SetCurrentValue(UnsafePasswordProperty, !newValue ? Password : string.Empty); + } + + public bool IsSafeEnabled + { + get => (bool) GetValue(IsSafeEnabledProperty); + set => SetValue(IsSafeEnabledProperty, ValueBoxes.BooleanBox(value)); + } + + public static readonly DependencyProperty UnsafePasswordProperty = PasswordBox.UnsafePasswordProperty + .AddOwner(typeof(PinBox), new FrameworkPropertyMetadata(default(string), + FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnUnsafePasswordChanged)); + + private static void OnUnsafePasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var p = (PinBox) d; + if (!p.IsSafeEnabled) + { + p.Password = e.NewValue != null ? e.NewValue.ToString() : string.Empty; + } + } + + public string UnsafePassword + { + get => (string) GetValue(UnsafePasswordProperty); + set => SetValue(UnsafePasswordProperty, value); + } + public static readonly RoutedEvent CompletedEvent = EventManager.RegisterRoutedEvent("Completed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(PinBox)); @@ -405,6 +473,8 @@ public class PinBox : Control _passwordList.Clear(); } + + OnIsSafeEnabledChanged(IsSafeEnabled); } } } From 10afbbc3c5876509458bf8489b84a8be56967dcb Mon Sep 17 00:00:00 2001 From: "github-actions-dotnet-formatter[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 15:54:23 +0000 Subject: [PATCH 355/456] Automated dotnet-format update --- src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs index 0cd7810d..87a69f52 100644 --- a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs @@ -351,7 +351,7 @@ public class PinBox : Control private static void OnIsSafeEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var p = (PinBox) d; - p.OnIsSafeEnabledChanged((bool)e.NewValue); + p.OnIsSafeEnabledChanged((bool) e.NewValue); } private void OnIsSafeEnabledChanged(bool newValue) From bd9fb0df59af06e7ddc725c711fd14965dbc7667 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Mon, 22 Aug 2022 22:22:14 +0800 Subject: [PATCH 356/456] fix: fixed #1237. --- src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs b/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs index a0cdaac1..91a51991 100644 --- a/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs +++ b/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs @@ -470,6 +470,7 @@ public sealed class MessageBox : Window switch (messageBoxButton) { case MessageBoxButton.OK: + messageBox._messageBoxResult = MessageBoxResult.Yes; messageBox._showOk = true; messageBox._buttonOk = new Button { @@ -482,6 +483,7 @@ public sealed class MessageBox : Window break; case MessageBoxButton.OKCancel: + messageBox._messageBoxResult = MessageBoxResult.Cancel; messageBox._showOk = true; messageBox._buttonOk = new Button { @@ -512,6 +514,7 @@ public sealed class MessageBox : Window break; case MessageBoxButton.YesNo: + messageBox._messageBoxResult = MessageBoxResult.Cancel; messageBox._showYes = true; messageBox._buttonYes = new Button { @@ -541,6 +544,7 @@ public sealed class MessageBox : Window break; case MessageBoxButton.YesNoCancel: + messageBox._messageBoxResult = MessageBoxResult.Cancel; messageBox._showYes = true; messageBox._buttonYes = new Button { From a035c8c22b1e19540c1ee4828d583c7c7e3ed4cd Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Mon, 22 Aug 2022 22:38:56 +0800 Subject: [PATCH 357/456] enhance: close #1235. --- src/Net_40/HandyControl_Net_40/Themes/Theme.xaml | 3 ++- .../UserControl/Styles/ToggleButtonDemoCtl.xaml | 4 ++-- .../Themes/Styles/Base/ToggleButtonBaseStyle.xaml | 3 ++- src/Shared/HandyControl_Shared/Themes/Theme.xaml | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml index 1c0ecf8e..541f1a72 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml @@ -1824,6 +1824,7 @@ + @@ -1895,7 +1896,7 @@ - + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ToggleButtonDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ToggleButtonDemoCtl.xaml index 243a1f68..75053cb3 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ToggleButtonDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ToggleButtonDemoCtl.xaml @@ -115,7 +115,7 @@ - + @@ -227,7 +227,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToggleButtonBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToggleButtonBaseStyle.xaml index 4ccfa31a..f0dd111d 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToggleButtonBaseStyle.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ToggleButtonBaseStyle.xaml @@ -104,6 +104,7 @@ + @@ -175,7 +176,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index 4efd9cb5..3ef08a95 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -1824,6 +1824,7 @@ + @@ -1895,7 +1896,7 @@ - + From 7519c7e93a2efdc98b1064977baa8dc0e2ef6549 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Sat, 3 Sep 2022 17:55:07 +0800 Subject: [PATCH 358/456] fix: #1188 #1014 #981 #569 #1119 --- .../Styles/Base/CheckComboBoxBaseStyle.xaml | 2 + .../HandyControl_Net_40/Themes/Theme.xaml | 2 + .../Input/CheckComboBox/CheckComboBox.cs | 64 +++++++------------ .../Styles/Base/CheckComboBoxBaseStyle.xaml | 2 + .../HandyControl_Shared/Themes/Theme.xaml | 2 + 5 files changed, 32 insertions(+), 40 deletions(-) diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml index 2265496d..12f73066 100644 --- a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml +++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml @@ -67,6 +67,8 @@ diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index c963a1a3..706d860b 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -9067,7 +9067,7 @@ - + @@ -9075,7 +9075,7 @@ - + @@ -9101,10 +9101,10 @@ - + - + @@ -9130,7 +9130,7 @@ - + @@ -9138,7 +9138,7 @@ - + @@ -9164,10 +9164,10 @@ - + - + @@ -13056,6 +13056,10 @@ + @@ -18,6 +24,7 @@ diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml index 6516a8b2..febd0f76 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml @@ -155,6 +155,24 @@ + + + + + + + + + + + + + diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index 2b2cb59f..1135daa0 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -9670,6 +9670,17 @@ + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + @@ -11710,27 +11674,25 @@ - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + @@ -11745,8 +11707,8 @@ - @@ -54,11 +52,11 @@ - + - + @@ -71,11 +69,11 @@ - + - + @@ -83,136 +81,95 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - + + - + - + - + - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - + + - + - + - + diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index 1135daa0..1676a5f3 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -6515,6 +6515,7 @@ - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + @@ -11827,27 +11791,25 @@ - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + @@ -11862,8 +11824,8 @@ @@ -2503,6 +2507,7 @@ + @@ -4359,8 +4364,16 @@ @@ -60,15 +62,15 @@ - - + + - - + + - + @@ -76,29 +78,29 @@ - - + + - - + + - + @@ -106,14 +108,14 @@ - - + + - + - - + + @@ -121,17 +123,17 @@ - - + + - + - - + + - + @@ -140,10 +142,11 @@ diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/GroupBox.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/GroupBox.xaml index 78ce84f6..c50ff456 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/GroupBox.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/GroupBox.xaml @@ -1,10 +1,19 @@ - + - - diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index 1676a5f3..e03b86f8 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -498,11 +498,11 @@ - + - - + + @@ -512,11 +512,11 @@ - + - - + + @@ -532,28 +532,28 @@ - + - - + + - + - - + + @@ -2443,6 +2443,9 @@ + + + @@ -2452,6 +2455,7 @@ + @@ -2503,6 +2507,7 @@ + @@ -4359,8 +4364,16 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index 4c391eeb..5107cc00 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -1384,6 +1384,7 @@ + @@ -3420,25 +3421,50 @@ + + + + + + - + + + + + - - + + + + + + + + + + diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/TreeView.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/TreeView.xaml index 2c98f2d5..431ce041 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/TreeView.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/TreeView.xaml @@ -7,7 +7,7 @@ - + + + + + - - - \ No newline at end of file + diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml index fe60ec51..9893456d 100644 --- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml @@ -8997,10 +8997,11 @@ + - + From d7876544867c51f41bb817f29ed8b32da87d2b9a Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 8 Nov 2022 23:37:38 +0800 Subject: [PATCH 399/456] chore: optimize demo menu. --- .../UserControl/Main/MainWindowContent.xaml | 15 +++-- .../Main/MainWindowContent.xaml.cs | 65 ++++++++++++++++++- 2 files changed, 75 insertions(+), 5 deletions(-) diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainWindowContent.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainWindowContent.xaml index 2415bebc..6456a6d0 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainWindowContent.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/MainWindowContent.xaml @@ -4,14 +4,21 @@ Background="{StaticResource CloudDrawingBrush}" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:userControl="clr-namespace:HandyControlDemo.UserControl" + xmlns:hc="https://handyorg.github.io/handycontrol" x:Class="HandyControlDemo.UserControl.MainWindowContent"> - + - - - +