mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-23 01:38:40 +08:00
Refactor OptionButtonGroup
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<ResourceInclude Source="NavMenu/Themes/NavMenuThemes.axaml" />
|
||||
<ResourceInclude Source="Notifications/Themes/NotificationsThemes.axaml" />
|
||||
<ResourceInclude Source="NumericUpDown/Themes/NumericUpDownTheme.axaml" />
|
||||
<ResourceInclude Source="OptionButtonBox/Themes/OptionButtonBoxThemes.axaml" />
|
||||
<ResourceInclude Source="OptionButtonGroup/Themes/OptionButtonBoxThemes.axaml" />
|
||||
<ResourceInclude Source="Pagination/Themes/PaginationThemes.axaml" />
|
||||
<ResourceInclude Source="Popup/Themes/PopupThemes.axaml" />
|
||||
<ResourceInclude Source="PopupConfirm/Themes/PopupConfirmThemes.axaml" />
|
||||
|
||||
+9
-8
@@ -49,11 +49,6 @@ public class OptionButtonGroup : SelectingItemsControl,
|
||||
public static readonly StyledProperty<bool> IsWaveSpiritEnabledProperty =
|
||||
WaveSpiritAwareControlProperty.IsWaveSpiritEnabledProperty.AddOwner<OptionButtonGroup>();
|
||||
|
||||
public static readonly RoutedEvent<OptionCheckedChangedEventArgs> OptionCheckedChangedEvent =
|
||||
RoutedEvent.Register<OptionButtonGroup, OptionCheckedChangedEventArgs>(
|
||||
nameof(OptionCheckedChanged),
|
||||
RoutingStrategies.Bubble);
|
||||
|
||||
public SizeType SizeType
|
||||
{
|
||||
get => GetValue(SizeTypeProperty);
|
||||
@@ -77,13 +72,20 @@ public class OptionButtonGroup : SelectingItemsControl,
|
||||
get => GetValue(IsWaveSpiritEnabledProperty);
|
||||
set => SetValue(IsWaveSpiritEnabledProperty, value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 公共事件定义
|
||||
public static readonly RoutedEvent<OptionCheckedChangedEventArgs> OptionCheckedChangedEvent =
|
||||
RoutedEvent.Register<OptionButtonGroup, OptionCheckedChangedEventArgs>(
|
||||
nameof(OptionCheckedChanged),
|
||||
RoutingStrategies.Bubble);
|
||||
|
||||
public event EventHandler<OptionCheckedChangedEventArgs>? OptionCheckedChanged
|
||||
{
|
||||
add => AddHandler(OptionCheckedChangedEvent, value);
|
||||
remove => RemoveHandler(OptionCheckedChangedEvent, value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 内部属性定义
|
||||
@@ -127,8 +129,7 @@ public class OptionButtonGroup : SelectingItemsControl,
|
||||
|
||||
static OptionButtonGroup()
|
||||
{
|
||||
SelectionModeProperty.OverrideDefaultValue<OptionButtonGroup>(SelectionMode.Single |
|
||||
SelectionMode.AlwaysSelected);
|
||||
SelectionModeProperty.OverrideDefaultValue<OptionButtonGroup>(SelectionMode.Single | SelectionMode.AlwaysSelected);
|
||||
AutoScrollToSelectedItemProperty.OverrideDefaultValue<OptionButtonGroup>(false);
|
||||
ItemsPanelProperty.OverrideDefaultValue<OptionButtonGroup>(DefaultPanel);
|
||||
AffectsRender<OptionButtonGroup>(SelectionModeProperty);
|
||||
Reference in New Issue
Block a user