chore: use nameof expression.

This commit is contained in:
NaBian committed 2022-10-10 23:15:48 +08:00
1 parent 3876444176
commit c513f5c6f5
116 files changed
+507 -507

No files matched your search

@@ -3428,42 +3428,42 @@
<Style BasedOn="{StaticResource LabelDefault}" TargetType="Label" /> <Style BasedOn="{StaticResource LabelDefault}" TargetType="Label" />
<Style x:Key="LabelDefault.Small" BasedOn="{StaticResource LabelDefault}" TargetType="Label"> <Style x:Key="LabelDefault.Small" BasedOn="{StaticResource LabelDefault}" TargetType="Label">
<Setter Property="Height" Value="20" /> <Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" /> <Setter Property="Padding" Value="6,0" />
</Style> </Style>
<Style x:Key="LabelPrimary" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label"> <Style x:Key="LabelPrimary" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}" /> <Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
</Style> </Style>
<Style x:Key="LabelPrimary.Small" BasedOn="{StaticResource LabelPrimary}" TargetType="Label"> <Style x:Key="LabelPrimary.Small" BasedOn="{StaticResource LabelPrimary}" TargetType="Label">
<Setter Property="Height" Value="20" /> <Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" /> <Setter Property="Padding" Value="6,0" />
</Style> </Style>
<Style x:Key="LabelSuccess" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label"> <Style x:Key="LabelSuccess" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource SuccessBrush}" /> <Setter Property="Background" Value="{DynamicResource SuccessBrush}" />
</Style> </Style>
<Style x:Key="LabelSuccess.Small" BasedOn="{StaticResource LabelSuccess}" TargetType="Label"> <Style x:Key="LabelSuccess.Small" BasedOn="{StaticResource LabelSuccess}" TargetType="Label">
<Setter Property="Height" Value="20" /> <Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" /> <Setter Property="Padding" Value="6,0" />
</Style> </Style>
<Style x:Key="LabelInfo" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label"> <Style x:Key="LabelInfo" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource InfoBrush}" /> <Setter Property="Background" Value="{DynamicResource InfoBrush}" />
</Style> </Style>
<Style x:Key="LabelInfo.Small" BasedOn="{StaticResource LabelInfo}" TargetType="Label"> <Style x:Key="LabelInfo.Small" BasedOn="{StaticResource LabelInfo}" TargetType="Label">
<Setter Property="Height" Value="20" /> <Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" /> <Setter Property="Padding" Value="6,0" />
</Style> </Style>
<Style x:Key="LabelWarning" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label"> <Style x:Key="LabelWarning" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource WarningBrush}" /> <Setter Property="Background" Value="{DynamicResource WarningBrush}" />
</Style> </Style>
<Style x:Key="LabelWarning.Small" BasedOn="{StaticResource LabelWarning}" TargetType="Label"> <Style x:Key="LabelWarning.Small" BasedOn="{StaticResource LabelWarning}" TargetType="Label">
<Setter Property="Height" Value="20" /> <Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" /> <Setter Property="Padding" Value="6,0" />
</Style> </Style>
<Style x:Key="LabelDanger" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label"> <Style x:Key="LabelDanger" BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
<Setter Property="Background" Value="{DynamicResource DangerBrush}" /> <Setter Property="Background" Value="{DynamicResource DangerBrush}" />
</Style> </Style>
<Style x:Key="LabelDanger.Small" BasedOn="{StaticResource LabelDanger}" TargetType="Label"> <Style x:Key="LabelDanger.Small" BasedOn="{StaticResource LabelDanger}" TargetType="Label">
<Setter Property="Height" Value="20" /> <Setter Property="Height" Value="20" />
<Setter Property="Padding" Value="6,1" /> <Setter Property="Padding" Value="6,0" />
</Style> </Style>
<Style BasedOn="{StaticResource CompareSliderBaseStyle}" TargetType="hc:CompareSlider" /> <Style BasedOn="{StaticResource CompareSliderBaseStyle}" TargetType="hc:CompareSlider" />
<Style BasedOn="{StaticResource PreviewSliderBaseStyle}" TargetType="hc:PreviewSlider" /> <Style BasedOn="{StaticResource PreviewSliderBaseStyle}" TargetType="hc:PreviewSlider" />
@@ -11,7 +11,7 @@ public partial class Avatar
} }
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame))); nameof(Source), typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
public BitmapFrame Source public BitmapFrame Source
{ {
@@ -20,7 +20,7 @@ public partial class Avatar
} }
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register( public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
"DisplayName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string))); nameof(DisplayName), typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string DisplayName public string DisplayName
{ {
@@ -29,7 +29,7 @@ public partial class Avatar
} }
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register( public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
"Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string))); nameof(Link), typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string Link public string Link
{ {
@@ -8,7 +8,7 @@ public partial class GeometryItem
public GeometryItem() => InitializeComponent(); public GeometryItem() => InitializeComponent();
public static readonly DependencyProperty InfoProperty = DependencyProperty.Register( public static readonly DependencyProperty InfoProperty = DependencyProperty.Register(
"Info", typeof(GeometryItemModel), typeof(GeometryItem), new PropertyMetadata(default(GeometryItemModel))); nameof(Info), typeof(GeometryItemModel), typeof(GeometryItem), new PropertyMetadata(default(GeometryItemModel)));
public GeometryItemModel Info public GeometryItemModel Info
{ {
@@ -7,7 +7,7 @@ namespace HandyControlDemo.UserControl;
public partial class ProgressButtonDemoCtl public partial class ProgressButtonDemoCtl
{ {
public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register( public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register(
"Progress", typeof(int), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(int))); nameof(Progress), typeof(int), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(int)));
public int Progress public int Progress
{ {
@@ -16,7 +16,7 @@ public partial class ProgressButtonDemoCtl
} }
public static readonly DependencyProperty IsUploadingProperty = DependencyProperty.Register( public static readonly DependencyProperty IsUploadingProperty = DependencyProperty.Register(
"IsUploading", typeof(bool), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(bool))); nameof(IsUploading), typeof(bool), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(bool)));
public bool IsUploading public bool IsUploading
{ {
@@ -20,7 +20,7 @@ public partial class PropertyGridDemoCtl
} }
public static readonly DependencyProperty DemoModelProperty = DependencyProperty.Register( public static readonly DependencyProperty DemoModelProperty = DependencyProperty.Register(
"DemoModel", typeof(PropertyGridDemoModel), typeof(PropertyGridDemoCtl), new PropertyMetadata(default(PropertyGridDemoModel))); nameof(DemoModel), typeof(PropertyGridDemoModel), typeof(PropertyGridDemoCtl), new PropertyMetadata(default(PropertyGridDemoModel)));
public PropertyGridDemoModel DemoModel public PropertyGridDemoModel DemoModel
{ {
@@ -15,7 +15,7 @@ public partial class AboutWindow
} }
public static readonly DependencyProperty CopyRightProperty = DependencyProperty.Register( public static readonly DependencyProperty CopyRightProperty = DependencyProperty.Register(
"CopyRight", typeof(string), typeof(AboutWindow), new PropertyMetadata(default(string))); nameof(CopyRight), typeof(string), typeof(AboutWindow), new PropertyMetadata(default(string)));
public string CopyRight public string CopyRight
{ {
@@ -24,7 +24,7 @@ public partial class AboutWindow
} }
public static readonly DependencyProperty VersionProperty = DependencyProperty.Register( public static readonly DependencyProperty VersionProperty = DependencyProperty.Register(
"Version", typeof(string), typeof(AboutWindow), new PropertyMetadata(default(string))); nameof(Version), typeof(string), typeof(AboutWindow), new PropertyMetadata(default(string)));
public string Version public string Version
{ {
@@ -17,7 +17,7 @@ public partial class DialogDemoWindow
} }
public static readonly DependencyProperty DialogTokenProperty = DependencyProperty.Register( public static readonly DependencyProperty DialogTokenProperty = DependencyProperty.Register(
"DialogToken", typeof(string), typeof(DialogDemoWindow), new PropertyMetadata(default(string))); nameof(DialogToken), typeof(string), typeof(DialogDemoWindow), new PropertyMetadata(default(string)));
public string DialogToken public string DialogToken
{ {
@@ -11,7 +11,7 @@ public abstract class AdornerElement : Control, IDisposable
protected FrameworkElement ElementTarget { get; set; } protected FrameworkElement ElementTarget { get; set; }
public static readonly DependencyProperty TargetProperty = DependencyProperty.Register( public static readonly DependencyProperty TargetProperty = DependencyProperty.Register(
"Target", typeof(FrameworkElement), typeof(AdornerElement), new PropertyMetadata(default(FrameworkElement), OnTargetChanged)); nameof(Target), typeof(FrameworkElement), typeof(AdornerElement), new PropertyMetadata(default(FrameworkElement), OnTargetChanged));
private static void OnTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -5,7 +5,7 @@ namespace HandyControl.Controls;
public class HeaderedSelectableItem : SelectableItem public class HeaderedSelectableItem : SelectableItem
{ {
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
"Header", typeof(object), typeof(HeaderedSelectableItem), new PropertyMetadata(default(object))); nameof(Header), typeof(object), typeof(HeaderedSelectableItem), new PropertyMetadata(default(object)));
public object Header public object Header
{ {
@@ -14,7 +14,7 @@ public class HeaderedSelectableItem : SelectableItem
} }
public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register(
"HeaderTemplate", typeof(DataTemplate), typeof(HeaderedSelectableItem), new PropertyMetadata(default(DataTemplate))); nameof(HeaderTemplate), typeof(DataTemplate), typeof(HeaderedSelectableItem), new PropertyMetadata(default(DataTemplate)));
public DataTemplate HeaderTemplate public DataTemplate HeaderTemplate
{ {
@@ -5,7 +5,7 @@ namespace HandyControl.Controls;
public class HeaderedSimpleItemsControl : SimpleItemsControl public class HeaderedSimpleItemsControl : SimpleItemsControl
{ {
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
"Header", typeof(object), typeof(HeaderedSimpleItemsControl), new PropertyMetadata(default(object))); nameof(Header), typeof(object), typeof(HeaderedSimpleItemsControl), new PropertyMetadata(default(object)));
public object Header public object Header
{ {
@@ -12,7 +12,7 @@ namespace HandyControl.Controls;
public class RegularItemsControl : SimpleItemsControl public class RegularItemsControl : SimpleItemsControl
{ {
public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register(
"ItemWidth", typeof(double), typeof(RegularItemsControl), new PropertyMetadata(ValueBoxes.Double200Box)); nameof(ItemWidth), typeof(double), typeof(RegularItemsControl), new PropertyMetadata(ValueBoxes.Double200Box));
public double ItemWidth public double ItemWidth
{ {
@@ -21,7 +21,7 @@ public class RegularItemsControl : SimpleItemsControl
} }
public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register(
"ItemHeight", typeof(double), typeof(RegularItemsControl), new PropertyMetadata(ValueBoxes.Double200Box)); nameof(ItemHeight), typeof(double), typeof(RegularItemsControl), new PropertyMetadata(ValueBoxes.Double200Box));
public double ItemHeight public double ItemHeight
{ {
@@ -30,7 +30,7 @@ public class RegularItemsControl : SimpleItemsControl
} }
public static readonly DependencyProperty ItemMarginProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemMarginProperty = DependencyProperty.Register(
"ItemMargin", typeof(Thickness), typeof(RegularItemsControl), new PropertyMetadata(default(Thickness))); nameof(ItemMargin), typeof(Thickness), typeof(RegularItemsControl), new PropertyMetadata(default(Thickness)));
public Thickness ItemMargin public Thickness ItemMargin
{ {
@@ -62,7 +62,7 @@ public class SelectableItem : ContentControl, ISelectable
protected virtual void OnSelected(RoutedEventArgs e) => RaiseEvent(e); protected virtual void OnSelected(RoutedEventArgs e) => RaiseEvent(e);
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
"IsSelected", typeof(bool), typeof(SelectableItem), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsSelected), typeof(bool), typeof(SelectableItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsSelected public bool IsSelected
{ {
@@ -71,7 +71,7 @@ public class SelectableItem : ContentControl, ISelectable
} }
public static readonly DependencyProperty SelfManageProperty = DependencyProperty.Register( public static readonly DependencyProperty SelfManageProperty = DependencyProperty.Register(
"SelfManage", typeof(bool), typeof(SelectableItem), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(SelfManage), typeof(bool), typeof(SelectableItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool SelfManage public bool SelfManage
{ {
@@ -80,7 +80,7 @@ public class SelectableItem : ContentControl, ISelectable
} }
public static readonly DependencyProperty CanDeselectProperty = DependencyProperty.Register( public static readonly DependencyProperty CanDeselectProperty = DependencyProperty.Register(
"CanDeselect", typeof(bool), typeof(SelectableItem), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(CanDeselect), typeof(bool), typeof(SelectableItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool CanDeselect public bool CanDeselect
{ {
@@ -20,15 +20,15 @@ public class SimpleItemsControl : Control
private const string ElementPanel = "PART_Panel"; private const string ElementPanel = "PART_Panel";
public static readonly DependencyProperty ItemTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemTemplateProperty = DependencyProperty.Register(
"ItemTemplate", typeof(DataTemplate), typeof(SimpleItemsControl), nameof(ItemTemplate), typeof(DataTemplate), typeof(SimpleItemsControl),
new FrameworkPropertyMetadata(default(DataTemplate), OnItemTemplateChanged)); new FrameworkPropertyMetadata(default(DataTemplate), OnItemTemplateChanged));
public static readonly DependencyProperty ItemContainerStyleProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemContainerStyleProperty = DependencyProperty.Register(
"ItemContainerStyle", typeof(Style), typeof(SimpleItemsControl), nameof(ItemContainerStyle), typeof(Style), typeof(SimpleItemsControl),
new PropertyMetadata(default(Style), OnItemContainerStyleChanged)); new PropertyMetadata(default(Style), OnItemContainerStyleChanged));
public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register(
"ItemsSource", typeof(IEnumerable), typeof(SimpleItemsControl), nameof(ItemsSource), typeof(IEnumerable), typeof(SimpleItemsControl),
new PropertyMetadata(default(IEnumerable), OnItemsSourceChanged)); new PropertyMetadata(default(IEnumerable), OnItemsSourceChanged));
public SimpleItemsControl() public SimpleItemsControl()
@@ -50,7 +50,7 @@ public class RunningBlock : ContentControl
private void ElementPanel_SizeChanged(object sender, SizeChangedEventArgs e) => UpdateContent(); private void ElementPanel_SizeChanged(object sender, SizeChangedEventArgs e) => UpdateContent();
public static readonly DependencyProperty RunawayProperty = DependencyProperty.Register( public static readonly DependencyProperty RunawayProperty = DependencyProperty.Register(
"Runaway", typeof(bool), typeof(RunningBlock), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(Runaway), typeof(bool), typeof(RunningBlock), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.AffectsRender));
public bool Runaway public bool Runaway
{ {
@@ -59,7 +59,7 @@ public class RunningBlock : ContentControl
} }
public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register(
"AutoRun", typeof(bool), typeof(RunningBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(AutoRun), typeof(bool), typeof(RunningBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
public bool AutoRun public bool AutoRun
{ {
@@ -68,7 +68,7 @@ public class RunningBlock : ContentControl
} }
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(RunningBlock), new FrameworkPropertyMetadata(default(Orientation), FrameworkPropertyMetadataOptions.AffectsRender)); nameof(Orientation), typeof(Orientation), typeof(RunningBlock), new FrameworkPropertyMetadata(default(Orientation), FrameworkPropertyMetadataOptions.AffectsRender));
public Orientation Orientation public Orientation Orientation
{ {
@@ -77,7 +77,7 @@ public class RunningBlock : ContentControl
} }
public static readonly DependencyProperty DurationProperty = DependencyProperty.Register( public static readonly DependencyProperty DurationProperty = DependencyProperty.Register(
"Duration", typeof(Duration), typeof(RunningBlock), new FrameworkPropertyMetadata(new Duration(TimeSpan.FromSeconds(5)), FrameworkPropertyMetadataOptions.AffectsRender)); nameof(Duration), typeof(Duration), typeof(RunningBlock), new FrameworkPropertyMetadata(new Duration(TimeSpan.FromSeconds(5)), FrameworkPropertyMetadataOptions.AffectsRender));
public Duration Duration public Duration Duration
{ {
@@ -86,7 +86,7 @@ public class RunningBlock : ContentControl
} }
public static readonly DependencyProperty SpeedProperty = DependencyProperty.Register( public static readonly DependencyProperty SpeedProperty = DependencyProperty.Register(
"Speed", typeof(double), typeof(RunningBlock), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(Speed), typeof(double), typeof(RunningBlock), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsRender));
public double Speed public double Speed
{ {
@@ -95,7 +95,7 @@ public class RunningBlock : ContentControl
} }
public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register( public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register(
"IsRunning", typeof(bool), typeof(RunningBlock), new PropertyMetadata(ValueBoxes.TrueBox, (o, args) => nameof(IsRunning), typeof(bool), typeof(RunningBlock), new PropertyMetadata(ValueBoxes.TrueBox, (o, args) =>
{ {
var ctl = (RunningBlock) o; var ctl = (RunningBlock) o;
var v = (bool) args.NewValue; var v = (bool) args.NewValue;
@@ -116,7 +116,7 @@ public class RunningBlock : ContentControl
} }
public static readonly DependencyProperty AutoReverseProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoReverseProperty = DependencyProperty.Register(
"AutoReverse", typeof(bool), typeof(RunningBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(AutoReverse), typeof(bool), typeof(RunningBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
public bool AutoReverse public bool AutoReverse
{ {
@@ -11,7 +11,7 @@ namespace HandyControl.Controls;
public class ToggleBlock : Control public class ToggleBlock : Control
{ {
public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register(
"IsChecked", typeof(bool?), typeof(ToggleBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, nameof(IsChecked), typeof(bool?), typeof(ToggleBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal)); FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal));
[Category("Appearance")] [Category("Appearance")]
@@ -30,7 +30,7 @@ public class ToggleBlock : Control
} }
public static readonly DependencyProperty CheckedContentProperty = DependencyProperty.Register( public static readonly DependencyProperty CheckedContentProperty = DependencyProperty.Register(
"CheckedContent", typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object))); nameof(CheckedContent), typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object)));
public object CheckedContent public object CheckedContent
{ {
@@ -39,7 +39,7 @@ public class ToggleBlock : Control
} }
public static readonly DependencyProperty UnCheckedContentProperty = DependencyProperty.Register( public static readonly DependencyProperty UnCheckedContentProperty = DependencyProperty.Register(
"UnCheckedContent", typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object))); nameof(UnCheckedContent), typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object)));
public object UnCheckedContent public object UnCheckedContent
{ {
@@ -48,7 +48,7 @@ public class ToggleBlock : Control
} }
public static readonly DependencyProperty IndeterminateContentProperty = DependencyProperty.Register( public static readonly DependencyProperty IndeterminateContentProperty = DependencyProperty.Register(
"IndeterminateContent", typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object))); nameof(IndeterminateContent), typeof(object), typeof(ToggleBlock), new PropertyMetadata(default(object)));
public object IndeterminateContent public object IndeterminateContent
{ {
@@ -11,7 +11,7 @@ public class ButtonGroup : ItemsControl
protected override bool IsItemItsOwnContainerOverride(object item) => item is Button or RadioButton or ToggleButton; protected override bool IsItemItsOwnContainerOverride(object item) => item is Button or RadioButton or ToggleButton;
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(ButtonGroup), new PropertyMetadata(default(Orientation))); nameof(Orientation), typeof(Orientation), typeof(ButtonGroup), new PropertyMetadata(default(Orientation)));
public Orientation Orientation public Orientation Orientation
{ {
@@ -20,7 +20,7 @@ public class ButtonGroup : ItemsControl
} }
public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register( public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register(
"Layout", typeof(LinearLayout), typeof(ButtonGroup), new PropertyMetadata(LinearLayout.Uniform)); nameof(Layout), typeof(LinearLayout), typeof(ButtonGroup), new PropertyMetadata(LinearLayout.Uniform));
public LinearLayout Layout public LinearLayout Layout
{ {
@@ -7,7 +7,7 @@ namespace HandyControl.Controls;
public class ProgressButton : ToggleButton public class ProgressButton : ToggleButton
{ {
public static readonly DependencyProperty ProgressStyleProperty = DependencyProperty.Register( public static readonly DependencyProperty ProgressStyleProperty = DependencyProperty.Register(
"ProgressStyle", typeof(Style), typeof(ProgressButton), new PropertyMetadata(default(Style))); nameof(ProgressStyle), typeof(Style), typeof(ProgressButton), new PropertyMetadata(default(Style)));
public Style ProgressStyle public Style ProgressStyle
{ {
@@ -16,7 +16,7 @@ public class ProgressButton : ToggleButton
} }
public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register( public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register(
"Progress", typeof(double), typeof(ProgressButton), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(Progress), typeof(double), typeof(ProgressButton), new PropertyMetadata(ValueBoxes.Double0Box));
public double Progress public double Progress
{ {
@@ -10,7 +10,7 @@ namespace HandyControl.Controls;
public class SplitButton : ButtonBase public class SplitButton : ButtonBase
{ {
public static readonly DependencyProperty HitModeProperty = DependencyProperty.Register( public static readonly DependencyProperty HitModeProperty = DependencyProperty.Register(
"HitMode", typeof(HitMode), typeof(SplitButton), new PropertyMetadata(default(HitMode))); nameof(HitMode), typeof(HitMode), typeof(SplitButton), new PropertyMetadata(default(HitMode)));
public HitMode HitMode public HitMode HitMode
{ {
@@ -19,7 +19,7 @@ public class SplitButton : ButtonBase
} }
public static readonly DependencyProperty MaxDropDownHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty MaxDropDownHeightProperty = DependencyProperty.Register(
"MaxDropDownHeight", typeof(double), typeof(SplitButton), new PropertyMetadata(SystemParameters.PrimaryScreenHeight / 3.0)); nameof(MaxDropDownHeight), typeof(double), typeof(SplitButton), new PropertyMetadata(SystemParameters.PrimaryScreenHeight / 3.0));
public double MaxDropDownHeight public double MaxDropDownHeight
{ {
@@ -28,7 +28,7 @@ public class SplitButton : ButtonBase
} }
public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register( public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register(
"IsDropDownOpen", typeof(bool), typeof(SplitButton), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsDropDownOpen), typeof(bool), typeof(SplitButton), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsDropDownOpen public bool IsDropDownOpen
{ {
@@ -37,7 +37,7 @@ public class SplitButton : ButtonBase
} }
public static readonly DependencyProperty DropDownContentProperty = DependencyProperty.Register( public static readonly DependencyProperty DropDownContentProperty = DependencyProperty.Register(
"DropDownContent", typeof(object), typeof(SplitButton), new PropertyMetadata(default(object))); nameof(DropDownContent), typeof(object), typeof(SplitButton), new PropertyMetadata(default(object)));
public object DropDownContent public object DropDownContent
{ {
@@ -80,17 +80,17 @@ public class Carousel : SimpleItemsControl, IDisposable
private bool CheckNull() => _panelPage != null; private bool CheckNull() => _panelPage != null;
public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoRunProperty = DependencyProperty.Register(
"AutoRun", typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) => nameof(AutoRun), typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) =>
{ {
var ctl = (Carousel) o; var ctl = (Carousel) o;
ctl.TimerSwitch((bool) args.NewValue); ctl.TimerSwitch((bool) args.NewValue);
})); }));
public static readonly DependencyProperty IntervalProperty = DependencyProperty.Register( public static readonly DependencyProperty IntervalProperty = DependencyProperty.Register(
"Interval", typeof(TimeSpan), typeof(Carousel), new PropertyMetadata(TimeSpan.FromSeconds(2))); nameof(Interval), typeof(TimeSpan), typeof(Carousel), new PropertyMetadata(TimeSpan.FromSeconds(2)));
public static readonly DependencyProperty ExtendWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty ExtendWidthProperty = DependencyProperty.Register(
"ExtendWidth", typeof(double), typeof(Carousel), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(ExtendWidth), typeof(double), typeof(Carousel), new PropertyMetadata(ValueBoxes.Double0Box));
public double ExtendWidth public double ExtendWidth
{ {
@@ -99,7 +99,7 @@ public class Carousel : SimpleItemsControl, IDisposable
} }
public static readonly DependencyProperty IsCenterProperty = DependencyProperty.Register( public static readonly DependencyProperty IsCenterProperty = DependencyProperty.Register(
"IsCenter", typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsCenter), typeof(bool), typeof(Carousel), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsCenter public bool IsCenter
{ {
@@ -108,7 +108,7 @@ public class Carousel : SimpleItemsControl, IDisposable
} }
public static readonly DependencyProperty PageButtonStyleProperty = DependencyProperty.Register( public static readonly DependencyProperty PageButtonStyleProperty = DependencyProperty.Register(
"PageButtonStyle", typeof(Style), typeof(Carousel), new PropertyMetadata(default(Style))); nameof(PageButtonStyle), typeof(Style), typeof(Carousel), new PropertyMetadata(default(Style)));
public Style PageButtonStyle public Style PageButtonStyle
{ {
@@ -225,7 +225,7 @@ public class ColorPicker : Control, ISingleOpen
#region Properties #region Properties
internal static readonly DependencyProperty ChannelAProperty = DependencyProperty.Register( internal static readonly DependencyProperty ChannelAProperty = DependencyProperty.Register(
"ChannelA", typeof(int), typeof(ColorPicker), new PropertyMetadata(255)); nameof(ChannelA), typeof(int), typeof(ColorPicker), new PropertyMetadata(255));
internal int ChannelA internal int ChannelA
{ {
@@ -234,7 +234,7 @@ public class ColorPicker : Control, ISingleOpen
} }
internal static readonly DependencyProperty ChannelRProperty = DependencyProperty.Register( internal static readonly DependencyProperty ChannelRProperty = DependencyProperty.Register(
"ChannelR", typeof(int), typeof(ColorPicker), new PropertyMetadata(255)); nameof(ChannelR), typeof(int), typeof(ColorPicker), new PropertyMetadata(255));
internal int ChannelR internal int ChannelR
{ {
@@ -243,7 +243,7 @@ public class ColorPicker : Control, ISingleOpen
} }
internal static readonly DependencyProperty ChannelGProperty = DependencyProperty.Register( internal static readonly DependencyProperty ChannelGProperty = DependencyProperty.Register(
"ChannelG", typeof(int), typeof(ColorPicker), new PropertyMetadata(255)); nameof(ChannelG), typeof(int), typeof(ColorPicker), new PropertyMetadata(255));
internal int ChannelG internal int ChannelG
{ {
@@ -252,7 +252,7 @@ public class ColorPicker : Control, ISingleOpen
} }
internal static readonly DependencyProperty ChannelBProperty = DependencyProperty.Register( internal static readonly DependencyProperty ChannelBProperty = DependencyProperty.Register(
"ChannelB", typeof(int), typeof(ColorPicker), new PropertyMetadata(255)); nameof(ChannelB), typeof(int), typeof(ColorPicker), new PropertyMetadata(255));
internal int ChannelB internal int ChannelB
{ {
@@ -261,7 +261,7 @@ public class ColorPicker : Control, ISingleOpen
} }
public static readonly DependencyProperty SelectedBrushProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectedBrushProperty = DependencyProperty.Register(
"SelectedBrush", typeof(SolidColorBrush), typeof(ColorPicker), new PropertyMetadata(Brushes.White, OnSelectedBrushChanged, CoerceSelectedBrush)); nameof(SelectedBrush), typeof(SolidColorBrush), typeof(ColorPicker), new PropertyMetadata(Brushes.White, OnSelectedBrushChanged, CoerceSelectedBrush));
private static object CoerceSelectedBrush(DependencyObject d, object basevalue) private static object CoerceSelectedBrush(DependencyObject d, object basevalue)
{ {
@@ -300,7 +300,7 @@ public class ColorPicker : Control, ISingleOpen
} }
internal static readonly DependencyProperty SelectedBrushWithoutOpacityProperty = DependencyProperty.Register( internal static readonly DependencyProperty SelectedBrushWithoutOpacityProperty = DependencyProperty.Register(
"SelectedBrushWithoutOpacity", typeof(SolidColorBrush), typeof(ColorPicker), new PropertyMetadata(Brushes.White)); nameof(SelectedBrushWithoutOpacity), typeof(SolidColorBrush), typeof(ColorPicker), new PropertyMetadata(Brushes.White));
internal SolidColorBrush SelectedBrushWithoutOpacity internal SolidColorBrush SelectedBrushWithoutOpacity
{ {
@@ -309,7 +309,7 @@ public class ColorPicker : Control, ISingleOpen
} }
internal static readonly DependencyProperty BackColorProperty = DependencyProperty.Register( internal static readonly DependencyProperty BackColorProperty = DependencyProperty.Register(
"BackColor", typeof(SolidColorBrush), typeof(ColorPicker), new PropertyMetadata(Brushes.Red)); nameof(BackColor), typeof(SolidColorBrush), typeof(ColorPicker), new PropertyMetadata(Brushes.Red));
internal SolidColorBrush BackColor internal SolidColorBrush BackColor
{ {
@@ -318,7 +318,7 @@ public class ColorPicker : Control, ISingleOpen
} }
internal static readonly DependencyProperty ShowListProperty = DependencyProperty.Register( internal static readonly DependencyProperty ShowListProperty = DependencyProperty.Register(
"ShowList", typeof(List<bool>), typeof(ColorPicker), new PropertyMetadata(new List<bool> nameof(ShowList), typeof(List<bool>), typeof(ColorPicker), new PropertyMetadata(new List<bool>
{ {
true, false, false true, false, false
})); }));
@@ -35,7 +35,7 @@ public class CoverFlow : Control
/// 页码 /// 页码
/// </summary> /// </summary>
public static readonly DependencyProperty PageIndexProperty = DependencyProperty.Register( public static readonly DependencyProperty PageIndexProperty = DependencyProperty.Register(
"PageIndex", typeof(int), typeof(CoverFlow), nameof(PageIndex), typeof(int), typeof(CoverFlow),
new PropertyMetadata(ValueBoxes.Int0Box, OnPageIndexChanged, CoercePageIndex)); new PropertyMetadata(ValueBoxes.Int0Box, OnPageIndexChanged, CoercePageIndex));
private static object CoercePageIndex(DependencyObject d, object baseValue) private static object CoercePageIndex(DependencyObject d, object baseValue)
@@ -64,7 +64,7 @@ public class CoverFlow : Control
/// 是否循环 /// 是否循环
/// </summary> /// </summary>
public static readonly DependencyProperty LoopProperty = DependencyProperty.Register( public static readonly DependencyProperty LoopProperty = DependencyProperty.Register(
"Loop", typeof(bool), typeof(CoverFlow), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(Loop), typeof(bool), typeof(CoverFlow), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 存储所有的内容 /// 存储所有的内容
@@ -97,7 +97,7 @@ public class CoverView : RegularItemsControl
protected override bool IsItemItsOwnContainerOverride(object item) => item is CoverViewItem; protected override bool IsItemItsOwnContainerOverride(object item) => item is CoverViewItem;
public static readonly DependencyProperty CoverViewContentStyleProperty = DependencyProperty.Register( public static readonly DependencyProperty CoverViewContentStyleProperty = DependencyProperty.Register(
"CoverViewContentStyle", typeof(Style), typeof(CoverView), new PropertyMetadata(default(Style))); nameof(CoverViewContentStyle), typeof(Style), typeof(CoverView), new PropertyMetadata(default(Style)));
public Style CoverViewContentStyle public Style CoverViewContentStyle
{ {
@@ -106,7 +106,7 @@ public class CoverView : RegularItemsControl
} }
internal static readonly DependencyProperty GroupsProperty = DependencyProperty.Register( internal static readonly DependencyProperty GroupsProperty = DependencyProperty.Register(
"Groups", typeof(int), typeof(CoverView), nameof(Groups), typeof(int), typeof(CoverView),
new FrameworkPropertyMetadata(ValueBoxes.Int5Box, FrameworkPropertyMetadataOptions.AffectsMeasure, new FrameworkPropertyMetadata(ValueBoxes.Int5Box, FrameworkPropertyMetadataOptions.AffectsMeasure,
OnGroupsChanged, CoerceGroups)); OnGroupsChanged, CoerceGroups));
@@ -130,7 +130,7 @@ public class CoverView : RegularItemsControl
} }
public static readonly DependencyProperty ItemContentHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemContentHeightProperty = DependencyProperty.Register(
"ItemContentHeight", typeof(double), typeof(CoverView), new PropertyMetadata(ValueBoxes.Double300Box), nameof(ItemContentHeight), typeof(double), typeof(CoverView), new PropertyMetadata(ValueBoxes.Double300Box),
ValidateHelper.IsInRangeOfPosDoubleIncludeZero); ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double ItemContentHeight public double ItemContentHeight
@@ -140,7 +140,7 @@ public class CoverView : RegularItemsControl
} }
public static readonly DependencyProperty ItemContentHeightFixedProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemContentHeightFixedProperty = DependencyProperty.Register(
"ItemContentHeightFixed", typeof(bool), typeof(CoverView), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ItemContentHeightFixed), typeof(bool), typeof(CoverView), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ItemContentHeightFixed public bool ItemContentHeightFixed
{ {
@@ -149,7 +149,7 @@ public class CoverView : RegularItemsControl
} }
public static readonly DependencyProperty ItemHeaderTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemHeaderTemplateProperty = DependencyProperty.Register(
"ItemHeaderTemplate", typeof(DataTemplate), typeof(CoverView), new PropertyMetadata(default(DataTemplate))); nameof(ItemHeaderTemplate), typeof(DataTemplate), typeof(CoverView), new PropertyMetadata(default(DataTemplate)));
public DataTemplate ItemHeaderTemplate public DataTemplate ItemHeaderTemplate
{ {
@@ -43,7 +43,7 @@ public class CoverViewContent : ContentControl
} }
internal static readonly DependencyProperty ManualHeightProperty = DependencyProperty.Register( internal static readonly DependencyProperty ManualHeightProperty = DependencyProperty.Register(
"ManualHeight", typeof(double), typeof(CoverViewContent), new PropertyMetadata(ValueBoxes.Double0Box), ValidateHelper.IsInRangeOfPosDoubleIncludeZero); nameof(ManualHeight), typeof(double), typeof(CoverViewContent), new PropertyMetadata(ValueBoxes.Double0Box), ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
internal double ManualHeight internal double ManualHeight
{ {
@@ -52,7 +52,7 @@ public class CoverViewContent : ContentControl
} }
public static readonly DependencyProperty ContentHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentHeightProperty = DependencyProperty.Register(
"ContentHeight", typeof(double), typeof(CoverViewContent), new PropertyMetadata(ValueBoxes.Double300Box), nameof(ContentHeight), typeof(double), typeof(CoverViewContent), new PropertyMetadata(ValueBoxes.Double300Box),
ValidateHelper.IsInRangeOfPosDoubleIncludeZero); ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double ContentHeight public double ContentHeight
@@ -19,7 +19,7 @@ public class Dialog : ContentControl
private static readonly Dictionary<string, FrameworkElement> ContainerDic = new(); private static readonly Dictionary<string, FrameworkElement> ContainerDic = new();
public static readonly DependencyProperty IsClosedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsClosedProperty = DependencyProperty.Register(
"IsClosed", typeof(bool), typeof(Dialog), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsClosed), typeof(bool), typeof(Dialog), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsClosed public bool IsClosed
{ {
@@ -98,7 +98,7 @@ public class Drawer : FrameworkElement
} }
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register(
"IsOpen", typeof(bool), typeof(Drawer), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsOpenChanged)); nameof(IsOpen), typeof(bool), typeof(Drawer), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsOpenChanged));
private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -113,7 +113,7 @@ public class Drawer : FrameworkElement
} }
public static readonly DependencyProperty MaskCanCloseProperty = DependencyProperty.Register( public static readonly DependencyProperty MaskCanCloseProperty = DependencyProperty.Register(
"MaskCanClose", typeof(bool), typeof(Drawer), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(MaskCanClose), typeof(bool), typeof(Drawer), new PropertyMetadata(ValueBoxes.TrueBox));
public bool MaskCanClose public bool MaskCanClose
{ {
@@ -122,7 +122,7 @@ public class Drawer : FrameworkElement
} }
public static readonly DependencyProperty ShowMaskProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowMaskProperty = DependencyProperty.Register(
"ShowMask", typeof(bool), typeof(Drawer), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowMask), typeof(bool), typeof(Drawer), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowMask public bool ShowMask
{ {
@@ -131,7 +131,7 @@ public class Drawer : FrameworkElement
} }
public static readonly DependencyProperty DockProperty = DependencyProperty.Register( public static readonly DependencyProperty DockProperty = DependencyProperty.Register(
"Dock", typeof(Dock), typeof(Drawer), new PropertyMetadata(default(Dock))); nameof(Dock), typeof(Dock), typeof(Drawer), new PropertyMetadata(default(Dock)));
public Dock Dock public Dock Dock
{ {
@@ -140,7 +140,7 @@ public class Drawer : FrameworkElement
} }
public static readonly DependencyProperty ShowModeProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowModeProperty = DependencyProperty.Register(
"ShowMode", typeof(DrawerShowMode), typeof(Drawer), new PropertyMetadata(default(DrawerShowMode))); nameof(ShowMode), typeof(DrawerShowMode), typeof(Drawer), new PropertyMetadata(default(DrawerShowMode)));
public DrawerShowMode ShowMode public DrawerShowMode ShowMode
{ {
@@ -149,7 +149,7 @@ public class Drawer : FrameworkElement
} }
public static readonly DependencyProperty MaskBrushProperty = DependencyProperty.Register( public static readonly DependencyProperty MaskBrushProperty = DependencyProperty.Register(
"MaskBrush", typeof(Brush), typeof(Drawer), new PropertyMetadata(default(Brush))); nameof(MaskBrush), typeof(Brush), typeof(Drawer), new PropertyMetadata(default(Brush)));
public Brush MaskBrush public Brush MaskBrush
{ {
@@ -158,7 +158,7 @@ public class Drawer : FrameworkElement
} }
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
"Content", typeof(object), typeof(Drawer), new PropertyMetadata(default(object))); nameof(Content), typeof(object), typeof(Drawer), new PropertyMetadata(default(object)));
public object Content public object Content
{ {
@@ -40,23 +40,23 @@ public class Growl : Control
"ShowMode", typeof(GrowlShowMode), typeof(Growl), "ShowMode", typeof(GrowlShowMode), typeof(Growl),
new FrameworkPropertyMetadata(default(GrowlShowMode), FrameworkPropertyMetadataOptions.Inherits)); new FrameworkPropertyMetadata(default(GrowlShowMode), FrameworkPropertyMetadataOptions.Inherits));
public static readonly DependencyProperty ShowDateTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowDateTimeProperty = DependencyProperty.Register(
"ShowDateTime", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowDateTime), typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.TrueBox));
public static readonly DependencyProperty MessageProperty = DependencyProperty.Register( public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(
"Message", typeof(string), typeof(Growl), new PropertyMetadata(default(string))); nameof(Message), typeof(string), typeof(Growl), new PropertyMetadata(default(string)));
public static readonly DependencyProperty TimeProperty = DependencyProperty.Register( public static readonly DependencyProperty TimeProperty = DependencyProperty.Register(
"Time", typeof(DateTime), typeof(Growl), new PropertyMetadata(default(DateTime))); nameof(Time), typeof(DateTime), typeof(Growl), new PropertyMetadata(default(DateTime)));
public static readonly DependencyProperty IconProperty = DependencyProperty.Register( public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
"Icon", typeof(Geometry), typeof(Growl), new PropertyMetadata(default(Geometry))); nameof(Icon), typeof(Geometry), typeof(Growl), new PropertyMetadata(default(Geometry)));
public static readonly DependencyProperty IconBrushProperty = DependencyProperty.Register( public static readonly DependencyProperty IconBrushProperty = DependencyProperty.Register(
"IconBrush", typeof(Brush), typeof(Growl), new PropertyMetadata(default(Brush))); nameof(IconBrush), typeof(Brush), typeof(Growl), new PropertyMetadata(default(Brush)));
public static readonly DependencyProperty TypeProperty = DependencyProperty.Register( public static readonly DependencyProperty TypeProperty = DependencyProperty.Register(
"Type", typeof(InfoType), typeof(Growl), new PropertyMetadata(default(InfoType))); nameof(Type), typeof(InfoType), typeof(Growl), new PropertyMetadata(default(InfoType)));
public static readonly DependencyProperty TokenProperty = DependencyProperty.RegisterAttached( public static readonly DependencyProperty TokenProperty = DependencyProperty.RegisterAttached(
"Token", typeof(string), typeof(Growl), new PropertyMetadata(default(string), OnTokenChanged)); "Token", typeof(string), typeof(Growl), new PropertyMetadata(default(string), OnTokenChanged));
internal static readonly DependencyProperty CancelStrProperty = DependencyProperty.Register( internal static readonly DependencyProperty CancelStrProperty = DependencyProperty.Register(
"CancelStr", typeof(string), typeof(Growl), new PropertyMetadata(default(string))); nameof(CancelStr), typeof(string), typeof(Growl), new PropertyMetadata(default(string)));
internal static readonly DependencyProperty ConfirmStrProperty = DependencyProperty.Register( internal static readonly DependencyProperty ConfirmStrProperty = DependencyProperty.Register(
"ConfirmStr", typeof(string), typeof(Growl), new PropertyMetadata(default(string))); nameof(ConfirmStr), typeof(string), typeof(Growl), new PropertyMetadata(default(string)));
private static readonly DependencyProperty IsCreatedAutomaticallyProperty = DependencyProperty.RegisterAttached( private static readonly DependencyProperty IsCreatedAutomaticallyProperty = DependencyProperty.RegisterAttached(
"IsCreatedAutomatically", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.FalseBox)); "IsCreatedAutomatically", typeof(bool), typeof(Growl), new PropertyMetadata(ValueBoxes.FalseBox));
private static GrowlWindow GrowlWindow; private static GrowlWindow GrowlWindow;
@@ -37,7 +37,7 @@ public class GifImage : Image, IDisposable
} }
public static readonly DependencyProperty UriProperty = DependencyProperty.Register( public static readonly DependencyProperty UriProperty = DependencyProperty.Register(
"Uri", typeof(Uri), typeof(GifImage), new PropertyMetadata(default(Uri), OnUriChanged)); nameof(Uri), typeof(Uri), typeof(GifImage), new PropertyMetadata(default(Uri), OnUriChanged));
private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -93,7 +93,7 @@ public class ImageBlock : FrameworkElement
private void DispatcherTimer_Tick(object sender, EventArgs e) => InvalidateVisual(); private void DispatcherTimer_Tick(object sender, EventArgs e) => InvalidateVisual();
public static readonly DependencyProperty StartColumnProperty = DependencyProperty.Register( public static readonly DependencyProperty StartColumnProperty = DependencyProperty.Register(
"StartColumn", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box, nameof(StartColumn), typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged)); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
public int StartColumn public int StartColumn
@@ -103,7 +103,7 @@ public class ImageBlock : FrameworkElement
} }
public static readonly DependencyProperty StartRowProperty = DependencyProperty.Register( public static readonly DependencyProperty StartRowProperty = DependencyProperty.Register(
"StartRow", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box, nameof(StartRow), typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged)); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
public int StartRow public int StartRow
@@ -113,7 +113,7 @@ public class ImageBlock : FrameworkElement
} }
public static readonly DependencyProperty EndColumnProperty = DependencyProperty.Register( public static readonly DependencyProperty EndColumnProperty = DependencyProperty.Register(
"EndColumn", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box, nameof(EndColumn), typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged)); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
public int EndColumn public int EndColumn
@@ -123,7 +123,7 @@ public class ImageBlock : FrameworkElement
} }
public static readonly DependencyProperty EndRowProperty = DependencyProperty.Register( public static readonly DependencyProperty EndRowProperty = DependencyProperty.Register(
"EndRow", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box, nameof(EndRow), typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged)); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
public int EndRow public int EndRow
@@ -133,7 +133,7 @@ public class ImageBlock : FrameworkElement
} }
public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register( public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register(
"IsPlaying", typeof(bool), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, nameof(IsPlaying), typeof(bool), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnIsPlayingChanged)); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnIsPlayingChanged));
private static void OnIsPlayingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIsPlayingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -156,7 +156,7 @@ public class ImageBlock : FrameworkElement
} }
public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register( public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register(
"Columns", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box, nameof(Columns), typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int) obj >= 1); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int) obj >= 1);
public int Columns public int Columns
@@ -166,7 +166,7 @@ public class ImageBlock : FrameworkElement
} }
public static readonly DependencyProperty RowsProperty = DependencyProperty.Register( public static readonly DependencyProperty RowsProperty = DependencyProperty.Register(
"Rows", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box, nameof(Rows), typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int1Box,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int) obj >= 1); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged), obj => (int) obj >= 1);
public int Rows public int Rows
@@ -176,7 +176,7 @@ public class ImageBlock : FrameworkElement
} }
public static readonly DependencyProperty IntervalProperty = DependencyProperty.Register( public static readonly DependencyProperty IntervalProperty = DependencyProperty.Register(
"Interval", typeof(TimeSpan), typeof(ImageBlock), new PropertyMetadata(TimeSpan.FromSeconds(1), OnIntervalChanged)); nameof(Interval), typeof(TimeSpan), typeof(ImageBlock), new PropertyMetadata(TimeSpan.FromSeconds(1), OnIntervalChanged));
private static void OnIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -191,7 +191,7 @@ public class ImageBlock : FrameworkElement
} }
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(ImageSource), typeof(ImageBlock), new FrameworkPropertyMetadata(default(ImageSource), nameof(Source), typeof(ImageSource), typeof(ImageBlock), new FrameworkPropertyMetadata(default(ImageSource),
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnSourceChanged)); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnSourceChanged));
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -218,10 +218,10 @@ public class ImageViewer : Control
#region Properties #region Properties
public static readonly DependencyProperty ShowImgMapProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowImgMapProperty = DependencyProperty.Register(
"ShowImgMap", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowImgMap), typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register( public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register(
"ImageSource", typeof(BitmapFrame), typeof(ImageViewer), new PropertyMetadata(default(BitmapFrame), OnImageSourceChanged)); nameof(ImageSource), typeof(BitmapFrame), typeof(ImageViewer), new PropertyMetadata(default(BitmapFrame), OnImageSourceChanged));
private static void OnImageSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnImageSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -230,52 +230,52 @@ public class ImageViewer : Control
} }
public static readonly DependencyProperty ShowToolBarProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowToolBarProperty = DependencyProperty.Register(
"ShowToolBar", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowToolBar), typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.TrueBox));
public static readonly DependencyProperty IsFullScreenProperty = DependencyProperty.Register( public static readonly DependencyProperty IsFullScreenProperty = DependencyProperty.Register(
"IsFullScreen", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsFullScreen), typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
internal static readonly DependencyProperty ImgPathProperty = DependencyProperty.Register( internal static readonly DependencyProperty ImgPathProperty = DependencyProperty.Register(
"ImgPath", typeof(string), typeof(ImageViewer), new PropertyMetadata(default(string))); nameof(ImgPath), typeof(string), typeof(ImageViewer), new PropertyMetadata(default(string)));
internal static readonly DependencyProperty ImgSizeProperty = DependencyProperty.Register( internal static readonly DependencyProperty ImgSizeProperty = DependencyProperty.Register(
"ImgSize", typeof(long), typeof(ImageViewer), new PropertyMetadata(-1L)); nameof(ImgSize), typeof(long), typeof(ImageViewer), new PropertyMetadata(-1L));
/// <summary> /// <summary>
/// 是否显示全屏按钮 /// 是否显示全屏按钮
/// </summary> /// </summary>
internal static readonly DependencyProperty ShowFullScreenButtonProperty = DependencyProperty.Register( internal static readonly DependencyProperty ShowFullScreenButtonProperty = DependencyProperty.Register(
"ShowFullScreenButton", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowFullScreenButton), typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 关闭按钮是否显示中 /// 关闭按钮是否显示中
/// </summary> /// </summary>
internal static readonly DependencyProperty ShowCloseButtonProperty = DependencyProperty.Register( internal static readonly DependencyProperty ShowCloseButtonProperty = DependencyProperty.Register(
"ShowCloseButton", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowCloseButton), typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
internal static readonly DependencyProperty ImageContentProperty = DependencyProperty.Register( internal static readonly DependencyProperty ImageContentProperty = DependencyProperty.Register(
"ImageContent", typeof(object), typeof(ImageViewer), new PropertyMetadata(default(object))); nameof(ImageContent), typeof(object), typeof(ImageViewer), new PropertyMetadata(default(object)));
internal static readonly DependencyProperty ImageMarginProperty = DependencyProperty.Register( internal static readonly DependencyProperty ImageMarginProperty = DependencyProperty.Register(
"ImageMargin", typeof(Thickness), typeof(ImageViewer), new PropertyMetadata(default(Thickness))); nameof(ImageMargin), typeof(Thickness), typeof(ImageViewer), new PropertyMetadata(default(Thickness)));
internal static readonly DependencyProperty ImageWidthProperty = DependencyProperty.Register( internal static readonly DependencyProperty ImageWidthProperty = DependencyProperty.Register(
"ImageWidth", typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(ImageWidth), typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box));
internal static readonly DependencyProperty ImageHeightProperty = DependencyProperty.Register( internal static readonly DependencyProperty ImageHeightProperty = DependencyProperty.Register(
"ImageHeight", typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(ImageHeight), typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box));
internal static readonly DependencyProperty ImageScaleProperty = DependencyProperty.Register( internal static readonly DependencyProperty ImageScaleProperty = DependencyProperty.Register(
"ImageScale", typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double1Box, OnImageScaleChanged)); nameof(ImageScale), typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double1Box, OnImageScaleChanged));
internal static readonly DependencyProperty ScaleStrProperty = DependencyProperty.Register( internal static readonly DependencyProperty ScaleStrProperty = DependencyProperty.Register(
"ScaleStr", typeof(string), typeof(ImageViewer), new PropertyMetadata("100%")); nameof(ScaleStr), typeof(string), typeof(ImageViewer), new PropertyMetadata("100%"));
internal static readonly DependencyProperty ImageRotateProperty = DependencyProperty.Register( internal static readonly DependencyProperty ImageRotateProperty = DependencyProperty.Register(
"ImageRotate", typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(ImageRotate), typeof(double), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.Double0Box));
internal static readonly DependencyProperty ShowSmallImgInternalProperty = DependencyProperty.Register( internal static readonly DependencyProperty ShowSmallImgInternalProperty = DependencyProperty.Register(
"ShowSmallImgInternal", typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowSmallImgInternal), typeof(bool), typeof(ImageViewer), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsFullScreen public bool IsFullScreen
{ {
@@ -25,7 +25,7 @@ public class CheckComboBox : ListBox, IDataInput
private bool _isInternalAction; private bool _isInternalAction;
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register( public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
"IsError", typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsError), typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsError public bool IsError
{ {
@@ -34,7 +34,7 @@ public class CheckComboBox : ListBox, IDataInput
} }
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
"ErrorStr", typeof(string), typeof(CheckComboBox), new PropertyMetadata(default(string))); nameof(ErrorStr), typeof(string), typeof(CheckComboBox), new PropertyMetadata(default(string)));
public string ErrorStr public string ErrorStr
{ {
@@ -43,7 +43,7 @@ public class CheckComboBox : ListBox, IDataInput
} }
public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register( public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register(
"TextType", typeof(TextType), typeof(CheckComboBox), new PropertyMetadata(default(TextType))); nameof(TextType), typeof(TextType), typeof(CheckComboBox), new PropertyMetadata(default(TextType)));
public TextType TextType public TextType TextType
{ {
@@ -52,7 +52,7 @@ public class CheckComboBox : ListBox, IDataInput
} }
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
"ShowClearButton", typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowClearButton), typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowClearButton public bool ShowClearButton
{ {
@@ -73,7 +73,7 @@ public class CheckComboBox : ListBox, IDataInput
} }
public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register( public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register(
"IsDropDownOpen", typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox, OnIsDropDownOpenChanged)); nameof(IsDropDownOpen), typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox, OnIsDropDownOpenChanged));
private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -95,7 +95,7 @@ public class CheckComboBox : ListBox, IDataInput
} }
public static readonly DependencyProperty TagStyleProperty = DependencyProperty.Register( public static readonly DependencyProperty TagStyleProperty = DependencyProperty.Register(
"TagStyle", typeof(Style), typeof(CheckComboBox), new PropertyMetadata(default(Style))); nameof(TagStyle), typeof(Style), typeof(CheckComboBox), new PropertyMetadata(default(Style)));
public Style TagStyle public Style TagStyle
{ {
@@ -104,7 +104,7 @@ public class CheckComboBox : ListBox, IDataInput
} }
public static readonly DependencyProperty ShowSelectAllButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowSelectAllButtonProperty = DependencyProperty.Register(
"ShowSelectAllButton", typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowSelectAllButton), typeof(bool), typeof(CheckComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowSelectAllButton public bool ShowSelectAllButton
{ {
@@ -169,7 +169,7 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
/// 数据是否错误 /// 数据是否错误
/// </summary> /// </summary>
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register( public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
"IsError", typeof(bool), typeof(ComboBox), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsError), typeof(bool), typeof(ComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 数据是否错误 /// 数据是否错误
@@ -184,7 +184,7 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
/// 错误提示 /// 错误提示
/// </summary> /// </summary>
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
"ErrorStr", typeof(string), typeof(ComboBox), new PropertyMetadata(default(string))); nameof(ErrorStr), typeof(string), typeof(ComboBox), new PropertyMetadata(default(string)));
/// <summary> /// <summary>
/// 错误提示 /// 错误提示
@@ -220,7 +220,7 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
/// 是否显示清除按钮 /// 是否显示清除按钮
/// </summary> /// </summary>
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
"ShowClearButton", typeof(bool), typeof(ComboBox), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowClearButton), typeof(bool), typeof(ComboBox), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 是否显示清除按钮 /// 是否显示清除按钮
@@ -235,7 +235,7 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
/// 是否自动完成输入 /// 是否自动完成输入
/// </summary> /// </summary>
public static readonly DependencyProperty AutoCompleteProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoCompleteProperty = DependencyProperty.Register(
"AutoComplete", typeof(bool), typeof(ComboBox), new PropertyMetadata(ValueBoxes.FalseBox, OnAutoCompleteChanged)); nameof(AutoComplete), typeof(bool), typeof(ComboBox), new PropertyMetadata(ValueBoxes.FalseBox, OnAutoCompleteChanged));
private static void OnAutoCompleteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnAutoCompleteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -259,7 +259,7 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
/// 搜索文本 /// 搜索文本
/// </summary> /// </summary>
internal static readonly DependencyProperty SearchTextProperty = DependencyProperty.Register( internal static readonly DependencyProperty SearchTextProperty = DependencyProperty.Register(
"SearchText", typeof(string), typeof(ComboBox), new PropertyMetadata(default(string), OnSearchTextChanged)); nameof(SearchText), typeof(string), typeof(ComboBox), new PropertyMetadata(default(string), OnSearchTextChanged));
private static void OnSearchTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnSearchTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -54,7 +54,7 @@ public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
public Func<string, OperationResult<bool>> VerifyFunc { get; set; } public Func<string, OperationResult<bool>> VerifyFunc { get; set; }
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register( public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
"IsError", typeof(bool), typeof(DatePicker), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsError), typeof(bool), typeof(DatePicker), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsError public bool IsError
{ {
@@ -63,7 +63,7 @@ public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
} }
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
"ErrorStr", typeof(string), typeof(DatePicker), new PropertyMetadata(default(string))); nameof(ErrorStr), typeof(string), typeof(DatePicker), new PropertyMetadata(default(string)));
public string ErrorStr public string ErrorStr
{ {
@@ -72,7 +72,7 @@ public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
} }
public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register( public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register(
"TextType", typeof(TextType), typeof(DatePicker), new PropertyMetadata(default(TextType))); nameof(TextType), typeof(TextType), typeof(DatePicker), new PropertyMetadata(default(TextType)));
public TextType TextType public TextType TextType
{ {
@@ -81,7 +81,7 @@ public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
} }
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
"ShowClearButton", typeof(bool), typeof(DatePicker), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowClearButton), typeof(bool), typeof(DatePicker), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowClearButton public bool ShowClearButton
{ {
@@ -93,7 +93,7 @@ public class DateTimePicker : Control, IDataInput
#region Public Properties #region Public Properties
public static readonly DependencyProperty DateTimeFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty DateTimeFormatProperty = DependencyProperty.Register(
"DateTimeFormat", typeof(string), typeof(DateTimePicker), new PropertyMetadata("yyyy-MM-dd HH:mm:ss")); nameof(DateTimeFormat), typeof(string), typeof(DateTimePicker), new PropertyMetadata("yyyy-MM-dd HH:mm:ss"));
public string DateTimeFormat public string DateTimeFormat
{ {
@@ -102,7 +102,7 @@ public class DateTimePicker : Control, IDataInput
} }
public static readonly DependencyProperty CalendarStyleProperty = DependencyProperty.Register( public static readonly DependencyProperty CalendarStyleProperty = DependencyProperty.Register(
"CalendarStyle", typeof(Style), typeof(DateTimePicker), new PropertyMetadata(default(Style))); nameof(CalendarStyle), typeof(Style), typeof(DateTimePicker), new PropertyMetadata(default(Style)));
public Style CalendarStyle public Style CalendarStyle
{ {
@@ -111,7 +111,7 @@ public class DateTimePicker : Control, IDataInput
} }
public static readonly DependencyProperty DisplayDateTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty DisplayDateTimeProperty = DependencyProperty.Register(
"DisplayDateTime", typeof(DateTime), typeof(DateTimePicker), new FrameworkPropertyMetadata(DateTime.Now, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, CoerceDisplayDateTime)); nameof(DisplayDateTime), typeof(DateTime), typeof(DateTimePicker), new FrameworkPropertyMetadata(DateTime.Now, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, CoerceDisplayDateTime));
private static object CoerceDisplayDateTime(DependencyObject d, object value) private static object CoerceDisplayDateTime(DependencyObject d, object value)
{ {
@@ -128,7 +128,7 @@ public class DateTimePicker : Control, IDataInput
} }
public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register( public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register(
"IsDropDownOpen", typeof(bool), typeof(DateTimePicker), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsDropDownOpenChanged, OnCoerceIsDropDownOpen)); nameof(IsDropDownOpen), typeof(bool), typeof(DateTimePicker), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsDropDownOpenChanged, OnCoerceIsDropDownOpen));
private static object OnCoerceIsDropDownOpen(DependencyObject d, object baseValue) => private static object OnCoerceIsDropDownOpen(DependencyObject d, object baseValue) =>
d is DateTimePicker d is DateTimePicker
@@ -165,7 +165,7 @@ public class DateTimePicker : Control, IDataInput
} }
public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register(
"SelectedDateTime", typeof(DateTime?), typeof(DateTimePicker), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedDateTimeChanged, CoerceSelectedDateTime)); nameof(SelectedDateTime), typeof(DateTime?), typeof(DateTimePicker), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedDateTimeChanged, CoerceSelectedDateTime));
private static object CoerceSelectedDateTime(DependencyObject d, object value) private static object CoerceSelectedDateTime(DependencyObject d, object value)
{ {
@@ -197,7 +197,7 @@ public class DateTimePicker : Control, IDataInput
} }
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(DateTimePicker), new FrameworkPropertyMetadata(string.Empty, OnTextChanged)); nameof(Text), typeof(string), typeof(DateTimePicker), new FrameworkPropertyMetadata(string.Empty, OnTextChanged));
private static void OnTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -241,7 +241,7 @@ public class DateTimePicker : Control, IDataInput
public Func<string, OperationResult<bool>> VerifyFunc { get; set; } public Func<string, OperationResult<bool>> VerifyFunc { get; set; }
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register( public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
"IsError", typeof(bool), typeof(DateTimePicker), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsError), typeof(bool), typeof(DateTimePicker), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsError public bool IsError
{ {
@@ -250,7 +250,7 @@ public class DateTimePicker : Control, IDataInput
} }
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
"ErrorStr", typeof(string), typeof(DateTimePicker), new PropertyMetadata(default(string))); nameof(ErrorStr), typeof(string), typeof(DateTimePicker), new PropertyMetadata(default(string)));
public string ErrorStr public string ErrorStr
{ {
@@ -259,7 +259,7 @@ public class DateTimePicker : Control, IDataInput
} }
public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register( public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register(
"TextType", typeof(TextType), typeof(DateTimePicker), new PropertyMetadata(default(TextType))); nameof(TextType), typeof(TextType), typeof(DateTimePicker), new PropertyMetadata(default(TextType)));
public TextType TextType public TextType TextType
{ {
@@ -268,7 +268,7 @@ public class DateTimePicker : Control, IDataInput
} }
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
"ShowClearButton", typeof(bool), typeof(DateTimePicker), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowClearButton), typeof(bool), typeof(DateTimePicker), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowClearButton public bool ShowClearButton
{ {
@@ -68,7 +68,7 @@ public class ImageSelector : Control
} }
public static readonly DependencyProperty StretchProperty = DependencyProperty.Register( public static readonly DependencyProperty StretchProperty = DependencyProperty.Register(
"Stretch", typeof(Stretch), typeof(ImageSelector), new PropertyMetadata(default(Stretch))); nameof(Stretch), typeof(Stretch), typeof(ImageSelector), new PropertyMetadata(default(Stretch)));
public Stretch Stretch public Stretch Stretch
{ {
@@ -99,7 +99,7 @@ public class ImageSelector : Control
} }
public static readonly DependencyProperty StrokeThicknessProperty = DependencyProperty.Register( public static readonly DependencyProperty StrokeThicknessProperty = DependencyProperty.Register(
"StrokeThickness", typeof(double), typeof(ImageSelector), new FrameworkPropertyMetadata(ValueBoxes.Double1Box, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(StrokeThickness), typeof(double), typeof(ImageSelector), new FrameworkPropertyMetadata(ValueBoxes.Double1Box, FrameworkPropertyMetadataOptions.AffectsRender));
public double StrokeThickness public double StrokeThickness
{ {
@@ -108,7 +108,7 @@ public class ImageSelector : Control
} }
public static readonly DependencyProperty StrokeDashArrayProperty = DependencyProperty.Register( public static readonly DependencyProperty StrokeDashArrayProperty = DependencyProperty.Register(
"StrokeDashArray", typeof(DoubleCollection), typeof(ImageSelector), new FrameworkPropertyMetadata(default(DoubleCollection), FrameworkPropertyMetadataOptions.AffectsRender)); nameof(StrokeDashArray), typeof(DoubleCollection), typeof(ImageSelector), new FrameworkPropertyMetadata(default(DoubleCollection), FrameworkPropertyMetadataOptions.AffectsRender));
public DoubleCollection StrokeDashArray public DoubleCollection StrokeDashArray
{ {
@@ -117,7 +117,7 @@ public class ImageSelector : Control
} }
public static readonly DependencyProperty DefaultExtProperty = DependencyProperty.Register( public static readonly DependencyProperty DefaultExtProperty = DependencyProperty.Register(
"DefaultExt", typeof(string), typeof(ImageSelector), new PropertyMetadata(".jpg")); nameof(DefaultExt), typeof(string), typeof(ImageSelector), new PropertyMetadata(".jpg"));
public string DefaultExt public string DefaultExt
{ {
@@ -126,7 +126,7 @@ public class ImageSelector : Control
} }
public static readonly DependencyProperty FilterProperty = DependencyProperty.Register( public static readonly DependencyProperty FilterProperty = DependencyProperty.Register(
"Filter", typeof(string), typeof(ImageSelector), new PropertyMetadata("(.jpg)|*.jpg|(.png)|*.png")); nameof(Filter), typeof(string), typeof(ImageSelector), new PropertyMetadata("(.jpg)|*.jpg|(.png)|*.png"));
public string Filter public string Filter
{ {
@@ -147,7 +147,7 @@ public class NumericUpDown : Control
/// 当前值 /// 当前值
/// </summary> /// </summary>
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value", typeof(double), typeof(NumericUpDown), nameof(Value), typeof(double), typeof(NumericUpDown),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
OnValueChanged, CoerceValue), ValidateHelper.IsInRangeOfDouble); OnValueChanged, CoerceValue), ValidateHelper.IsInRangeOfDouble);
@@ -204,7 +204,7 @@ public class NumericUpDown : Control
/// 最大值 /// 最大值
/// </summary> /// </summary>
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register( public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
"Maximum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(double.MaxValue, OnMaximumChanged, CoerceMaximum), ValidateHelper.IsInRangeOfDouble); nameof(Maximum), typeof(double), typeof(NumericUpDown), new PropertyMetadata(double.MaxValue, OnMaximumChanged, CoerceMaximum), ValidateHelper.IsInRangeOfDouble);
private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -232,7 +232,7 @@ public class NumericUpDown : Control
/// 最小值 /// 最小值
/// </summary> /// </summary>
public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register( public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(
"Minimum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(double.MinValue, OnMinimumChanged, CoerceMinimum), ValidateHelper.IsInRangeOfDouble); nameof(Minimum), typeof(double), typeof(NumericUpDown), new PropertyMetadata(double.MinValue, OnMinimumChanged, CoerceMinimum), ValidateHelper.IsInRangeOfDouble);
private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -260,7 +260,7 @@ public class NumericUpDown : Control
/// 指示每单击一下按钮时增加或减少的数量 /// 指示每单击一下按钮时增加或减少的数量
/// </summary> /// </summary>
public static readonly DependencyProperty IncrementProperty = DependencyProperty.Register( public static readonly DependencyProperty IncrementProperty = DependencyProperty.Register(
"Increment", typeof(double), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.Double1Box)); nameof(Increment), typeof(double), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.Double1Box));
/// <summary> /// <summary>
/// 指示每单击一下按钮时增加或减少的数量 /// 指示每单击一下按钮时增加或减少的数量
@@ -275,7 +275,7 @@ public class NumericUpDown : Control
/// 指示要显示的小数位数 /// 指示要显示的小数位数
/// </summary> /// </summary>
public static readonly DependencyProperty DecimalPlacesProperty = DependencyProperty.Register( public static readonly DependencyProperty DecimalPlacesProperty = DependencyProperty.Register(
"DecimalPlaces", typeof(int?), typeof(NumericUpDown), new PropertyMetadata(default(int?))); nameof(DecimalPlaces), typeof(int?), typeof(NumericUpDown), new PropertyMetadata(default(int?)));
/// <summary> /// <summary>
/// 指示要显示的小数位数 /// 指示要显示的小数位数
@@ -290,7 +290,7 @@ public class NumericUpDown : Control
/// 指示要显示的数字的格式 /// 指示要显示的数字的格式
/// </summary> /// </summary>
public static readonly DependencyProperty ValueFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueFormatProperty = DependencyProperty.Register(
"ValueFormat", typeof(string), typeof(NumericUpDown), new PropertyMetadata(default(string))); nameof(ValueFormat), typeof(string), typeof(NumericUpDown), new PropertyMetadata(default(string)));
/// <summary> /// <summary>
/// 指示要显示的数字的格式,这将会覆盖 <see cref="DecimalPlaces"/> 属性 /// 指示要显示的数字的格式,这将会覆盖 <see cref="DecimalPlaces"/> 属性
@@ -305,7 +305,7 @@ public class NumericUpDown : Control
/// 是否显示上下调值按钮 /// 是否显示上下调值按钮
/// </summary> /// </summary>
internal static readonly DependencyProperty ShowUpDownButtonProperty = DependencyProperty.Register( internal static readonly DependencyProperty ShowUpDownButtonProperty = DependencyProperty.Register(
"ShowUpDownButton", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowUpDownButton), typeof(bool), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.TrueBox));
/// <summary> /// <summary>
/// 是否显示上下调值按钮 /// 是否显示上下调值按钮
@@ -320,7 +320,7 @@ public class NumericUpDown : Control
/// 标识 IsReadOnly 依赖属性。 /// 标识 IsReadOnly 依赖属性。
/// </summary> /// </summary>
public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register( public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
"IsReadOnly", typeof(bool), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsReadOnly), typeof(bool), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 获取或设置一个值,该值指示NumericUpDown是否只读。 /// 获取或设置一个值,该值指示NumericUpDown是否只读。
@@ -43,7 +43,7 @@ public class PasswordBox : Control, IDataInput
/// 数据是否错误 /// 数据是否错误
/// </summary> /// </summary>
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register( public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
"IsError", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsError), typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsError public bool IsError
{ {
@@ -55,7 +55,7 @@ public class PasswordBox : Control, IDataInput
/// 错误提示 /// 错误提示
/// </summary> /// </summary>
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
"ErrorStr", typeof(string), typeof(PasswordBox), new PropertyMetadata(default(string))); nameof(ErrorStr), typeof(string), typeof(PasswordBox), new PropertyMetadata(default(string)));
public string ErrorStr public string ErrorStr
{ {
@@ -67,7 +67,7 @@ public class PasswordBox : Control, IDataInput
/// 文本类型 /// 文本类型
/// </summary> /// </summary>
public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register( public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register(
"TextType", typeof(TextType), typeof(PasswordBox), new PropertyMetadata(default(TextType))); nameof(TextType), typeof(TextType), typeof(PasswordBox), new PropertyMetadata(default(TextType)));
public TextType TextType public TextType TextType
{ {
@@ -79,7 +79,7 @@ public class PasswordBox : Control, IDataInput
/// 是否显示清除按钮 /// 是否显示清除按钮
/// </summary> /// </summary>
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
"ShowClearButton", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowClearButton), typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowClearButton public bool ShowClearButton
{ {
@@ -88,7 +88,7 @@ public class PasswordBox : Control, IDataInput
} }
public static readonly DependencyProperty ShowEyeButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowEyeButtonProperty = DependencyProperty.Register(
"ShowEyeButton", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowEyeButton), typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowEyeButton public bool ShowEyeButton
{ {
@@ -97,7 +97,7 @@ public class PasswordBox : Control, IDataInput
} }
public static readonly DependencyProperty ShowPasswordProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowPasswordProperty = DependencyProperty.Register(
"ShowPassword", typeof(bool), typeof(PasswordBox), nameof(ShowPassword), typeof(bool), typeof(PasswordBox),
new PropertyMetadata(ValueBoxes.FalseBox, OnShowPasswordChanged)); new PropertyMetadata(ValueBoxes.FalseBox, OnShowPasswordChanged));
public bool ShowPassword public bool ShowPassword
@@ -107,7 +107,7 @@ public class PasswordBox : Control, IDataInput
} }
public static readonly DependencyProperty IsSafeEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSafeEnabledProperty = DependencyProperty.Register(
"IsSafeEnabled", typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.TrueBox, OnIsSafeEnabledChanged)); nameof(IsSafeEnabled), typeof(bool), typeof(PasswordBox), new PropertyMetadata(ValueBoxes.TrueBox, OnIsSafeEnabledChanged));
private static void OnIsSafeEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIsSafeEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -122,7 +122,7 @@ public class PasswordBox : Control, IDataInput
} }
public static readonly DependencyProperty UnsafePasswordProperty = DependencyProperty.Register( public static readonly DependencyProperty UnsafePasswordProperty = DependencyProperty.Register(
"UnsafePassword", typeof(string), typeof(PasswordBox), new FrameworkPropertyMetadata(default(string), nameof(UnsafePassword), typeof(string), typeof(PasswordBox), new FrameworkPropertyMetadata(default(string),
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnUnsafePasswordChanged)); FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnUnsafePasswordChanged));
private static void OnUnsafePasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnUnsafePasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -262,7 +262,7 @@ public class PinBox : Control
} }
public static readonly DependencyProperty LengthProperty = DependencyProperty.Register( public static readonly DependencyProperty LengthProperty = DependencyProperty.Register(
"Length", typeof(int), typeof(PinBox), new PropertyMetadata(MinLength, OnLengthChanged, CoerceLength), ValidateHelper.IsInRangeOfPosInt); nameof(Length), typeof(int), typeof(PinBox), new PropertyMetadata(MinLength, OnLengthChanged, CoerceLength), ValidateHelper.IsInRangeOfPosInt);
private static void OnLengthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnLengthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -279,7 +279,7 @@ public class PinBox : Control
} }
public static readonly DependencyProperty ItemMarginProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemMarginProperty = DependencyProperty.Register(
"ItemMargin", typeof(Thickness), typeof(PinBox), new PropertyMetadata(default(Thickness))); nameof(ItemMargin), typeof(Thickness), typeof(PinBox), new PropertyMetadata(default(Thickness)));
public Thickness ItemMargin public Thickness ItemMargin
{ {
@@ -288,7 +288,7 @@ public class PinBox : Control
} }
public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register(
"ItemWidth", typeof(double), typeof(PinBox), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(ItemWidth), typeof(double), typeof(PinBox), new PropertyMetadata(ValueBoxes.Double0Box));
public double ItemWidth public double ItemWidth
{ {
@@ -297,7 +297,7 @@ public class PinBox : Control
} }
public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register(
"ItemHeight", typeof(double), typeof(PinBox), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(ItemHeight), typeof(double), typeof(PinBox), new PropertyMetadata(ValueBoxes.Double0Box));
public double ItemHeight public double ItemHeight
{ {
@@ -68,7 +68,7 @@ public class SearchBar : TextBox, ICommandSource
/// 是否实时搜索 /// 是否实时搜索
/// </summary> /// </summary>
public static readonly DependencyProperty IsRealTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty IsRealTimeProperty = DependencyProperty.Register(
"IsRealTime", typeof(bool), typeof(SearchBar), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsRealTime), typeof(bool), typeof(SearchBar), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 是否实时搜索 /// 是否实时搜索
@@ -80,7 +80,7 @@ public class SearchBar : TextBox, ICommandSource
} }
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register( public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
"Command", typeof(ICommand), typeof(SearchBar), new PropertyMetadata(default(ICommand), OnCommandChanged)); nameof(Command), typeof(ICommand), typeof(SearchBar), new PropertyMetadata(default(ICommand), OnCommandChanged));
private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -102,7 +102,7 @@ public class SearchBar : TextBox, ICommandSource
} }
public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register( public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register(
"CommandParameter", typeof(object), typeof(SearchBar), new PropertyMetadata(default(object))); nameof(CommandParameter), typeof(object), typeof(SearchBar), new PropertyMetadata(default(object)));
public object CommandParameter public object CommandParameter
{ {
@@ -111,7 +111,7 @@ public class SearchBar : TextBox, ICommandSource
} }
public static readonly DependencyProperty CommandTargetProperty = DependencyProperty.Register( public static readonly DependencyProperty CommandTargetProperty = DependencyProperty.Register(
"CommandTarget", typeof(IInputElement), typeof(SearchBar), new PropertyMetadata(default(IInputElement))); nameof(CommandTarget), typeof(IInputElement), typeof(SearchBar), new PropertyMetadata(default(IInputElement)));
public IInputElement CommandTarget public IInputElement CommandTarget
{ {
@@ -93,7 +93,7 @@ public class TimePicker : Control, IDataInput
#region TimeFormat #region TimeFormat
public static readonly DependencyProperty TimeFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty TimeFormatProperty = DependencyProperty.Register(
"TimeFormat", typeof(string), typeof(TimePicker), new PropertyMetadata("HH:mm:ss")); nameof(TimeFormat), typeof(string), typeof(TimePicker), new PropertyMetadata("HH:mm:ss"));
public string TimeFormat public string TimeFormat
{ {
@@ -113,7 +113,7 @@ public class TimePicker : Control, IDataInput
public static readonly DependencyProperty DisplayTimeProperty = public static readonly DependencyProperty DisplayTimeProperty =
DependencyProperty.Register( DependencyProperty.Register(
"DisplayTime", nameof(DisplayTime),
typeof(DateTime), typeof(DateTime),
typeof(TimePicker), typeof(TimePicker),
new FrameworkPropertyMetadata(DateTime.Now, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, CoerceDisplayTime)); new FrameworkPropertyMetadata(DateTime.Now, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, null, CoerceDisplayTime));
@@ -137,7 +137,7 @@ public class TimePicker : Control, IDataInput
public static readonly DependencyProperty IsDropDownOpenProperty = public static readonly DependencyProperty IsDropDownOpenProperty =
DependencyProperty.Register( DependencyProperty.Register(
"IsDropDownOpen", nameof(IsDropDownOpen),
typeof(bool), typeof(bool),
typeof(TimePicker), typeof(TimePicker),
new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsDropDownOpenChanged, OnCoerceIsDropDownOpen)); new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsDropDownOpenChanged, OnCoerceIsDropDownOpen));
@@ -182,7 +182,7 @@ public class TimePicker : Control, IDataInput
public static readonly DependencyProperty SelectedTimeProperty = public static readonly DependencyProperty SelectedTimeProperty =
DependencyProperty.Register( DependencyProperty.Register(
"SelectedTime", nameof(SelectedTime),
typeof(DateTime?), typeof(DateTime?),
typeof(TimePicker), typeof(TimePicker),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedTimeChanged, CoerceSelectedTime)); new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedTimeChanged, CoerceSelectedTime));
@@ -222,7 +222,7 @@ public class TimePicker : Control, IDataInput
public static readonly DependencyProperty TextProperty = public static readonly DependencyProperty TextProperty =
DependencyProperty.Register( DependencyProperty.Register(
"Text", nameof(Text),
typeof(string), typeof(string),
typeof(TimePicker), typeof(TimePicker),
new FrameworkPropertyMetadata(string.Empty, OnTextChanged)); new FrameworkPropertyMetadata(string.Empty, OnTextChanged));
@@ -265,7 +265,7 @@ public class TimePicker : Control, IDataInput
public Func<string, OperationResult<bool>> VerifyFunc { get; set; } public Func<string, OperationResult<bool>> VerifyFunc { get; set; }
public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register( public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register(
"IsError", typeof(bool), typeof(TimePicker), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsError), typeof(bool), typeof(TimePicker), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsError public bool IsError
{ {
@@ -274,7 +274,7 @@ public class TimePicker : Control, IDataInput
} }
public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty ErrorStrProperty = DependencyProperty.Register(
"ErrorStr", typeof(string), typeof(TimePicker), new PropertyMetadata(default(string))); nameof(ErrorStr), typeof(string), typeof(TimePicker), new PropertyMetadata(default(string)));
public string ErrorStr public string ErrorStr
{ {
@@ -283,7 +283,7 @@ public class TimePicker : Control, IDataInput
} }
public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register( public static readonly DependencyProperty TextTypeProperty = DependencyProperty.Register(
"TextType", typeof(TextType), typeof(TimePicker), new PropertyMetadata(default(TextType))); nameof(TextType), typeof(TextType), typeof(TimePicker), new PropertyMetadata(default(TextType)));
public TextType TextType public TextType TextType
{ {
@@ -292,7 +292,7 @@ public class TimePicker : Control, IDataInput
} }
public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowClearButtonProperty = DependencyProperty.Register(
"ShowClearButton", typeof(bool), typeof(TimePicker), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowClearButton), typeof(bool), typeof(TimePicker), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowClearButton public bool ShowClearButton
{ {
@@ -341,7 +341,7 @@ public class TimePicker : Control, IDataInput
} }
public static readonly DependencyProperty ClockProperty = DependencyProperty.Register( public static readonly DependencyProperty ClockProperty = DependencyProperty.Register(
"Clock", typeof(ClockBase), typeof(TimePicker), new FrameworkPropertyMetadata(default(Clock), FrameworkPropertyMetadataOptions.NotDataBindable, OnClockChanged)); nameof(Clock), typeof(ClockBase), typeof(TimePicker), new FrameworkPropertyMetadata(default(Clock), FrameworkPropertyMetadataOptions.NotDataBindable, OnClockChanged));
private static void OnClockChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnClockChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -9,7 +9,7 @@ public class WatermarkTextBox : TextBox
#region Watermark #region Watermark
public static readonly DependencyProperty WatermarkProperty = DependencyProperty.Register( public static readonly DependencyProperty WatermarkProperty = DependencyProperty.Register(
"Watermark", typeof(object), typeof(WatermarkTextBox), new PropertyMetadata(default(object))); nameof(Watermark), typeof(object), typeof(WatermarkTextBox), new PropertyMetadata(default(object)));
public object Watermark public object Watermark
{ {
@@ -14,7 +14,7 @@ public abstract class LoadingBase : ContentControl
protected Storyboard Storyboard; protected Storyboard Storyboard;
public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register( public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register(
"IsRunning", typeof(bool), typeof(LoadingBase), new PropertyMetadata(ValueBoxes.TrueBox, (o, args) => nameof(IsRunning), typeof(bool), typeof(LoadingBase), new PropertyMetadata(ValueBoxes.TrueBox, (o, args) =>
{ {
var ctl = (LoadingBase) o; var ctl = (LoadingBase) o;
var v = (bool) args.NewValue; var v = (bool) args.NewValue;
@@ -35,31 +35,31 @@ public abstract class LoadingBase : ContentControl
} }
public static readonly DependencyProperty DotCountProperty = DependencyProperty.Register( public static readonly DependencyProperty DotCountProperty = DependencyProperty.Register(
"DotCount", typeof(int), typeof(LoadingBase), nameof(DotCount), typeof(int), typeof(LoadingBase),
new FrameworkPropertyMetadata(ValueBoxes.Int5Box, FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(ValueBoxes.Int5Box, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DotIntervalProperty = DependencyProperty.Register( public static readonly DependencyProperty DotIntervalProperty = DependencyProperty.Register(
"DotInterval", typeof(double), typeof(LoadingBase), nameof(DotInterval), typeof(double), typeof(LoadingBase),
new FrameworkPropertyMetadata(ValueBoxes.Double10Box, FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(ValueBoxes.Double10Box, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DotBorderBrushProperty = DependencyProperty.Register( public static readonly DependencyProperty DotBorderBrushProperty = DependencyProperty.Register(
"DotBorderBrush", typeof(Brush), typeof(LoadingBase), nameof(DotBorderBrush), typeof(Brush), typeof(LoadingBase),
new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DotBorderThicknessProperty = DependencyProperty.Register( public static readonly DependencyProperty DotBorderThicknessProperty = DependencyProperty.Register(
"DotBorderThickness", typeof(double), typeof(LoadingBase), nameof(DotBorderThickness), typeof(double), typeof(LoadingBase),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DotDiameterProperty = DependencyProperty.Register( public static readonly DependencyProperty DotDiameterProperty = DependencyProperty.Register(
"DotDiameter", typeof(double), typeof(LoadingBase), nameof(DotDiameter), typeof(double), typeof(LoadingBase),
new FrameworkPropertyMetadata(6.0, FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(6.0, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DotSpeedProperty = DependencyProperty.Register( public static readonly DependencyProperty DotSpeedProperty = DependencyProperty.Register(
"DotSpeed", typeof(double), typeof(LoadingBase), nameof(DotSpeed), typeof(double), typeof(LoadingBase),
new FrameworkPropertyMetadata(4.0, FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(4.0, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DotDelayTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty DotDelayTimeProperty = DependencyProperty.Register(
"DotDelayTime", typeof(double), typeof(LoadingBase), nameof(DotDelayTime), typeof(double), typeof(LoadingBase),
new FrameworkPropertyMetadata(80.0, FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(80.0, FrameworkPropertyMetadataOptions.AffectsRender));
protected readonly Canvas PrivateCanvas = new() protected readonly Canvas PrivateCanvas = new()
@@ -12,7 +12,7 @@ namespace HandyControl.Controls;
public class LoadingCircle : LoadingBase public class LoadingCircle : LoadingBase
{ {
public static readonly DependencyProperty DotOffSetProperty = DependencyProperty.Register( public static readonly DependencyProperty DotOffSetProperty = DependencyProperty.Register(
"DotOffSet", typeof(double), typeof(LoadingCircle), nameof(DotOffSet), typeof(double), typeof(LoadingCircle),
new FrameworkPropertyMetadata(20.0, FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(20.0, FrameworkPropertyMetadataOptions.AffectsRender));
public double DotOffSet public double DotOffSet
@@ -22,7 +22,7 @@ public class LoadingCircle : LoadingBase
} }
public static readonly DependencyProperty NeedHiddenProperty = DependencyProperty.Register( public static readonly DependencyProperty NeedHiddenProperty = DependencyProperty.Register(
"NeedHidden", typeof(bool), typeof(LoadingCircle), nameof(NeedHidden), typeof(bool), typeof(LoadingCircle),
new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.AffectsRender)); new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.AffectsRender));
public bool NeedHidden public bool NeedHidden
@@ -37,7 +37,7 @@ public class AnimationPath : Shape
protected override Geometry DefiningGeometry => Data ?? Geometry.Empty; protected override Geometry DefiningGeometry => Data ?? Geometry.Empty;
public static readonly DependencyProperty PathLengthProperty = DependencyProperty.Register( public static readonly DependencyProperty PathLengthProperty = DependencyProperty.Register(
"PathLength", typeof(double), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, OnPropertiesChanged)); nameof(PathLength), typeof(double), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, OnPropertiesChanged));
public double PathLength public double PathLength
{ {
@@ -46,7 +46,7 @@ public class AnimationPath : Shape
} }
public static readonly DependencyProperty DurationProperty = DependencyProperty.Register( public static readonly DependencyProperty DurationProperty = DependencyProperty.Register(
"Duration", typeof(Duration), typeof(AnimationPath), new FrameworkPropertyMetadata(new Duration(TimeSpan.FromSeconds(2)), nameof(Duration), typeof(Duration), typeof(AnimationPath), new FrameworkPropertyMetadata(new Duration(TimeSpan.FromSeconds(2)),
OnPropertiesChanged)); OnPropertiesChanged));
public Duration Duration public Duration Duration
@@ -56,7 +56,7 @@ public class AnimationPath : Shape
} }
public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register( public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register(
"IsPlaying", typeof(bool), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, (o, args) => nameof(IsPlaying), typeof(bool), typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, (o, args) =>
{ {
var ctl = (AnimationPath) o; var ctl = (AnimationPath) o;
var v = (bool) args.NewValue; var v = (bool) args.NewValue;
@@ -24,7 +24,7 @@ public class Badge : ContentControl
} }
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(Badge), new PropertyMetadata("0")); nameof(Text), typeof(string), typeof(Badge), new PropertyMetadata("0"));
public string Text public string Text
{ {
@@ -33,7 +33,7 @@ public class Badge : ContentControl
} }
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value", typeof(int), typeof(Badge), new PropertyMetadata(ValueBoxes.Int0Box, OnValueChanged)); nameof(Value), typeof(int), typeof(Badge), new PropertyMetadata(ValueBoxes.Int0Box, OnValueChanged));
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -60,7 +60,7 @@ public class Badge : ContentControl
} }
public static readonly DependencyProperty StatusProperty = DependencyProperty.Register( public static readonly DependencyProperty StatusProperty = DependencyProperty.Register(
"Status", typeof(BadgeStatus), typeof(Badge), new PropertyMetadata(default(BadgeStatus))); nameof(Status), typeof(BadgeStatus), typeof(Badge), new PropertyMetadata(default(BadgeStatus)));
public BadgeStatus Status public BadgeStatus Status
{ {
@@ -69,7 +69,7 @@ public class Badge : ContentControl
} }
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register( public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
"Maximum", typeof(int), typeof(Badge), new PropertyMetadata(ValueBoxes.Int99Box, OnMaximumChanged)); nameof(Maximum), typeof(int), typeof(Badge), new PropertyMetadata(ValueBoxes.Int99Box, OnMaximumChanged));
private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -85,7 +85,7 @@ public class Badge : ContentControl
} }
public static readonly DependencyProperty BadgeMarginProperty = DependencyProperty.Register( public static readonly DependencyProperty BadgeMarginProperty = DependencyProperty.Register(
"BadgeMargin", typeof(Thickness), typeof(Badge), new PropertyMetadata(default(Thickness))); nameof(BadgeMargin), typeof(Thickness), typeof(Badge), new PropertyMetadata(default(Thickness)));
public Thickness BadgeMargin public Thickness BadgeMargin
{ {
@@ -94,7 +94,7 @@ public class Badge : ContentControl
} }
public static readonly DependencyProperty ShowBadgeProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowBadgeProperty = DependencyProperty.Register(
"ShowBadge", typeof(bool), typeof(Badge), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowBadge), typeof(bool), typeof(Badge), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowBadge public bool ShowBadge
{ {
@@ -96,7 +96,7 @@ public class BlendEffectBox : Control
public Collection<Effect> Effects { get; } public Collection<Effect> Effects { get; }
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
"Content", typeof(FrameworkElement), typeof(BlendEffectBox), new PropertyMetadata(default(FrameworkElement))); nameof(Content), typeof(FrameworkElement), typeof(BlendEffectBox), new PropertyMetadata(default(FrameworkElement)));
public FrameworkElement Content public FrameworkElement Content
{ {
@@ -105,7 +105,7 @@ public class BlendEffectBox : Control
} }
internal static readonly DependencyProperty ActualContentProperty = DependencyProperty.Register( internal static readonly DependencyProperty ActualContentProperty = DependencyProperty.Register(
"ActualContent", typeof(FrameworkElement), typeof(BlendEffectBox), new PropertyMetadata(default(FrameworkElement))); nameof(ActualContent), typeof(FrameworkElement), typeof(BlendEffectBox), new PropertyMetadata(default(FrameworkElement)));
internal FrameworkElement ActualContent internal FrameworkElement ActualContent
{ {
@@ -7,7 +7,7 @@ namespace HandyControl.Controls;
public class Card : ContentControl public class Card : ContentControl
{ {
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
"Header", typeof(object), typeof(Card), new PropertyMetadata(default(object))); nameof(Header), typeof(object), typeof(Card), new PropertyMetadata(default(object)));
public object Header public object Header
{ {
@@ -16,7 +16,7 @@ public class Card : ContentControl
} }
public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register(
"HeaderTemplate", typeof(DataTemplate), typeof(Card), new PropertyMetadata(default(DataTemplate))); nameof(HeaderTemplate), typeof(DataTemplate), typeof(Card), new PropertyMetadata(default(DataTemplate)));
[Bindable(true), Category("Content")] [Bindable(true), Category("Content")]
public DataTemplate HeaderTemplate public DataTemplate HeaderTemplate
@@ -26,7 +26,7 @@ public class Card : ContentControl
} }
public static readonly DependencyProperty HeaderTemplateSelectorProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderTemplateSelectorProperty = DependencyProperty.Register(
"HeaderTemplateSelector", typeof(DataTemplateSelector), typeof(Card), new PropertyMetadata(default(DataTemplateSelector))); nameof(HeaderTemplateSelector), typeof(DataTemplateSelector), typeof(Card), new PropertyMetadata(default(DataTemplateSelector)));
[Bindable(true), Category("Content")] [Bindable(true), Category("Content")]
public DataTemplateSelector HeaderTemplateSelector public DataTemplateSelector HeaderTemplateSelector
@@ -36,7 +36,7 @@ public class Card : ContentControl
} }
public static readonly DependencyProperty HeaderStringFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderStringFormatProperty = DependencyProperty.Register(
"HeaderStringFormat", typeof(string), typeof(Card), new PropertyMetadata(default(string))); nameof(HeaderStringFormat), typeof(string), typeof(Card), new PropertyMetadata(default(string)));
[Bindable(true), Category("Content")] [Bindable(true), Category("Content")]
public string HeaderStringFormat public string HeaderStringFormat
@@ -46,7 +46,7 @@ public class Card : ContentControl
} }
public static readonly DependencyProperty FooterProperty = DependencyProperty.Register( public static readonly DependencyProperty FooterProperty = DependencyProperty.Register(
"Footer", typeof(object), typeof(Card), new PropertyMetadata(default(object))); nameof(Footer), typeof(object), typeof(Card), new PropertyMetadata(default(object)));
public object Footer public object Footer
{ {
@@ -55,7 +55,7 @@ public class Card : ContentControl
} }
public static readonly DependencyProperty FooterTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty FooterTemplateProperty = DependencyProperty.Register(
"FooterTemplate", typeof(DataTemplate), typeof(Card), new PropertyMetadata(default(DataTemplate))); nameof(FooterTemplate), typeof(DataTemplate), typeof(Card), new PropertyMetadata(default(DataTemplate)));
[Bindable(true), Category("Content")] [Bindable(true), Category("Content")]
public DataTemplate FooterTemplate public DataTemplate FooterTemplate
@@ -65,7 +65,7 @@ public class Card : ContentControl
} }
public static readonly DependencyProperty FooterTemplateSelectorProperty = DependencyProperty.Register( public static readonly DependencyProperty FooterTemplateSelectorProperty = DependencyProperty.Register(
"FooterTemplateSelector", typeof(DataTemplateSelector), typeof(Card), new PropertyMetadata(default(DataTemplateSelector))); nameof(FooterTemplateSelector), typeof(DataTemplateSelector), typeof(Card), new PropertyMetadata(default(DataTemplateSelector)));
[Bindable(true), Category("Content")] [Bindable(true), Category("Content")]
public DataTemplateSelector FooterTemplateSelector public DataTemplateSelector FooterTemplateSelector
@@ -75,7 +75,7 @@ public class Card : ContentControl
} }
public static readonly DependencyProperty FooterStringFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty FooterStringFormatProperty = DependencyProperty.Register(
"FooterStringFormat", typeof(string), typeof(Card), new PropertyMetadata(default(string))); nameof(FooterStringFormat), typeof(string), typeof(Card), new PropertyMetadata(default(string)));
[Bindable(true), Category("Content")] [Bindable(true), Category("Content")]
public string FooterStringFormat public string FooterStringFormat
@@ -7,7 +7,7 @@ namespace HandyControl.Controls;
public class ChatBubble : SelectableItem public class ChatBubble : SelectableItem
{ {
public static readonly DependencyProperty RoleProperty = DependencyProperty.Register( public static readonly DependencyProperty RoleProperty = DependencyProperty.Register(
"Role", typeof(ChatRoleType), typeof(ChatBubble), new PropertyMetadata(default(ChatRoleType))); nameof(Role), typeof(ChatRoleType), typeof(ChatBubble), new PropertyMetadata(default(ChatRoleType)));
public ChatRoleType Role public ChatRoleType Role
{ {
@@ -16,7 +16,7 @@ public class ChatBubble : SelectableItem
} }
public static readonly DependencyProperty TypeProperty = DependencyProperty.Register( public static readonly DependencyProperty TypeProperty = DependencyProperty.Register(
"Type", typeof(ChatMessageType), typeof(ChatBubble), new PropertyMetadata(default(ChatMessageType))); nameof(Type), typeof(ChatMessageType), typeof(ChatBubble), new PropertyMetadata(default(ChatMessageType)));
public ChatMessageType Type public ChatMessageType Type
{ {
@@ -25,7 +25,7 @@ public class ChatBubble : SelectableItem
} }
public static readonly DependencyProperty IsReadProperty = DependencyProperty.Register( public static readonly DependencyProperty IsReadProperty = DependencyProperty.Register(
"IsRead", typeof(bool), typeof(ChatBubble), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsRead), typeof(bool), typeof(ChatBubble), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsRead public bool IsRead
{ {
@@ -38,7 +38,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty BorderThicknessProperty = DependencyProperty.Register( public static readonly DependencyProperty BorderThicknessProperty = DependencyProperty.Register(
"BorderThickness", typeof(Thickness), typeof(DashedBorder), new FrameworkPropertyMetadata(default(Thickness), nameof(BorderThickness), typeof(Thickness), typeof(DashedBorder), new FrameworkPropertyMetadata(default(Thickness),
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
OnClearPenCache)); OnClearPenCache));
@@ -49,7 +49,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty BorderDashThicknessProperty = DependencyProperty.Register( public static readonly DependencyProperty BorderDashThicknessProperty = DependencyProperty.Register(
"BorderDashThickness", typeof(double), typeof(DashedBorder), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, nameof(BorderDashThickness), typeof(double), typeof(DashedBorder), new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
OnClearPenCache)); OnClearPenCache));
@@ -60,7 +60,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty PaddingProperty = DependencyProperty.Register( public static readonly DependencyProperty PaddingProperty = DependencyProperty.Register(
"Padding", typeof(Thickness), typeof(DashedBorder), new FrameworkPropertyMetadata(default(Thickness), nameof(Padding), typeof(Thickness), typeof(DashedBorder), new FrameworkPropertyMetadata(default(Thickness),
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender)); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender));
public Thickness Padding public Thickness Padding
@@ -70,7 +70,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register( public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register(
"CornerRadius", typeof(CornerRadius), typeof(DashedBorder), new FrameworkPropertyMetadata(default(CornerRadius), nameof(CornerRadius), typeof(CornerRadius), typeof(DashedBorder), new FrameworkPropertyMetadata(default(CornerRadius),
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender)); FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender));
public CornerRadius CornerRadius public CornerRadius CornerRadius
@@ -80,7 +80,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty BorderBrushProperty = DependencyProperty.Register( public static readonly DependencyProperty BorderBrushProperty = DependencyProperty.Register(
"BorderBrush", typeof(Brush), typeof(DashedBorder), new FrameworkPropertyMetadata(default(Brush), nameof(BorderBrush), typeof(Brush), typeof(DashedBorder), new FrameworkPropertyMetadata(default(Brush),
FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender,
OnClearPenCache)); OnClearPenCache));
@@ -91,7 +91,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register( public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register(
"Background", typeof(Brush), typeof(DashedBorder), new FrameworkPropertyMetadata(default(Brush), nameof(Background), typeof(Brush), typeof(DashedBorder), new FrameworkPropertyMetadata(default(Brush),
FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender,
OnClearPenCache)); OnClearPenCache));
@@ -102,7 +102,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty BorderDashArrayProperty = DependencyProperty.Register( public static readonly DependencyProperty BorderDashArrayProperty = DependencyProperty.Register(
"BorderDashArray", typeof(DoubleCollection), typeof(DashedBorder), new FrameworkPropertyMetadata(default(DoubleCollection), nameof(BorderDashArray), typeof(DoubleCollection), typeof(DashedBorder), new FrameworkPropertyMetadata(default(DoubleCollection),
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
OnClearPenCache)); OnClearPenCache));
@@ -113,7 +113,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty BorderDashCapProperty = DependencyProperty.Register( public static readonly DependencyProperty BorderDashCapProperty = DependencyProperty.Register(
"BorderDashCap", typeof(PenLineCap), typeof(DashedBorder), new FrameworkPropertyMetadata(default(PenLineCap), nameof(BorderDashCap), typeof(PenLineCap), typeof(DashedBorder), new FrameworkPropertyMetadata(default(PenLineCap),
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
OnClearPenCache)); OnClearPenCache));
@@ -124,7 +124,7 @@ public class DashedBorder : Decorator
} }
public static readonly DependencyProperty BorderDashOffsetProperty = DependencyProperty.Register( public static readonly DependencyProperty BorderDashOffsetProperty = DependencyProperty.Register(
"BorderDashOffset", typeof(double), typeof(DashedBorder), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, nameof(BorderDashOffset), typeof(double), typeof(DashedBorder), new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
OnClearPenCache)); OnClearPenCache));
@@ -11,7 +11,7 @@ namespace HandyControl.Controls;
public class Divider : Control public class Divider : Control
{ {
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
"Content", typeof(object), typeof(Divider), new PropertyMetadata(default(object))); nameof(Content), typeof(object), typeof(Divider), new PropertyMetadata(default(object)));
public object Content public object Content
{ {
@@ -20,7 +20,7 @@ public class Divider : Control
} }
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(Divider), new PropertyMetadata(default(Orientation))); nameof(Orientation), typeof(Orientation), typeof(Divider), new PropertyMetadata(default(Orientation)));
public Orientation Orientation public Orientation Orientation
{ {
@@ -29,7 +29,7 @@ public class Divider : Control
} }
public static readonly DependencyProperty ContentTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentTemplateProperty = DependencyProperty.Register(
"ContentTemplate", typeof(DataTemplate), typeof(Divider), new PropertyMetadata(default(DataTemplate))); nameof(ContentTemplate), typeof(DataTemplate), typeof(Divider), new PropertyMetadata(default(DataTemplate)));
public DataTemplate ContentTemplate public DataTemplate ContentTemplate
{ {
@@ -38,7 +38,7 @@ public class Divider : Control
} }
public static readonly DependencyProperty ContentStringFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentStringFormatProperty = DependencyProperty.Register(
"ContentStringFormat", typeof(string), typeof(Divider), new PropertyMetadata(default(string))); nameof(ContentStringFormat), typeof(string), typeof(Divider), new PropertyMetadata(default(string)));
public string ContentStringFormat public string ContentStringFormat
{ {
@@ -47,7 +47,7 @@ public class Divider : Control
} }
public static readonly DependencyProperty ContentTemplateSelectorProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentTemplateSelectorProperty = DependencyProperty.Register(
"ContentTemplateSelector", typeof(DataTemplateSelector), typeof(Divider), new PropertyMetadata(default(DataTemplateSelector))); nameof(ContentTemplateSelector), typeof(DataTemplateSelector), typeof(Divider), new PropertyMetadata(default(DataTemplateSelector)));
public DataTemplateSelector ContentTemplateSelector public DataTemplateSelector ContentTemplateSelector
{ {
@@ -56,7 +56,7 @@ public class Divider : Control
} }
public static readonly DependencyProperty LineStrokeProperty = DependencyProperty.Register( public static readonly DependencyProperty LineStrokeProperty = DependencyProperty.Register(
"LineStroke", typeof(Brush), typeof(Divider), new PropertyMetadata(default(Brush))); nameof(LineStroke), typeof(Brush), typeof(Divider), new PropertyMetadata(default(Brush)));
public Brush LineStroke public Brush LineStroke
{ {
@@ -65,7 +65,7 @@ public class Divider : Control
} }
public static readonly DependencyProperty LineStrokeThicknessProperty = DependencyProperty.Register( public static readonly DependencyProperty LineStrokeThicknessProperty = DependencyProperty.Register(
"LineStrokeThickness", typeof(double), typeof(Divider), new PropertyMetadata(ValueBoxes.Double1Box)); nameof(LineStrokeThickness), typeof(double), typeof(Divider), new PropertyMetadata(ValueBoxes.Double1Box));
public double LineStrokeThickness public double LineStrokeThickness
{ {
@@ -74,7 +74,7 @@ public class Divider : Control
} }
public static readonly DependencyProperty LineStrokeDashArrayProperty = DependencyProperty.Register( public static readonly DependencyProperty LineStrokeDashArrayProperty = DependencyProperty.Register(
"LineStrokeDashArray", typeof(DoubleCollection), typeof(Divider), new PropertyMetadata(new DoubleCollection())); nameof(LineStrokeDashArray), typeof(DoubleCollection), typeof(Divider), new PropertyMetadata(new DoubleCollection()));
public DoubleCollection LineStrokeDashArray public DoubleCollection LineStrokeDashArray
{ {
@@ -7,7 +7,7 @@ namespace HandyControl.Controls;
public class Empty : ContentControl public class Empty : ContentControl
{ {
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register(
"Description", typeof(object), typeof(Empty), new PropertyMetadata(default(object))); nameof(Description), typeof(object), typeof(Empty), new PropertyMetadata(default(object)));
public object Description public object Description
{ {
@@ -16,7 +16,7 @@ public class Empty : ContentControl
} }
public static readonly DependencyProperty LogoProperty = DependencyProperty.Register( public static readonly DependencyProperty LogoProperty = DependencyProperty.Register(
"Logo", typeof(object), typeof(Empty), new PropertyMetadata(default(object))); nameof(Logo), typeof(object), typeof(Empty), new PropertyMetadata(default(object)));
public object Logo public object Logo
{ {
@@ -14,7 +14,7 @@ public class GotoTop : Button
private System.Windows.Controls.ScrollViewer _scrollViewer; private System.Windows.Controls.ScrollViewer _scrollViewer;
public static readonly DependencyProperty TargetProperty = DependencyProperty.Register( public static readonly DependencyProperty TargetProperty = DependencyProperty.Register(
"Target", typeof(DependencyObject), typeof(GotoTop), new PropertyMetadata(default(DependencyObject))); nameof(Target), typeof(DependencyObject), typeof(GotoTop), new PropertyMetadata(default(DependencyObject)));
public DependencyObject Target public DependencyObject Target
{ {
@@ -55,7 +55,7 @@ public class GotoTop : Button
} }
public static readonly DependencyProperty AnimatedProperty = DependencyProperty.Register( public static readonly DependencyProperty AnimatedProperty = DependencyProperty.Register(
"Animated", typeof(bool), typeof(GotoTop), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(Animated), typeof(bool), typeof(GotoTop), new PropertyMetadata(ValueBoxes.TrueBox));
public bool Animated public bool Animated
{ {
@@ -64,7 +64,7 @@ public class GotoTop : Button
} }
public static readonly DependencyProperty AnimationTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty AnimationTimeProperty = DependencyProperty.Register(
"AnimationTime", typeof(double), typeof(GotoTop), new PropertyMetadata(ValueBoxes.Double200Box)); nameof(AnimationTime), typeof(double), typeof(GotoTop), new PropertyMetadata(ValueBoxes.Double200Box));
public double AnimationTime public double AnimationTime
{ {
@@ -73,7 +73,7 @@ public class GotoTop : Button
} }
public static readonly DependencyProperty HidingHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty HidingHeightProperty = DependencyProperty.Register(
"HidingHeight", typeof(double), typeof(GotoTop), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(HidingHeight), typeof(double), typeof(GotoTop), new PropertyMetadata(ValueBoxes.Double0Box));
public double HidingHeight public double HidingHeight
{ {
@@ -82,7 +82,7 @@ public class GotoTop : Button
} }
public static readonly DependencyProperty AutoHidingProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoHidingProperty = DependencyProperty.Register(
"AutoHiding", typeof(bool), typeof(GotoTop), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(AutoHiding), typeof(bool), typeof(GotoTop), new PropertyMetadata(ValueBoxes.TrueBox));
public bool AutoHiding public bool AutoHiding
{ {
@@ -9,7 +9,7 @@ namespace HandyControl.Controls;
public class Gravatar : ContentControl public class Gravatar : ContentControl
{ {
public static readonly DependencyProperty GeneratorProperty = DependencyProperty.Register( public static readonly DependencyProperty GeneratorProperty = DependencyProperty.Register(
"Generator", typeof(IGravatarGenerator), typeof(Gravatar), new PropertyMetadata(new GithubGravatarGenerator())); nameof(Generator), typeof(IGravatarGenerator), typeof(Gravatar), new PropertyMetadata(new GithubGravatarGenerator()));
public IGravatarGenerator Generator public IGravatarGenerator Generator
{ {
@@ -18,7 +18,7 @@ public class Gravatar : ContentControl
} }
public static readonly DependencyProperty IdProperty = DependencyProperty.Register( public static readonly DependencyProperty IdProperty = DependencyProperty.Register(
"Id", typeof(string), typeof(Gravatar), new PropertyMetadata(default(string), OnIdChanged)); nameof(Id), typeof(string), typeof(Gravatar), new PropertyMetadata(default(string), OnIdChanged));
private static void OnIdChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIdChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -34,7 +34,7 @@ public class Gravatar : ContentControl
} }
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(ImageSource), typeof(Gravatar), new PropertyMetadata(default(ImageSource), OnSourceChanged)); nameof(Source), typeof(ImageSource), typeof(Gravatar), new PropertyMetadata(default(ImageSource), OnSourceChanged));
private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -23,7 +23,7 @@ public class Magnifier : AdornerElement
private readonly TranslateTransform _translateTransform; private readonly TranslateTransform _translateTransform;
public static readonly DependencyProperty HorizontalOffsetProperty = DependencyProperty.Register( public static readonly DependencyProperty HorizontalOffsetProperty = DependencyProperty.Register(
"HorizontalOffset", typeof(double), typeof(Magnifier), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(HorizontalOffset), typeof(double), typeof(Magnifier), new PropertyMetadata(ValueBoxes.Double0Box));
public double HorizontalOffset public double HorizontalOffset
{ {
@@ -32,7 +32,7 @@ public class Magnifier : AdornerElement
} }
public static readonly DependencyProperty VerticalOffsetProperty = DependencyProperty.Register( public static readonly DependencyProperty VerticalOffsetProperty = DependencyProperty.Register(
"VerticalOffset", typeof(double), typeof(Magnifier), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(VerticalOffset), typeof(double), typeof(Magnifier), new PropertyMetadata(ValueBoxes.Double0Box));
public double VerticalOffset public double VerticalOffset
{ {
@@ -43,7 +43,7 @@ public class Magnifier : AdornerElement
public static Magnifier Default => new(); public static Magnifier Default => new();
public static readonly DependencyProperty ScaleProperty = DependencyProperty.Register( public static readonly DependencyProperty ScaleProperty = DependencyProperty.Register(
"Scale", typeof(double), typeof(Magnifier), new PropertyMetadata(5.0, OnScaleChanged), ValidateHelper.IsInRangeOfPosDouble); nameof(Scale), typeof(double), typeof(Magnifier), new PropertyMetadata(5.0, OnScaleChanged), ValidateHelper.IsInRangeOfPosDouble);
private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((Magnifier) d).UpdateViewboxSize(); private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => ((Magnifier) d).UpdateViewboxSize();
@@ -223,7 +223,7 @@ public class NotifyIcon : FrameworkElement, IDisposable
} }
public static readonly DependencyProperty TokenProperty = DependencyProperty.Register( public static readonly DependencyProperty TokenProperty = DependencyProperty.Register(
"Token", typeof(string), typeof(NotifyIcon), new PropertyMetadata(default(string), OnTokenChanged)); nameof(Token), typeof(string), typeof(NotifyIcon), new PropertyMetadata(default(string), OnTokenChanged));
private static void OnTokenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnTokenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -247,7 +247,7 @@ public class NotifyIcon : FrameworkElement, IDisposable
} }
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(NotifyIcon), new PropertyMetadata(default(string))); nameof(Text), typeof(string), typeof(NotifyIcon), new PropertyMetadata(default(string)));
public string Text public string Text
{ {
@@ -256,7 +256,7 @@ public class NotifyIcon : FrameworkElement, IDisposable
} }
public static readonly DependencyProperty IconProperty = DependencyProperty.Register( public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
"Icon", typeof(ImageSource), typeof(NotifyIcon), new PropertyMetadata(default(ImageSource), OnIconChanged)); nameof(Icon), typeof(ImageSource), typeof(NotifyIcon), new PropertyMetadata(default(ImageSource), OnIconChanged));
private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -277,7 +277,7 @@ public class NotifyIcon : FrameworkElement, IDisposable
} }
public static readonly DependencyProperty ContextContentProperty = DependencyProperty.Register( public static readonly DependencyProperty ContextContentProperty = DependencyProperty.Register(
"ContextContent", typeof(object), typeof(NotifyIcon), new PropertyMetadata(default(object))); nameof(ContextContent), typeof(object), typeof(NotifyIcon), new PropertyMetadata(default(object)));
public object ContextContent public object ContextContent
{ {
@@ -286,7 +286,7 @@ public class NotifyIcon : FrameworkElement, IDisposable
} }
public static readonly DependencyProperty BlinkIntervalProperty = DependencyProperty.Register( public static readonly DependencyProperty BlinkIntervalProperty = DependencyProperty.Register(
"BlinkInterval", typeof(TimeSpan), typeof(NotifyIcon), new PropertyMetadata(TimeSpan.FromMilliseconds(500), OnBlinkIntervalChanged)); nameof(BlinkInterval), typeof(TimeSpan), typeof(NotifyIcon), new PropertyMetadata(TimeSpan.FromMilliseconds(500), OnBlinkIntervalChanged));
private static void OnBlinkIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnBlinkIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -304,7 +304,7 @@ public class NotifyIcon : FrameworkElement, IDisposable
} }
public static readonly DependencyProperty IsBlinkProperty = DependencyProperty.Register( public static readonly DependencyProperty IsBlinkProperty = DependencyProperty.Register(
"IsBlink", typeof(bool), typeof(NotifyIcon), new PropertyMetadata(ValueBoxes.FalseBox, OnIsBlinkChanged)); nameof(IsBlink), typeof(bool), typeof(NotifyIcon), new PropertyMetadata(ValueBoxes.FalseBox, OnIsBlinkChanged));
private static void OnIsBlinkChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIsBlinkChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -89,7 +89,7 @@ public class Pagination : Control
/// 最大页数 /// 最大页数
/// </summary> /// </summary>
public static readonly DependencyProperty MaxPageCountProperty = DependencyProperty.Register( public static readonly DependencyProperty MaxPageCountProperty = DependencyProperty.Register(
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, OnMaxPageCountChanged, CoerceMaxPageCount), ValidateHelper.IsInRangeOfPosIntIncludeZero); nameof(MaxPageCount), typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, OnMaxPageCountChanged, CoerceMaxPageCount), ValidateHelper.IsInRangeOfPosIntIncludeZero);
private static object CoerceMaxPageCount(DependencyObject d, object basevalue) private static object CoerceMaxPageCount(DependencyObject d, object basevalue)
{ {
@@ -129,7 +129,7 @@ public class Pagination : Control
/// 每页的数据量 /// 每页的数据量
/// </summary> /// </summary>
public static readonly DependencyProperty DataCountPerPageProperty = DependencyProperty.Register( public static readonly DependencyProperty DataCountPerPageProperty = DependencyProperty.Register(
"DataCountPerPage", typeof(int), typeof(Pagination), new PropertyMetadata(20, OnDataCountPerPageChanged), nameof(DataCountPerPage), typeof(int), typeof(Pagination), new PropertyMetadata(20, OnDataCountPerPageChanged),
ValidateHelper.IsInRangeOfPosInt); ValidateHelper.IsInRangeOfPosInt);
private static void OnDataCountPerPageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnDataCountPerPageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -157,7 +157,7 @@ public class Pagination : Control
/// 当前页 /// 当前页
/// </summary> /// </summary>
public static readonly DependencyProperty PageIndexProperty = DependencyProperty.Register( public static readonly DependencyProperty PageIndexProperty = DependencyProperty.Register(
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, OnPageIndexChanged, CoercePageIndex), ValidateHelper.IsInRangeOfPosIntIncludeZero); nameof(PageIndex), typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, OnPageIndexChanged, CoercePageIndex), ValidateHelper.IsInRangeOfPosIntIncludeZero);
private static object CoercePageIndex(DependencyObject d, object basevalue) private static object CoercePageIndex(DependencyObject d, object basevalue)
{ {
@@ -200,7 +200,7 @@ public class Pagination : Control
/// 表示当前选中的按钮距离左右两个方向按钮的最大间隔(4表示间隔4个按钮,如果超过则用省略号表示) /// 表示当前选中的按钮距离左右两个方向按钮的最大间隔(4表示间隔4个按钮,如果超过则用省略号表示)
/// </summary> /// </summary>
public static readonly DependencyProperty MaxPageIntervalProperty = DependencyProperty.Register( public static readonly DependencyProperty MaxPageIntervalProperty = DependencyProperty.Register(
"MaxPageInterval", typeof(int), typeof(Pagination), new PropertyMetadata(3, OnMaxPageIntervalChanged), ValidateHelper.IsInRangeOfPosIntIncludeZero); nameof(MaxPageInterval), typeof(int), typeof(Pagination), new PropertyMetadata(3, OnMaxPageIntervalChanged), ValidateHelper.IsInRangeOfPosIntIncludeZero);
private static void OnMaxPageIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnMaxPageIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -224,7 +224,7 @@ public class Pagination : Control
#region IsJumpEnabled #region IsJumpEnabled
public static readonly DependencyProperty IsJumpEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsJumpEnabledProperty = DependencyProperty.Register(
"IsJumpEnabled", typeof(bool), typeof(Pagination), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsJumpEnabled), typeof(bool), typeof(Pagination), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsJumpEnabled public bool IsJumpEnabled
{ {
@@ -237,7 +237,7 @@ public class Pagination : Control
#region AutoHiding #region AutoHiding
public static readonly DependencyProperty AutoHidingProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoHidingProperty = DependencyProperty.Register(
"AutoHiding", typeof(bool), typeof(Pagination), new PropertyMetadata(ValueBoxes.TrueBox, OnAutoHidingChanged)); nameof(AutoHiding), typeof(bool), typeof(Pagination), new PropertyMetadata(ValueBoxes.TrueBox, OnAutoHidingChanged));
private static void OnAutoHidingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnAutoHidingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -71,7 +71,7 @@ public class Poptip : AdornerElement
} }
public static readonly DependencyProperty ContentTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentTemplateProperty = DependencyProperty.Register(
"ContentTemplate", typeof(DataTemplate), typeof(Poptip), new PropertyMetadata(default(DataTemplate))); nameof(ContentTemplate), typeof(DataTemplate), typeof(Poptip), new PropertyMetadata(default(DataTemplate)));
public DataTemplate ContentTemplate public DataTemplate ContentTemplate
{ {
@@ -80,7 +80,7 @@ public class Poptip : AdornerElement
} }
public static readonly DependencyProperty ContentStringFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentStringFormatProperty = DependencyProperty.Register(
"ContentStringFormat", typeof(string), typeof(Poptip), new PropertyMetadata(default(string))); nameof(ContentStringFormat), typeof(string), typeof(Poptip), new PropertyMetadata(default(string)));
public string ContentStringFormat public string ContentStringFormat
{ {
@@ -89,7 +89,7 @@ public class Poptip : AdornerElement
} }
public static readonly DependencyProperty ContentTemplateSelectorProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentTemplateSelectorProperty = DependencyProperty.Register(
"ContentTemplateSelector", typeof(DataTemplateSelector), typeof(Poptip), new PropertyMetadata(default(DataTemplateSelector))); nameof(ContentTemplateSelector), typeof(DataTemplateSelector), typeof(Poptip), new PropertyMetadata(default(DataTemplateSelector)));
public DataTemplateSelector ContentTemplateSelector public DataTemplateSelector ContentTemplateSelector
{ {
@@ -178,7 +178,7 @@ public class Poptip : AdornerElement
} }
public static readonly DependencyProperty DelayProperty = DependencyProperty.Register( public static readonly DependencyProperty DelayProperty = DependencyProperty.Register(
"Delay", typeof(double), typeof(Poptip), new PropertyMetadata(1000.0), ValidateHelper.IsInRangeOfPosDoubleIncludeZero); nameof(Delay), typeof(double), typeof(Poptip), new PropertyMetadata(1000.0), ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double Delay public double Delay
{ {
@@ -21,7 +21,7 @@ public class ScrollViewer : System.Windows.Controls.ScrollViewer
/// 是否响应鼠标滚轮操作 /// 是否响应鼠标滚轮操作
/// </summary> /// </summary>
public static readonly DependencyProperty CanMouseWheelProperty = DependencyProperty.Register( public static readonly DependencyProperty CanMouseWheelProperty = DependencyProperty.Register(
"CanMouseWheel", typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(CanMouseWheel), typeof(bool), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.TrueBox));
/// <summary> /// <summary>
/// 是否响应鼠标滚轮操作 /// 是否响应鼠标滚轮操作
@@ -166,7 +166,7 @@ public class ScrollViewer : System.Windows.Controls.ScrollViewer
/// 当前垂直滚动偏移 /// 当前垂直滚动偏移
/// </summary> /// </summary>
internal static readonly DependencyProperty CurrentVerticalOffsetProperty = DependencyProperty.Register( internal static readonly DependencyProperty CurrentVerticalOffsetProperty = DependencyProperty.Register(
"CurrentVerticalOffset", typeof(double), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.Double0Box, OnCurrentVerticalOffsetChanged)); nameof(CurrentVerticalOffset), typeof(double), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.Double0Box, OnCurrentVerticalOffsetChanged));
private static void OnCurrentVerticalOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnCurrentVerticalOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -190,7 +190,7 @@ public class ScrollViewer : System.Windows.Controls.ScrollViewer
/// 当前水平滚动偏移 /// 当前水平滚动偏移
/// </summary> /// </summary>
internal static readonly DependencyProperty CurrentHorizontalOffsetProperty = DependencyProperty.Register( internal static readonly DependencyProperty CurrentHorizontalOffsetProperty = DependencyProperty.Register(
"CurrentHorizontalOffset", typeof(double), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.Double0Box, OnCurrentHorizontalOffsetChanged)); nameof(CurrentHorizontalOffset), typeof(double), typeof(ScrollViewer), new PropertyMetadata(ValueBoxes.Double0Box, OnCurrentHorizontalOffsetChanged));
private static void OnCurrentHorizontalOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnCurrentHorizontalOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -9,7 +9,7 @@ namespace HandyControl.Controls;
public class Shield : ButtonBase public class Shield : ButtonBase
{ {
public static readonly DependencyProperty SubjectProperty = DependencyProperty.Register( public static readonly DependencyProperty SubjectProperty = DependencyProperty.Register(
"Subject", typeof(string), typeof(Shield), new PropertyMetadata(default(string))); nameof(Subject), typeof(string), typeof(Shield), new PropertyMetadata(default(string)));
public string Subject public string Subject
{ {
@@ -18,7 +18,7 @@ public class Shield : ButtonBase
} }
public static readonly DependencyProperty StatusProperty = DependencyProperty.Register( public static readonly DependencyProperty StatusProperty = DependencyProperty.Register(
"Status", typeof(object), typeof(Shield), new PropertyMetadata(default(object))); nameof(Status), typeof(object), typeof(Shield), new PropertyMetadata(default(object)));
public object Status public object Status
{ {
@@ -27,7 +27,7 @@ public class Shield : ButtonBase
} }
public static readonly DependencyProperty ColorProperty = DependencyProperty.Register( public static readonly DependencyProperty ColorProperty = DependencyProperty.Register(
"Color", typeof(Brush), typeof(Shield), new PropertyMetadata(default(Brush))); nameof(Color), typeof(Brush), typeof(Shield), new PropertyMetadata(default(Brush)));
public Brush Color public Brush Color
{ {
@@ -22,7 +22,7 @@ public class TransitioningContentControl : ContentControl
} }
public static readonly DependencyProperty TransitionModeProperty = DependencyProperty.Register( public static readonly DependencyProperty TransitionModeProperty = DependencyProperty.Register(
"TransitionMode", typeof(TransitionMode), typeof(TransitioningContentControl), new PropertyMetadata(default(TransitionMode), OnTransitionModeChanged)); nameof(TransitionMode), typeof(TransitionMode), typeof(TransitioningContentControl), new PropertyMetadata(default(TransitionMode), OnTransitionModeChanged));
private static void OnTransitionModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnTransitionModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -43,7 +43,7 @@ public class TransitioningContentControl : ContentControl
} }
public static readonly DependencyProperty TransitionStoryboardProperty = DependencyProperty.Register( public static readonly DependencyProperty TransitionStoryboardProperty = DependencyProperty.Register(
"TransitionStoryboard", typeof(Storyboard), typeof(TransitioningContentControl), new PropertyMetadata(default(Storyboard))); nameof(TransitionStoryboard), typeof(Storyboard), typeof(TransitioningContentControl), new PropertyMetadata(default(Storyboard)));
public Storyboard TransitionStoryboard public Storyboard TransitionStoryboard
{ {
@@ -18,7 +18,7 @@ public class Watermark : Control
private DrawingBrush _brush; private DrawingBrush _brush;
public static readonly DependencyProperty AngleProperty = DependencyProperty.Register( public static readonly DependencyProperty AngleProperty = DependencyProperty.Register(
"Angle", typeof(double), typeof(Watermark), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(Angle), typeof(double), typeof(Watermark), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender));
public double Angle public double Angle
{ {
@@ -27,7 +27,7 @@ public class Watermark : Control
} }
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
"Content", typeof(object), typeof(Watermark), new PropertyMetadata(default)); nameof(Content), typeof(object), typeof(Watermark), new PropertyMetadata(default));
public object Content public object Content
{ {
@@ -36,7 +36,7 @@ public class Watermark : Control
} }
public static readonly DependencyProperty MarkProperty = DependencyProperty.Register( public static readonly DependencyProperty MarkProperty = DependencyProperty.Register(
"Mark", typeof(object), typeof(Watermark), new FrameworkPropertyMetadata(default, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(Mark), typeof(object), typeof(Watermark), new FrameworkPropertyMetadata(default, FrameworkPropertyMetadataOptions.AffectsRender));
public object Mark public object Mark
{ {
@@ -45,7 +45,7 @@ public class Watermark : Control
} }
public static readonly DependencyProperty MarkWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty MarkWidthProperty = DependencyProperty.Register(
"MarkWidth", typeof(double), typeof(Watermark), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(MarkWidth), typeof(double), typeof(Watermark), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender));
public double MarkWidth public double MarkWidth
{ {
@@ -54,7 +54,7 @@ public class Watermark : Control
} }
public static readonly DependencyProperty MarkHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty MarkHeightProperty = DependencyProperty.Register(
"MarkHeight", typeof(double), typeof(Watermark), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(MarkHeight), typeof(double), typeof(Watermark), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsRender));
public double MarkHeight public double MarkHeight
{ {
@@ -63,7 +63,7 @@ public class Watermark : Control
} }
public static readonly DependencyProperty MarkBrushProperty = DependencyProperty.Register( public static readonly DependencyProperty MarkBrushProperty = DependencyProperty.Register(
"MarkBrush", typeof(Brush), typeof(Watermark), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.AffectsRender)); nameof(MarkBrush), typeof(Brush), typeof(Watermark), new FrameworkPropertyMetadata(default(Brush), FrameworkPropertyMetadataOptions.AffectsRender));
public Brush MarkBrush public Brush MarkBrush
{ {
@@ -72,7 +72,7 @@ public class Watermark : Control
} }
public static readonly DependencyProperty AutoSizeEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoSizeEnabledProperty = DependencyProperty.Register(
"AutoSizeEnabled", typeof(bool), typeof(Watermark), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.AffectsRender)); nameof(AutoSizeEnabled), typeof(bool), typeof(Watermark), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.AffectsRender));
public bool AutoSizeEnabled public bool AutoSizeEnabled
{ {
@@ -81,7 +81,7 @@ public class Watermark : Control
} }
public static readonly DependencyProperty MarkMarginProperty = DependencyProperty.Register( public static readonly DependencyProperty MarkMarginProperty = DependencyProperty.Register(
"MarkMargin", typeof(Thickness), typeof(Watermark), new FrameworkPropertyMetadata(default(Thickness), FrameworkPropertyMetadataOptions.AffectsRender)); nameof(MarkMargin), typeof(Thickness), typeof(Watermark), new FrameworkPropertyMetadata(default(Thickness), FrameworkPropertyMetadataOptions.AffectsRender));
public Thickness MarkMargin public Thickness MarkMargin
{ {
@@ -6,7 +6,7 @@ namespace HandyControl.Controls;
public class AxleCanvas : Canvas public class AxleCanvas : Canvas
{ {
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(AxleCanvas), new PropertyMetadata(default(Orientation))); nameof(Orientation), typeof(Orientation), typeof(AxleCanvas), new PropertyMetadata(default(Orientation)));
public Orientation Orientation public Orientation Orientation
{ {
@@ -9,7 +9,7 @@ namespace HandyControl.Controls;
public class CirclePanel : Panel public class CirclePanel : Panel
{ {
public static readonly DependencyProperty DiameterProperty = DependencyProperty.Register( public static readonly DependencyProperty DiameterProperty = DependencyProperty.Register(
"Diameter", typeof(double), typeof(CirclePanel), new FrameworkPropertyMetadata(170.0, FrameworkPropertyMetadataOptions.AffectsMeasure)); nameof(Diameter), typeof(double), typeof(CirclePanel), new FrameworkPropertyMetadata(170.0, FrameworkPropertyMetadataOptions.AffectsMeasure));
public double Diameter public double Diameter
{ {
@@ -18,7 +18,7 @@ public class CirclePanel : Panel
} }
public static readonly DependencyProperty KeepVerticalProperty = DependencyProperty.Register( public static readonly DependencyProperty KeepVerticalProperty = DependencyProperty.Register(
"KeepVertical", typeof(bool), typeof(CirclePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsMeasure)); nameof(KeepVertical), typeof(bool), typeof(CirclePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsMeasure));
public bool KeepVertical public bool KeepVertical
{ {
@@ -27,7 +27,7 @@ public class CirclePanel : Panel
} }
public static readonly DependencyProperty OffsetAngleProperty = DependencyProperty.Register( public static readonly DependencyProperty OffsetAngleProperty = DependencyProperty.Register(
"OffsetAngle", typeof(double), typeof(CirclePanel), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure)); nameof(OffsetAngle), typeof(double), typeof(CirclePanel), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
public double OffsetAngle public double OffsetAngle
{ {
@@ -8,7 +8,7 @@ namespace HandyControl.Controls
public class ClipGrid : Grid public class ClipGrid : Grid
{ {
public static readonly DependencyProperty IsClipEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsClipEnabledProperty = DependencyProperty.Register(
"IsClipEnabled", typeof(bool), typeof(ClipGrid), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(IsClipEnabled), typeof(bool), typeof(ClipGrid), new PropertyMetadata(ValueBoxes.TrueBox));
public bool IsClipEnabled public bool IsClipEnabled
{ {
@@ -24,7 +24,7 @@ public class ElementGroup : ItemsControl
} }
public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register( public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register(
"Layout", typeof(LinearLayout), typeof(ElementGroup), nameof(Layout), typeof(LinearLayout), typeof(ElementGroup),
new FrameworkPropertyMetadata(LinearLayout.Uniform, FrameworkPropertyMetadataOptions.AffectsMeasure)); new FrameworkPropertyMetadata(LinearLayout.Uniform, FrameworkPropertyMetadataOptions.AffectsMeasure));
public LinearLayout Layout public LinearLayout Layout
@@ -77,7 +77,7 @@ public class FlexPanel : Panel
=> (FlexItemAlignment) element.GetValue(AlignSelfProperty); => (FlexItemAlignment) element.GetValue(AlignSelfProperty);
public static readonly DependencyProperty FlexDirectionProperty = DependencyProperty.Register( public static readonly DependencyProperty FlexDirectionProperty = DependencyProperty.Register(
"FlexDirection", typeof(FlexDirection), typeof(FlexPanel), nameof(FlexDirection), typeof(FlexDirection), typeof(FlexPanel),
new FrameworkPropertyMetadata(default(FlexDirection), FrameworkPropertyMetadataOptions.AffectsMeasure)); new FrameworkPropertyMetadata(default(FlexDirection), FrameworkPropertyMetadataOptions.AffectsMeasure));
public FlexDirection FlexDirection public FlexDirection FlexDirection
@@ -87,7 +87,7 @@ public class FlexPanel : Panel
} }
public static readonly DependencyProperty FlexWrapProperty = DependencyProperty.Register( public static readonly DependencyProperty FlexWrapProperty = DependencyProperty.Register(
"FlexWrap", typeof(FlexWrap), typeof(FlexPanel), nameof(FlexWrap), typeof(FlexWrap), typeof(FlexPanel),
new FrameworkPropertyMetadata(default(FlexWrap), FrameworkPropertyMetadataOptions.AffectsMeasure)); new FrameworkPropertyMetadata(default(FlexWrap), FrameworkPropertyMetadataOptions.AffectsMeasure));
public FlexWrap FlexWrap public FlexWrap FlexWrap
@@ -97,7 +97,7 @@ public class FlexPanel : Panel
} }
public static readonly DependencyProperty JustifyContentProperty = DependencyProperty.Register( public static readonly DependencyProperty JustifyContentProperty = DependencyProperty.Register(
"JustifyContent", typeof(FlexContentJustify), typeof(FlexPanel), nameof(JustifyContent), typeof(FlexContentJustify), typeof(FlexPanel),
new FrameworkPropertyMetadata(default(FlexContentJustify), new FrameworkPropertyMetadata(default(FlexContentJustify),
FrameworkPropertyMetadataOptions.AffectsMeasure)); FrameworkPropertyMetadataOptions.AffectsMeasure));
@@ -108,7 +108,7 @@ public class FlexPanel : Panel
} }
public static readonly DependencyProperty AlignItemsProperty = DependencyProperty.Register( public static readonly DependencyProperty AlignItemsProperty = DependencyProperty.Register(
"AlignItems", typeof(FlexItemsAlignment), typeof(FlexPanel), nameof(AlignItems), typeof(FlexItemsAlignment), typeof(FlexPanel),
new FrameworkPropertyMetadata(default(FlexItemsAlignment), new FrameworkPropertyMetadata(default(FlexItemsAlignment),
FrameworkPropertyMetadataOptions.AffectsMeasure)); FrameworkPropertyMetadataOptions.AffectsMeasure));
@@ -119,7 +119,7 @@ public class FlexPanel : Panel
} }
public static readonly DependencyProperty AlignContentProperty = DependencyProperty.Register( public static readonly DependencyProperty AlignContentProperty = DependencyProperty.Register(
"AlignContent", typeof(FlexContentAlignment), typeof(FlexPanel), nameof(AlignContent), typeof(FlexContentAlignment), typeof(FlexPanel),
new FrameworkPropertyMetadata(default(FlexContentAlignment), new FrameworkPropertyMetadata(default(FlexContentAlignment),
FrameworkPropertyMetadataOptions.AffectsMeasure)); FrameworkPropertyMetadataOptions.AffectsMeasure));
@@ -9,7 +9,7 @@ namespace HandyControl.Controls;
public class Col : ContentControl public class Col : ContentControl
{ {
public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register( public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register(
"Layout", typeof(ColLayout), typeof(Col), new PropertyMetadata(default(ColLayout))); nameof(Layout), typeof(ColLayout), typeof(Col), new PropertyMetadata(default(ColLayout)));
public ColLayout Layout public ColLayout Layout
{ {
@@ -18,7 +18,7 @@ public class Col : ContentControl
} }
public static readonly DependencyProperty OffsetProperty = DependencyProperty.Register( public static readonly DependencyProperty OffsetProperty = DependencyProperty.Register(
"Offset", typeof(int), typeof(Col), new PropertyMetadata(ValueBoxes.Int0Box)); nameof(Offset), typeof(int), typeof(Col), new PropertyMetadata(ValueBoxes.Int0Box));
public int Offset public int Offset
{ {
@@ -27,7 +27,7 @@ public class Col : ContentControl
} }
public static readonly DependencyProperty SpanProperty = DependencyProperty.Register( public static readonly DependencyProperty SpanProperty = DependencyProperty.Register(
"Span", typeof(int), typeof(Col), new PropertyMetadata(24), OnSpanValidate); nameof(Span), typeof(int), typeof(Col), new PropertyMetadata(24), OnSpanValidate);
private static bool OnSpanValidate(object value) private static bool OnSpanValidate(object value)
{ {
@@ -42,7 +42,7 @@ public class Col : ContentControl
} }
public static readonly DependencyProperty IsFixedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsFixedProperty = DependencyProperty.Register(
"IsFixed", typeof(bool), typeof(Col), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsFixed), typeof(bool), typeof(Col), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsFixed public bool IsFixed
{ {
@@ -17,7 +17,7 @@ public class Row : Panel
private double _totalAutoWidth; private double _totalAutoWidth;
public static readonly DependencyProperty GutterProperty = DependencyProperty.Register( public static readonly DependencyProperty GutterProperty = DependencyProperty.Register(
"Gutter", typeof(double), typeof(Row), new PropertyMetadata(ValueBoxes.Double0Box, null, OnGutterCoerce), ValidateHelper.IsInRangeOfPosDoubleIncludeZero); nameof(Gutter), typeof(double), typeof(Row), new PropertyMetadata(ValueBoxes.Double0Box, null, OnGutterCoerce), ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
private static object OnGutterCoerce(DependencyObject d, object basevalue) => ValidateHelper.IsInRangeOfPosDoubleIncludeZero(basevalue) ? basevalue : .0; private static object OnGutterCoerce(DependencyObject d, object basevalue) => ValidateHelper.IsInRangeOfPosDoubleIncludeZero(basevalue) ? basevalue : .0;
@@ -33,7 +33,7 @@ public class UniformSpacingPanel : Panel
} }
public static readonly DependencyProperty ChildWrappingProperty = DependencyProperty.Register( public static readonly DependencyProperty ChildWrappingProperty = DependencyProperty.Register(
"ChildWrapping", typeof(VisualWrapping), typeof(UniformSpacingPanel), nameof(ChildWrapping), typeof(VisualWrapping), typeof(UniformSpacingPanel),
new FrameworkPropertyMetadata(default(VisualWrapping), FrameworkPropertyMetadataOptions.AffectsMeasure)); new FrameworkPropertyMetadata(default(VisualWrapping), FrameworkPropertyMetadataOptions.AffectsMeasure));
public VisualWrapping ChildWrapping public VisualWrapping ChildWrapping
@@ -43,7 +43,7 @@ public class UniformSpacingPanel : Panel
} }
public static readonly DependencyProperty SpacingProperty = DependencyProperty.Register( public static readonly DependencyProperty SpacingProperty = DependencyProperty.Register(
"Spacing", typeof(double), typeof(UniformSpacingPanel), nameof(Spacing), typeof(double), typeof(UniformSpacingPanel),
new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), IsSpacingValid); new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), IsSpacingValid);
public double Spacing public double Spacing
@@ -53,7 +53,7 @@ public class UniformSpacingPanel : Panel
} }
public static readonly DependencyProperty HorizontalSpacingProperty = DependencyProperty.Register( public static readonly DependencyProperty HorizontalSpacingProperty = DependencyProperty.Register(
"HorizontalSpacing", typeof(double), typeof(UniformSpacingPanel), nameof(HorizontalSpacing), typeof(double), typeof(UniformSpacingPanel),
new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), IsSpacingValid); new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), IsSpacingValid);
public double HorizontalSpacing public double HorizontalSpacing
@@ -63,7 +63,7 @@ public class UniformSpacingPanel : Panel
} }
public static readonly DependencyProperty VerticalSpacingProperty = DependencyProperty.Register( public static readonly DependencyProperty VerticalSpacingProperty = DependencyProperty.Register(
"VerticalSpacing", typeof(double), typeof(UniformSpacingPanel), nameof(VerticalSpacing), typeof(double), typeof(UniformSpacingPanel),
new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), IsSpacingValid); new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), IsSpacingValid);
public double VerticalSpacing public double VerticalSpacing
@@ -73,7 +73,7 @@ public class UniformSpacingPanel : Panel
} }
public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register(
"ItemWidth", typeof(double), typeof(UniformSpacingPanel), nameof(ItemWidth), typeof(double), typeof(UniformSpacingPanel),
new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure),
IsWidthHeightValid); IsWidthHeightValid);
@@ -85,7 +85,7 @@ public class UniformSpacingPanel : Panel
} }
public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register(
"ItemHeight", typeof(double), typeof(UniformSpacingPanel), nameof(ItemHeight), typeof(double), typeof(UniformSpacingPanel),
new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure),
IsWidthHeightValid); IsWidthHeightValid);
@@ -97,7 +97,7 @@ public class UniformSpacingPanel : Panel
} }
public static readonly DependencyProperty ItemHorizontalAlignmentProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemHorizontalAlignmentProperty = DependencyProperty.Register(
"ItemHorizontalAlignment", typeof(HorizontalAlignment?), typeof(UniformSpacingPanel), nameof(ItemHorizontalAlignment), typeof(HorizontalAlignment?), typeof(UniformSpacingPanel),
new FrameworkPropertyMetadata(HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsMeasure)); new FrameworkPropertyMetadata(HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsMeasure));
public HorizontalAlignment? ItemHorizontalAlignment public HorizontalAlignment? ItemHorizontalAlignment
@@ -107,7 +107,7 @@ public class UniformSpacingPanel : Panel
} }
public static readonly DependencyProperty ItemVerticalAlignmentProperty = DependencyProperty.Register( public static readonly DependencyProperty ItemVerticalAlignmentProperty = DependencyProperty.Register(
"ItemVerticalAlignment", typeof(VerticalAlignment?), typeof(UniformSpacingPanel), nameof(ItemVerticalAlignment), typeof(VerticalAlignment?), typeof(UniformSpacingPanel),
new FrameworkPropertyMetadata(VerticalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsMeasure)); new FrameworkPropertyMetadata(VerticalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsMeasure));
public VerticalAlignment? ItemVerticalAlignment public VerticalAlignment? ItemVerticalAlignment
@@ -10,7 +10,7 @@ namespace HandyControl.Controls;
public class WaterfallPanel : Panel public class WaterfallPanel : Panel
{ {
public static readonly DependencyProperty GroupsProperty = DependencyProperty.Register( public static readonly DependencyProperty GroupsProperty = DependencyProperty.Register(
"Groups", typeof(int), typeof(WaterfallPanel), new FrameworkPropertyMetadata( nameof(Groups), typeof(int), typeof(WaterfallPanel), new FrameworkPropertyMetadata(
ValueBoxes.Int2Box, FrameworkPropertyMetadataOptions.AffectsMeasure), IsGroupsValid); ValueBoxes.Int2Box, FrameworkPropertyMetadataOptions.AffectsMeasure), IsGroupsValid);
public int Groups public int Groups
@@ -22,7 +22,7 @@ public class WaterfallPanel : Panel
private static bool IsGroupsValid(object value) => (int) value >= 1; private static bool IsGroupsValid(object value) => (int) value >= 1;
public static readonly DependencyProperty AutoGroupProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoGroupProperty = DependencyProperty.Register(
"AutoGroup", typeof(bool), typeof(WaterfallPanel), new FrameworkPropertyMetadata( nameof(AutoGroup), typeof(bool), typeof(WaterfallPanel), new FrameworkPropertyMetadata(
ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsMeasure)); ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsMeasure));
public bool AutoGroup public bool AutoGroup
@@ -32,7 +32,7 @@ public class WaterfallPanel : Panel
} }
public static readonly DependencyProperty DesiredLengthProperty = DependencyProperty.Register( public static readonly DependencyProperty DesiredLengthProperty = DependencyProperty.Register(
"DesiredLength", typeof(double), typeof(WaterfallPanel), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, nameof(DesiredLength), typeof(double), typeof(WaterfallPanel), new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.AffectsMeasure), ValidateHelper.IsInRangeOfPosDoubleIncludeZero); FrameworkPropertyMetadataOptions.AffectsMeasure), ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double DesiredLength public double DesiredLength
@@ -12,13 +12,13 @@ public class CircleProgressBar : RangeBase
private const string IndicatorTemplateName = "PART_Indicator"; private const string IndicatorTemplateName = "PART_Indicator";
public static readonly DependencyProperty ArcThicknessProperty = DependencyProperty.Register( public static readonly DependencyProperty ArcThicknessProperty = DependencyProperty.Register(
"ArcThickness", typeof(double), typeof(CircleProgressBar), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(ArcThickness), typeof(double), typeof(CircleProgressBar), new PropertyMetadata(ValueBoxes.Double0Box));
public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register(
"ShowText", typeof(bool), typeof(CircleProgressBar), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowText), typeof(bool), typeof(CircleProgressBar), new PropertyMetadata(ValueBoxes.TrueBox));
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(CircleProgressBar), new PropertyMetadata(default(string))); nameof(Text), typeof(string), typeof(CircleProgressBar), new PropertyMetadata(default(string)));
public static readonly DependencyProperty IsIndeterminateProperty = public static readonly DependencyProperty IsIndeterminateProperty =
ProgressBar.IsIndeterminateProperty.AddOwner(typeof(CircleProgressBar), ProgressBar.IsIndeterminateProperty.AddOwner(typeof(CircleProgressBar),
@@ -75,7 +75,7 @@ public class WaveProgressBar : RangeBase
} }
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(WaveProgressBar), new PropertyMetadata(default(string))); nameof(Text), typeof(string), typeof(WaveProgressBar), new PropertyMetadata(default(string)));
public string Text public string Text
{ {
@@ -84,7 +84,7 @@ public class WaveProgressBar : RangeBase
} }
public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register(
"ShowText", typeof(bool), typeof(WaveProgressBar), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowText), typeof(bool), typeof(WaveProgressBar), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowText public bool ShowText
{ {
@@ -93,7 +93,7 @@ public class WaveProgressBar : RangeBase
} }
public static readonly DependencyProperty WaveFillProperty = DependencyProperty.Register( public static readonly DependencyProperty WaveFillProperty = DependencyProperty.Register(
"WaveFill", typeof(Brush), typeof(WaveProgressBar), new PropertyMetadata(default(Brush))); nameof(WaveFill), typeof(Brush), typeof(WaveProgressBar), new PropertyMetadata(default(Brush)));
public Brush WaveFill public Brush WaveFill
{ {
@@ -102,7 +102,7 @@ public class WaveProgressBar : RangeBase
} }
public static readonly DependencyProperty WaveThicknessProperty = DependencyProperty.Register( public static readonly DependencyProperty WaveThicknessProperty = DependencyProperty.Register(
"WaveThickness", typeof(double), typeof(WaveProgressBar), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(WaveThickness), typeof(double), typeof(WaveProgressBar), new PropertyMetadata(ValueBoxes.Double0Box));
public double WaveThickness public double WaveThickness
{ {
@@ -111,7 +111,7 @@ public class WaveProgressBar : RangeBase
} }
public static readonly DependencyProperty WaveStrokeProperty = DependencyProperty.Register( public static readonly DependencyProperty WaveStrokeProperty = DependencyProperty.Register(
"WaveStroke", typeof(Brush), typeof(WaveProgressBar), new PropertyMetadata(default(Brush))); nameof(WaveStroke), typeof(Brush), typeof(WaveProgressBar), new PropertyMetadata(default(Brush)));
public Brush WaveStroke public Brush WaveStroke
{ {
@@ -28,7 +28,7 @@ public class ImagePropertyEditor : PropertyEditorBase
} }
internal static readonly DependencyProperty UriProperty = DependencyProperty.Register( internal static readonly DependencyProperty UriProperty = DependencyProperty.Register(
"Uri", typeof(Uri), typeof(ImagePropertyEditor), new PropertyMetadata(default(Uri), OnUriChangedCallback)); nameof(Uri), typeof(Uri), typeof(ImagePropertyEditor), new PropertyMetadata(default(Uri), OnUriChangedCallback));
private static void OnUriChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) => private static void OnUriChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
((ImagePropertyEditor) d).Source = e.NewValue is Uri uri ? BitmapFrame.Create(uri) : null; ((ImagePropertyEditor) d).Source = e.NewValue is Uri uri ? BitmapFrame.Create(uri) : null;
@@ -40,7 +40,7 @@ public class ImagePropertyEditor : PropertyEditorBase
} }
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(ImageSource), typeof(ImagePropertyEditor), new PropertyMetadata(default(ImageSource))); nameof(Source), typeof(ImageSource), typeof(ImagePropertyEditor), new PropertyMetadata(default(ImageSource)));
public ImageSource Source public ImageSource Source
{ {
@@ -46,7 +46,7 @@ public class PropertyGrid : Control
} }
public static readonly DependencyProperty SelectedObjectProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectedObjectProperty = DependencyProperty.Register(
"SelectedObject", typeof(object), typeof(PropertyGrid), new PropertyMetadata(default, OnSelectedObjectChanged)); nameof(SelectedObject), typeof(object), typeof(PropertyGrid), new PropertyMetadata(default, OnSelectedObjectChanged));
private static void OnSelectedObjectChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnSelectedObjectChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -67,7 +67,7 @@ public class PropertyGrid : Control
} }
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register(
"Description", typeof(string), typeof(PropertyGrid), new PropertyMetadata(default(string))); nameof(Description), typeof(string), typeof(PropertyGrid), new PropertyMetadata(default(string)));
public string Description public string Description
{ {
@@ -76,7 +76,7 @@ public class PropertyGrid : Control
} }
public static readonly DependencyProperty MaxTitleWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty MaxTitleWidthProperty = DependencyProperty.Register(
"MaxTitleWidth", typeof(double), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(MaxTitleWidth), typeof(double), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.Double0Box));
public double MaxTitleWidth public double MaxTitleWidth
{ {
@@ -85,7 +85,7 @@ public class PropertyGrid : Control
} }
public static readonly DependencyProperty MinTitleWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty MinTitleWidthProperty = DependencyProperty.Register(
"MinTitleWidth", typeof(double), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(MinTitleWidth), typeof(double), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.Double0Box));
public double MinTitleWidth public double MinTitleWidth
{ {
@@ -94,7 +94,7 @@ public class PropertyGrid : Control
} }
public static readonly DependencyProperty ShowSortButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowSortButtonProperty = DependencyProperty.Register(
"ShowSortButton", typeof(bool), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowSortButton), typeof(bool), typeof(PropertyGrid), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowSortButton public bool ShowSortButton
{ {
@@ -9,7 +9,7 @@ namespace HandyControl.Controls;
public class PropertyItem : ListBoxItem public class PropertyItem : ListBoxItem
{ {
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value", typeof(object), typeof(PropertyItem), new PropertyMetadata(default(object))); nameof(Value), typeof(object), typeof(PropertyItem), new PropertyMetadata(default(object)));
public object Value public object Value
{ {
@@ -18,7 +18,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty DisplayNameProperty = DependencyProperty.Register( public static readonly DependencyProperty DisplayNameProperty = DependencyProperty.Register(
"DisplayName", typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string))); nameof(DisplayName), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string DisplayName public string DisplayName
{ {
@@ -27,7 +27,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty PropertyNameProperty = DependencyProperty.Register( public static readonly DependencyProperty PropertyNameProperty = DependencyProperty.Register(
"PropertyName", typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string))); nameof(PropertyName), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string PropertyName public string PropertyName
{ {
@@ -36,7 +36,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty PropertyTypeProperty = DependencyProperty.Register( public static readonly DependencyProperty PropertyTypeProperty = DependencyProperty.Register(
"PropertyType", typeof(Type), typeof(PropertyItem), new PropertyMetadata(default(Type))); nameof(PropertyType), typeof(Type), typeof(PropertyItem), new PropertyMetadata(default(Type)));
public Type PropertyType public Type PropertyType
{ {
@@ -45,7 +45,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty PropertyTypeNameProperty = DependencyProperty.Register( public static readonly DependencyProperty PropertyTypeNameProperty = DependencyProperty.Register(
"PropertyTypeName", typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string))); nameof(PropertyTypeName), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string PropertyTypeName public string PropertyTypeName
{ {
@@ -54,7 +54,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register(
"Description", typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string))); nameof(Description), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string Description public string Description
{ {
@@ -63,7 +63,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register( public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
"IsReadOnly", typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsReadOnly), typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsReadOnly public bool IsReadOnly
{ {
@@ -72,7 +72,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register( public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register(
"DefaultValue", typeof(object), typeof(PropertyItem), new PropertyMetadata(default(object))); nameof(DefaultValue), typeof(object), typeof(PropertyItem), new PropertyMetadata(default(object)));
public object DefaultValue public object DefaultValue
{ {
@@ -81,7 +81,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty CategoryProperty = DependencyProperty.Register( public static readonly DependencyProperty CategoryProperty = DependencyProperty.Register(
"Category", typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string))); nameof(Category), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string Category public string Category
{ {
@@ -90,7 +90,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty EditorProperty = DependencyProperty.Register( public static readonly DependencyProperty EditorProperty = DependencyProperty.Register(
"Editor", typeof(PropertyEditorBase), typeof(PropertyItem), new PropertyMetadata(default(PropertyEditorBase))); nameof(Editor), typeof(PropertyEditorBase), typeof(PropertyItem), new PropertyMetadata(default(PropertyEditorBase)));
public PropertyEditorBase Editor public PropertyEditorBase Editor
{ {
@@ -99,7 +99,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty EditorElementProperty = DependencyProperty.Register( public static readonly DependencyProperty EditorElementProperty = DependencyProperty.Register(
"EditorElement", typeof(FrameworkElement), typeof(PropertyItem), new PropertyMetadata(default(FrameworkElement))); nameof(EditorElement), typeof(FrameworkElement), typeof(PropertyItem), new PropertyMetadata(default(FrameworkElement)));
public FrameworkElement EditorElement public FrameworkElement EditorElement
{ {
@@ -108,7 +108,7 @@ public class PropertyItem : ListBoxItem
} }
public static readonly DependencyProperty IsExpandedEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsExpandedEnabledProperty = DependencyProperty.Register(
"IsExpandedEnabled", typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsExpandedEnabled), typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsExpandedEnabled public bool IsExpandedEnabled
{ {
@@ -17,22 +17,22 @@ public class Rate : RegularItemsControl
} }
public static readonly DependencyProperty AllowHalfProperty = DependencyProperty.Register( public static readonly DependencyProperty AllowHalfProperty = DependencyProperty.Register(
"AllowHalf", typeof(bool), typeof(Rate), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits)); nameof(AllowHalf), typeof(bool), typeof(Rate), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits));
public static readonly DependencyProperty AllowClearProperty = DependencyProperty.Register( public static readonly DependencyProperty AllowClearProperty = DependencyProperty.Register(
"AllowClear", typeof(bool), typeof(Rate), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits)); nameof(AllowClear), typeof(bool), typeof(Rate), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits));
public static readonly DependencyProperty IconProperty = DependencyProperty.Register( public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
"Icon", typeof(Geometry), typeof(Rate), new FrameworkPropertyMetadata(default(Geometry), FrameworkPropertyMetadataOptions.Inherits)); nameof(Icon), typeof(Geometry), typeof(Rate), new FrameworkPropertyMetadata(default(Geometry), FrameworkPropertyMetadataOptions.Inherits));
public static readonly DependencyProperty CountProperty = DependencyProperty.Register( public static readonly DependencyProperty CountProperty = DependencyProperty.Register(
"Count", typeof(int), typeof(Rate), new PropertyMetadata(ValueBoxes.Int5Box)); nameof(Count), typeof(int), typeof(Rate), new PropertyMetadata(ValueBoxes.Int5Box));
public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register( public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register(
"DefaultValue", typeof(double), typeof(Rate), new PropertyMetadata(ValueBoxes.Double0Box)); nameof(DefaultValue), typeof(double), typeof(Rate), new PropertyMetadata(ValueBoxes.Double0Box));
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value", typeof(double), typeof(Rate), new PropertyMetadata(ValueBoxes.Double0Box, OnValueChanged)); nameof(Value), typeof(double), typeof(Rate), new PropertyMetadata(ValueBoxes.Double0Box, OnValueChanged));
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
((Rate) d).OnValueChanged(new FunctionEventArgs<double>(ValueChangedEvent, d) ((Rate) d).OnValueChanged(new FunctionEventArgs<double>(ValueChangedEvent, d)
@@ -47,13 +47,13 @@ public class Rate : RegularItemsControl
} }
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(Rate), new PropertyMetadata(default(string))); nameof(Text), typeof(string), typeof(Rate), new PropertyMetadata(default(string)));
public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowTextProperty = DependencyProperty.Register(
"ShowText", typeof(bool), typeof(Rate), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowText), typeof(bool), typeof(Rate), new PropertyMetadata(ValueBoxes.FalseBox));
public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register( public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
"IsReadOnly", typeof(bool), typeof(Rate), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsReadOnly), typeof(bool), typeof(Rate), new PropertyMetadata(ValueBoxes.FalseBox));
private bool _isLoaded; private bool _isLoaded;
@@ -23,7 +23,7 @@ public class RateItem : Control
public static readonly DependencyProperty IsReadOnlyProperty = Rate.IsReadOnlyProperty.AddOwner(typeof(RateItem)); public static readonly DependencyProperty IsReadOnlyProperty = Rate.IsReadOnlyProperty.AddOwner(typeof(RateItem));
internal static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( internal static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
"IsSelected", typeof(bool), typeof(RateItem), nameof(IsSelected), typeof(bool), typeof(RateItem),
new PropertyMetadata(ValueBoxes.FalseBox, OnIsSelectedChanged)); new PropertyMetadata(ValueBoxes.FalseBox, OnIsSelectedChanged));
public static readonly RoutedEvent SelectedChangedEvent = public static readonly RoutedEvent SelectedChangedEvent =
@@ -59,7 +59,7 @@ namespace HandyControl.Controls
=> (Ribbon) element.GetValue(RibbonProperty); => (Ribbon) element.GetValue(RibbonProperty);
public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register( public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register(
"IsDropDownOpen", typeof(bool), typeof(Ribbon), new PropertyMetadata(ValueBoxes.TrueBox, OnIsDropDownOpenChanged)); nameof(IsDropDownOpen), typeof(bool), typeof(Ribbon), new PropertyMetadata(ValueBoxes.TrueBox, OnIsDropDownOpenChanged));
private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIsDropDownOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -84,7 +84,7 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty IsMinimizedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsMinimizedProperty = DependencyProperty.Register(
"IsMinimized", typeof(bool), typeof(Ribbon), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsMinimized), typeof(bool), typeof(Ribbon), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsMinimized public bool IsMinimized
{ {
@@ -93,7 +93,7 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty ContentHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentHeightProperty = DependencyProperty.Register(
"ContentHeight", typeof(double), typeof(Ribbon), new PropertyMetadata(default(double))); nameof(ContentHeight), typeof(double), typeof(Ribbon), new PropertyMetadata(default(double)));
public double ContentHeight public double ContentHeight
{ {
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty PrefixContentProperty = DependencyProperty.Register( public static readonly DependencyProperty PrefixContentProperty = DependencyProperty.Register(
"PrefixContent", typeof(object), typeof(Ribbon), new PropertyMetadata(default(object))); nameof(PrefixContent), typeof(object), typeof(Ribbon), new PropertyMetadata(default(object)));
public object PrefixContent public object PrefixContent
{ {
@@ -111,7 +111,7 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty PostfixContentProperty = DependencyProperty.Register( public static readonly DependencyProperty PostfixContentProperty = DependencyProperty.Register(
"PostfixContent", typeof(object), typeof(Ribbon), new PropertyMetadata(default(object))); nameof(PostfixContent), typeof(object), typeof(Ribbon), new PropertyMetadata(default(object)));
public object PostfixContent public object PostfixContent
{ {
@@ -19,7 +19,7 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty ShowLauncherButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowLauncherButtonProperty = DependencyProperty.Register(
"ShowLauncherButton", typeof(bool), typeof(RibbonGroup), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowLauncherButton), typeof(bool), typeof(RibbonGroup), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowLauncherButton public bool ShowLauncherButton
{ {
@@ -28,7 +28,7 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty ShowSplitterProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowSplitterProperty = DependencyProperty.Register(
"ShowSplitter", typeof(bool), typeof(RibbonGroup), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowSplitter), typeof(bool), typeof(RibbonGroup), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowSplitter public bool ShowSplitter
{ {
@@ -37,7 +37,7 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty LauncherPoptipProperty = DependencyProperty.Register( public static readonly DependencyProperty LauncherPoptipProperty = DependencyProperty.Register(
"LauncherPoptip", typeof(Poptip), typeof(RibbonGroup), new PropertyMetadata(default(Poptip))); nameof(LauncherPoptip), typeof(Poptip), typeof(RibbonGroup), new PropertyMetadata(default(Poptip)));
public Poptip LauncherPoptip public Poptip LauncherPoptip
{ {
@@ -31,7 +31,7 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
"IsSelected", typeof(bool), typeof(RibbonTabHeader), nameof(IsSelected), typeof(bool), typeof(RibbonTabHeader),
new PropertyMetadata(ValueBoxes.FalseBox, OnIsSelectedChanged, CoerceIsSelected)); new PropertyMetadata(ValueBoxes.FalseBox, OnIsSelectedChanged, CoerceIsSelected));
private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -120,7 +120,7 @@ public class ScreenshotWindow : System.Windows.Window
#region prop #region prop
public static readonly DependencyProperty IsDrawingProperty = DependencyProperty.Register( public static readonly DependencyProperty IsDrawingProperty = DependencyProperty.Register(
"IsDrawing", typeof(bool), typeof(ScreenshotWindow), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsDrawing), typeof(bool), typeof(ScreenshotWindow), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsDrawing public bool IsDrawing
{ {
@@ -129,7 +129,7 @@ public class ScreenshotWindow : System.Windows.Window
} }
public static readonly DependencyProperty IsSelectingProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSelectingProperty = DependencyProperty.Register(
"IsSelecting", typeof(bool), typeof(ScreenshotWindow), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsSelecting), typeof(bool), typeof(ScreenshotWindow), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsSelecting public bool IsSelecting
{ {
@@ -138,7 +138,7 @@ public class ScreenshotWindow : System.Windows.Window
} }
public static readonly DependencyProperty SizeProperty = DependencyProperty.Register( public static readonly DependencyProperty SizeProperty = DependencyProperty.Register(
"Size", typeof(Size), typeof(ScreenshotWindow), new PropertyMetadata(default(Size))); nameof(Size), typeof(Size), typeof(ScreenshotWindow), new PropertyMetadata(default(Size)));
public Size Size public Size Size
{ {
@@ -147,7 +147,7 @@ public class ScreenshotWindow : System.Windows.Window
} }
public static readonly DependencyProperty SizeStrProperty = DependencyProperty.Register( public static readonly DependencyProperty SizeStrProperty = DependencyProperty.Register(
"SizeStr", typeof(string), typeof(ScreenshotWindow), new PropertyMetadata(default(string))); nameof(SizeStr), typeof(string), typeof(ScreenshotWindow), new PropertyMetadata(default(string)));
public string SizeStr public string SizeStr
{ {
@@ -156,7 +156,7 @@ public class ScreenshotWindow : System.Windows.Window
} }
public static readonly DependencyProperty PixelColorProperty = DependencyProperty.Register( public static readonly DependencyProperty PixelColorProperty = DependencyProperty.Register(
"PixelColor", typeof(Color), typeof(ScreenshotWindow), new PropertyMetadata(default(Color))); nameof(PixelColor), typeof(Color), typeof(ScreenshotWindow), new PropertyMetadata(default(Color)));
public Color PixelColor public Color PixelColor
{ {
@@ -165,7 +165,7 @@ public class ScreenshotWindow : System.Windows.Window
} }
public static readonly DependencyProperty PixelColorStrProperty = DependencyProperty.Register( public static readonly DependencyProperty PixelColorStrProperty = DependencyProperty.Register(
"PixelColorStr", typeof(string), typeof(ScreenshotWindow), new PropertyMetadata(default(string))); nameof(PixelColorStr), typeof(string), typeof(ScreenshotWindow), new PropertyMetadata(default(string)));
public string PixelColorStr public string PixelColorStr
{ {
@@ -136,7 +136,7 @@ public class SideMenu : HeaderedSimpleItemsControl
protected override bool IsItemItsOwnContainerOverride(object item) => item is SideMenuItem; protected override bool IsItemItsOwnContainerOverride(object item) => item is SideMenuItem;
public static readonly DependencyProperty AutoSelectProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoSelectProperty = DependencyProperty.Register(
"AutoSelect", typeof(bool), typeof(SideMenu), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(AutoSelect), typeof(bool), typeof(SideMenu), new PropertyMetadata(ValueBoxes.TrueBox));
public bool AutoSelect public bool AutoSelect
{ {
@@ -145,7 +145,7 @@ public class SideMenu : HeaderedSimpleItemsControl
} }
public static readonly DependencyProperty ExpandModeProperty = DependencyProperty.Register( public static readonly DependencyProperty ExpandModeProperty = DependencyProperty.Register(
"ExpandMode", typeof(ExpandMode), typeof(SideMenu), new PropertyMetadata(default(ExpandMode), OnExpandModeChanged)); nameof(ExpandMode), typeof(ExpandMode), typeof(SideMenu), new PropertyMetadata(default(ExpandMode), OnExpandModeChanged));
private static void OnExpandModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnExpandModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -223,7 +223,7 @@ public class SideMenu : HeaderedSimpleItemsControl
} }
public static readonly DependencyProperty PanelAreaLengthProperty = DependencyProperty.Register( public static readonly DependencyProperty PanelAreaLengthProperty = DependencyProperty.Register(
"PanelAreaLength", typeof(double), typeof(SideMenu), new PropertyMetadata(double.NaN)); nameof(PanelAreaLength), typeof(double), typeof(SideMenu), new PropertyMetadata(double.NaN));
public double PanelAreaLength public double PanelAreaLength
{ {
@@ -13,7 +13,7 @@ public class SideMenuItem : HeaderedSimpleItemsControl, ISelectable, ICommandSou
private bool _isMouseLeftButtonDown; private bool _isMouseLeftButtonDown;
public static readonly DependencyProperty IconProperty = DependencyProperty.Register( public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
"Icon", typeof(object), typeof(SideMenuItem), new PropertyMetadata(default(object))); nameof(Icon), typeof(object), typeof(SideMenuItem), new PropertyMetadata(default(object)));
public object Icon public object Icon
{ {
@@ -97,7 +97,7 @@ public class SideMenuItem : HeaderedSimpleItemsControl, ISelectable, ICommandSou
} }
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
"IsSelected", typeof(bool), typeof(SideMenuItem), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsSelected), typeof(bool), typeof(SideMenuItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsSelected public bool IsSelected
{ {
@@ -106,7 +106,7 @@ public class SideMenuItem : HeaderedSimpleItemsControl, ISelectable, ICommandSou
} }
public static readonly DependencyProperty RoleProperty = DependencyProperty.Register( public static readonly DependencyProperty RoleProperty = DependencyProperty.Register(
"Role", typeof(SideMenuItemRole), typeof(SideMenuItem), new PropertyMetadata(default(SideMenuItemRole))); nameof(Role), typeof(SideMenuItemRole), typeof(SideMenuItem), new PropertyMetadata(default(SideMenuItemRole)));
public SideMenuItemRole Role public SideMenuItemRole Role
{ {
@@ -166,7 +166,7 @@ public class SideMenuItem : HeaderedSimpleItemsControl, ISelectable, ICommandSou
} }
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register( public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
"Command", typeof(ICommand), typeof(SideMenuItem), new PropertyMetadata(default(ICommand), OnCommandChanged)); nameof(Command), typeof(ICommand), typeof(SideMenuItem), new PropertyMetadata(default(ICommand), OnCommandChanged));
private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -188,7 +188,7 @@ public class SideMenuItem : HeaderedSimpleItemsControl, ISelectable, ICommandSou
} }
public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register( public static readonly DependencyProperty CommandParameterProperty = DependencyProperty.Register(
"CommandParameter", typeof(object), typeof(SideMenuItem), new PropertyMetadata(default(object))); nameof(CommandParameter), typeof(object), typeof(SideMenuItem), new PropertyMetadata(default(object)));
public object CommandParameter public object CommandParameter
{ {
@@ -197,7 +197,7 @@ public class SideMenuItem : HeaderedSimpleItemsControl, ISelectable, ICommandSou
} }
public static readonly DependencyProperty CommandTargetProperty = DependencyProperty.Register( public static readonly DependencyProperty CommandTargetProperty = DependencyProperty.Register(
"CommandTarget", typeof(IInputElement), typeof(SideMenuItem), new PropertyMetadata(default(IInputElement))); nameof(CommandTarget), typeof(IInputElement), typeof(SideMenuItem), new PropertyMetadata(default(IInputElement)));
public IInputElement CommandTarget public IInputElement CommandTarget
{ {
@@ -6,10 +6,10 @@ namespace HandyControl.Controls;
public class CompareSlider : Slider public class CompareSlider : Slider
{ {
public static readonly DependencyProperty TargetContentProperty = DependencyProperty.Register( public static readonly DependencyProperty TargetContentProperty = DependencyProperty.Register(
"TargetContent", typeof(object), typeof(CompareSlider), new PropertyMetadata(default(object))); nameof(TargetContent), typeof(object), typeof(CompareSlider), new PropertyMetadata(default(object)));
public static readonly DependencyProperty SourceContentProperty = DependencyProperty.Register( public static readonly DependencyProperty SourceContentProperty = DependencyProperty.Register(
"SourceContent", typeof(object), typeof(CompareSlider), new PropertyMetadata(default(object))); nameof(SourceContent), typeof(object), typeof(CompareSlider), new PropertyMetadata(default(object)));
public object TargetContent public object TargetContent
{ {
@@ -33,7 +33,7 @@ public class PreviewSlider : Slider
/// 预览内容 /// 预览内容
/// </summary> /// </summary>
public static readonly DependencyProperty PreviewContentProperty = DependencyProperty.Register( public static readonly DependencyProperty PreviewContentProperty = DependencyProperty.Register(
"PreviewContent", typeof(object), typeof(PreviewSlider), new PropertyMetadata(default(object))); nameof(PreviewContent), typeof(object), typeof(PreviewSlider), new PropertyMetadata(default(object)));
/// <summary> /// <summary>
/// 预览内容 /// 预览内容
@@ -45,7 +45,7 @@ public class PreviewSlider : Slider
} }
public static readonly DependencyProperty PreviewContentOffsetProperty = DependencyProperty.Register( public static readonly DependencyProperty PreviewContentOffsetProperty = DependencyProperty.Register(
"PreviewContentOffset", typeof(double), typeof(PreviewSlider), new PropertyMetadata(9.0)); nameof(PreviewContentOffset), typeof(double), typeof(PreviewSlider), new PropertyMetadata(9.0));
public double PreviewContentOffset public double PreviewContentOffset
{ {
@@ -132,7 +132,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(RangeSlider), new PropertyMetadata(default(Orientation))); nameof(Orientation), typeof(Orientation), typeof(RangeSlider), new PropertyMetadata(default(Orientation)));
public Orientation Orientation public Orientation Orientation
{ {
@@ -141,7 +141,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty IsDirectionReversedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsDirectionReversedProperty = DependencyProperty.Register(
"IsDirectionReversed", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsDirectionReversed), typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsDirectionReversed public bool IsDirectionReversed
{ {
@@ -182,7 +182,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty AutoToolTipPlacementProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoToolTipPlacementProperty = DependencyProperty.Register(
"AutoToolTipPlacement", typeof(AutoToolTipPlacement), typeof(RangeSlider), new PropertyMetadata(default(AutoToolTipPlacement))); nameof(AutoToolTipPlacement), typeof(AutoToolTipPlacement), typeof(RangeSlider), new PropertyMetadata(default(AutoToolTipPlacement)));
public AutoToolTipPlacement AutoToolTipPlacement public AutoToolTipPlacement AutoToolTipPlacement
{ {
@@ -191,7 +191,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty AutoToolTipPrecisionProperty = DependencyProperty.Register( public static readonly DependencyProperty AutoToolTipPrecisionProperty = DependencyProperty.Register(
"AutoToolTipPrecision", typeof(int), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Int0Box), nameof(AutoToolTipPrecision), typeof(int), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Int0Box),
ValidateHelper.IsInRangeOfPosIntIncludeZero); ValidateHelper.IsInRangeOfPosIntIncludeZero);
public int AutoToolTipPrecision public int AutoToolTipPrecision
@@ -201,7 +201,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty IsSnapToTickEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSnapToTickEnabledProperty = DependencyProperty.Register(
"IsSnapToTickEnabled", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsSnapToTickEnabled), typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsSnapToTickEnabled public bool IsSnapToTickEnabled
{ {
@@ -210,7 +210,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty TickPlacementProperty = DependencyProperty.Register( public static readonly DependencyProperty TickPlacementProperty = DependencyProperty.Register(
"TickPlacement", typeof(TickPlacement), typeof(RangeSlider), new PropertyMetadata(default(TickPlacement))); nameof(TickPlacement), typeof(TickPlacement), typeof(RangeSlider), new PropertyMetadata(default(TickPlacement)));
public TickPlacement TickPlacement public TickPlacement TickPlacement
{ {
@@ -219,7 +219,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty TickFrequencyProperty = DependencyProperty.Register( public static readonly DependencyProperty TickFrequencyProperty = DependencyProperty.Register(
"TickFrequency", typeof(double), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Double1Box), nameof(TickFrequency), typeof(double), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Double1Box),
ValidateHelper.IsInRangeOfPosDoubleIncludeZero); ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double TickFrequency public double TickFrequency
@@ -229,7 +229,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty TicksProperty = DependencyProperty.Register( public static readonly DependencyProperty TicksProperty = DependencyProperty.Register(
"Ticks", typeof(DoubleCollection), typeof(RangeSlider), new PropertyMetadata(new DoubleCollection())); nameof(Ticks), typeof(DoubleCollection), typeof(RangeSlider), new PropertyMetadata(new DoubleCollection()));
public DoubleCollection Ticks public DoubleCollection Ticks
{ {
@@ -238,7 +238,7 @@ public class RangeSlider : TwoWayRangeBase
} }
public static readonly DependencyProperty IsMoveToPointEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsMoveToPointEnabledProperty = DependencyProperty.Register(
"IsMoveToPointEnabled", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsMoveToPointEnabled), typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsMoveToPointEnabled public bool IsMoveToPointEnabled
{ {
@@ -8,7 +8,7 @@ namespace HandyControl.Controls;
public class RangeThumb : Thumb public class RangeThumb : Thumb
{ {
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register( public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
"Content", typeof(object), typeof(RangeThumb), new PropertyMetadata(default(object))); nameof(Content), typeof(object), typeof(RangeThumb), new PropertyMetadata(default(object)));
public object Content public object Content
{ {
@@ -109,7 +109,7 @@ public class RangeTrack : FrameworkElement
} }
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
"Orientation", typeof(Orientation), typeof(RangeTrack), nameof(Orientation), typeof(Orientation), typeof(RangeTrack),
new FrameworkPropertyMetadata(default(Orientation), FrameworkPropertyMetadataOptions.AffectsMeasure)); new FrameworkPropertyMetadata(default(Orientation), FrameworkPropertyMetadataOptions.AffectsMeasure));
public Orientation Orientation public Orientation Orientation
@@ -119,7 +119,7 @@ public class RangeTrack : FrameworkElement
} }
public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register( public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(
"Minimum", typeof(double), typeof(RangeTrack), nameof(Minimum), typeof(double), typeof(RangeTrack),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsArrange)); new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsArrange));
public double Minimum public double Minimum
@@ -129,7 +129,7 @@ public class RangeTrack : FrameworkElement
} }
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register( public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
"Maximum", typeof(double), typeof(RangeTrack), nameof(Maximum), typeof(double), typeof(RangeTrack),
new FrameworkPropertyMetadata(ValueBoxes.Double1Box, FrameworkPropertyMetadataOptions.AffectsArrange)); new FrameworkPropertyMetadata(ValueBoxes.Double1Box, FrameworkPropertyMetadataOptions.AffectsArrange));
public double Maximum public double Maximum
@@ -139,7 +139,7 @@ public class RangeTrack : FrameworkElement
} }
public static readonly DependencyProperty ValueStartProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueStartProperty = DependencyProperty.Register(
"ValueStart", typeof(double), typeof(RangeTrack), nameof(ValueStart), typeof(double), typeof(RangeTrack),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault |
FrameworkPropertyMetadataOptions.AffectsArrange)); FrameworkPropertyMetadataOptions.AffectsArrange));
@@ -151,7 +151,7 @@ public class RangeTrack : FrameworkElement
} }
public static readonly DependencyProperty ValueEndProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueEndProperty = DependencyProperty.Register(
"ValueEnd", typeof(double), typeof(RangeTrack), nameof(ValueEnd), typeof(double), typeof(RangeTrack),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault |
FrameworkPropertyMetadataOptions.AffectsArrange)); FrameworkPropertyMetadataOptions.AffectsArrange));
@@ -163,7 +163,7 @@ public class RangeTrack : FrameworkElement
} }
public static readonly DependencyProperty IsDirectionReversedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsDirectionReversedProperty = DependencyProperty.Register(
"IsDirectionReversed", typeof(bool), typeof(RangeTrack), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsDirectionReversed), typeof(bool), typeof(RangeTrack), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsDirectionReversed public bool IsDirectionReversed
{ {
@@ -10,7 +10,7 @@ namespace HandyControl.Controls;
public class TwoWayRangeBase : Control public class TwoWayRangeBase : Control
{ {
public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register( public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(
"Minimum", typeof(double), typeof(TwoWayRangeBase), nameof(Minimum), typeof(double), typeof(TwoWayRangeBase),
new PropertyMetadata(ValueBoxes.Double0Box, OnMinimumChanged), ValidateHelper.IsInRangeOfDouble); new PropertyMetadata(ValueBoxes.Double0Box, OnMinimumChanged), ValidateHelper.IsInRangeOfDouble);
private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
@@ -34,7 +34,7 @@ public class TwoWayRangeBase : Control
} }
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register( public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
"Maximum", typeof(double), typeof(TwoWayRangeBase), nameof(Maximum), typeof(double), typeof(TwoWayRangeBase),
new PropertyMetadata(ValueBoxes.Double10Box, OnMaximumChanged, CoerceMaximum), new PropertyMetadata(ValueBoxes.Double10Box, OnMaximumChanged, CoerceMaximum),
ValidateHelper.IsInRangeOfDouble); ValidateHelper.IsInRangeOfDouble);
@@ -69,7 +69,7 @@ public class TwoWayRangeBase : Control
} }
public static readonly DependencyProperty ValueStartProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueStartProperty = DependencyProperty.Register(
"ValueStart", typeof(double), typeof(TwoWayRangeBase), nameof(ValueStart), typeof(double), typeof(TwoWayRangeBase),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal,
OnValueStartChanged, ConstrainToRange), ValidateHelper.IsInRangeOfDouble); OnValueStartChanged, ConstrainToRange), ValidateHelper.IsInRangeOfDouble);
@@ -98,7 +98,7 @@ public class TwoWayRangeBase : Control
} }
public static readonly DependencyProperty ValueEndProperty = DependencyProperty.Register( public static readonly DependencyProperty ValueEndProperty = DependencyProperty.Register(
"ValueEnd", typeof(double), typeof(TwoWayRangeBase), nameof(ValueEnd), typeof(double), typeof(TwoWayRangeBase),
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, new FrameworkPropertyMetadata(ValueBoxes.Double0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.Journal,
OnValueEndChanged, ConstrainToRange), ValidateHelper.IsInRangeOfDouble); OnValueEndChanged, ConstrainToRange), ValidateHelper.IsInRangeOfDouble);
@@ -143,7 +143,7 @@ public class TwoWayRangeBase : Control
} }
public static readonly DependencyProperty LargeChangeProperty = DependencyProperty.Register( public static readonly DependencyProperty LargeChangeProperty = DependencyProperty.Register(
"LargeChange", typeof(double), typeof(TwoWayRangeBase), new PropertyMetadata(ValueBoxes.Double1Box), nameof(LargeChange), typeof(double), typeof(TwoWayRangeBase), new PropertyMetadata(ValueBoxes.Double1Box),
ValidateHelper.IsInRangeOfPosDoubleIncludeZero); ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double LargeChange public double LargeChange
@@ -153,7 +153,7 @@ public class TwoWayRangeBase : Control
} }
public static readonly DependencyProperty SmallChangeProperty = DependencyProperty.Register( public static readonly DependencyProperty SmallChangeProperty = DependencyProperty.Register(
"SmallChange", typeof(double), typeof(TwoWayRangeBase), new PropertyMetadata(ValueBoxes.Double01Box), nameof(SmallChange), typeof(double), typeof(TwoWayRangeBase), new PropertyMetadata(ValueBoxes.Double01Box),
ValidateHelper.IsInRangeOfPosDoubleIncludeZero); ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
public double SmallChange public double SmallChange
@@ -97,7 +97,7 @@ public class StepBar : ItemsControl
} }
public static readonly DependencyProperty StepIndexProperty = DependencyProperty.Register( public static readonly DependencyProperty StepIndexProperty = DependencyProperty.Register(
"StepIndex", typeof(int), typeof(StepBar), new FrameworkPropertyMetadata(ValueBoxes.Int0Box, nameof(StepIndex), typeof(int), typeof(StepBar), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnStepIndexChanged, CoerceStepIndex)); FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnStepIndexChanged, CoerceStepIndex));
private static object CoerceStepIndex(DependencyObject d, object basevalue) private static object CoerceStepIndex(DependencyObject d, object basevalue)
@@ -158,7 +158,7 @@ public class StepBar : ItemsControl
} }
public static readonly DependencyProperty DockProperty = DependencyProperty.Register( public static readonly DependencyProperty DockProperty = DependencyProperty.Register(
"Dock", typeof(Dock), typeof(StepBar), new PropertyMetadata(Dock.Top)); nameof(Dock), typeof(Dock), typeof(StepBar), new PropertyMetadata(Dock.Top));
public Dock Dock public Dock Dock
{ {
@@ -167,7 +167,7 @@ public class StepBar : ItemsControl
} }
public static readonly DependencyProperty IsMouseSelectableProperty = DependencyProperty.Register( public static readonly DependencyProperty IsMouseSelectableProperty = DependencyProperty.Register(
"IsMouseSelectable", typeof(bool), typeof(StepBar), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsMouseSelectable), typeof(bool), typeof(StepBar), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsMouseSelectable public bool IsMouseSelectable
{ {
@@ -12,7 +12,7 @@ public class StepBarItem : SelectableItem
/// 步骤编号 /// 步骤编号
/// </summary> /// </summary>
public static readonly DependencyProperty IndexProperty = DependencyProperty.Register( public static readonly DependencyProperty IndexProperty = DependencyProperty.Register(
"Index", typeof(int), typeof(StepBarItem), new PropertyMetadata(-1)); nameof(Index), typeof(int), typeof(StepBarItem), new PropertyMetadata(-1));
/// <summary> /// <summary>
/// 步骤编号 /// 步骤编号
@@ -27,7 +27,7 @@ public class StepBarItem : SelectableItem
/// 步骤状态 /// 步骤状态
/// </summary> /// </summary>
public static readonly DependencyProperty StatusProperty = DependencyProperty.Register( public static readonly DependencyProperty StatusProperty = DependencyProperty.Register(
"Status", typeof(StepStatus), typeof(StepBarItem), new PropertyMetadata(StepStatus.Waiting)); nameof(Status), typeof(StepStatus), typeof(StepBarItem), new PropertyMetadata(StepStatus.Waiting));
/// <summary> /// <summary>
/// 步骤状态 /// 步骤状态
@@ -52,7 +52,7 @@ public class TabControl : System.Windows.Controls.TabControl
/// 是否启用动画 /// 是否启用动画
/// </summary> /// </summary>
public static readonly DependencyProperty IsAnimationEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsAnimationEnabledProperty = DependencyProperty.Register(
"IsAnimationEnabled", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsAnimationEnabled), typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 是否启用动画 /// 是否启用动画
@@ -67,7 +67,7 @@ public class TabControl : System.Windows.Controls.TabControl
/// 是否可以拖动 /// 是否可以拖动
/// </summary> /// </summary>
public static readonly DependencyProperty IsDraggableProperty = DependencyProperty.Register( public static readonly DependencyProperty IsDraggableProperty = DependencyProperty.Register(
"IsDraggable", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsDraggable), typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 是否可以拖动 /// 是否可以拖动
@@ -121,7 +121,7 @@ public class TabControl : System.Windows.Controls.TabControl
} }
public static readonly DependencyProperty CanBeClosedByMiddleButtonProperty = public static readonly DependencyProperty CanBeClosedByMiddleButtonProperty =
DependencyProperty.Register("CanBeClosedByMiddleButton", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.TrueBox)); DependencyProperty.Register(nameof(CanBeClosedByMiddleButton), typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.TrueBox));
public bool CanBeClosedByMiddleButton public bool CanBeClosedByMiddleButton
{ {
@@ -133,7 +133,7 @@ public class TabControl : System.Windows.Controls.TabControl
/// 是否将标签填充 /// 是否将标签填充
/// </summary> /// </summary>
public static readonly DependencyProperty IsTabFillEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsTabFillEnabledProperty = DependencyProperty.Register(
"IsTabFillEnabled", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsTabFillEnabled), typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 是否将标签填充 /// 是否将标签填充
@@ -148,7 +148,7 @@ public class TabControl : System.Windows.Controls.TabControl
/// 标签宽度 /// 标签宽度
/// </summary> /// </summary>
public static readonly DependencyProperty TabItemWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty TabItemWidthProperty = DependencyProperty.Register(
"TabItemWidth", typeof(double), typeof(TabControl), new PropertyMetadata(200.0)); nameof(TabItemWidth), typeof(double), typeof(TabControl), new PropertyMetadata(200.0));
/// <summary> /// <summary>
/// 标签宽度 /// 标签宽度
@@ -163,7 +163,7 @@ public class TabControl : System.Windows.Controls.TabControl
/// 标签高度 /// 标签高度
/// </summary> /// </summary>
public static readonly DependencyProperty TabItemHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty TabItemHeightProperty = DependencyProperty.Register(
"TabItemHeight", typeof(double), typeof(TabControl), new PropertyMetadata(30.0)); nameof(TabItemHeight), typeof(double), typeof(TabControl), new PropertyMetadata(30.0));
/// <summary> /// <summary>
/// 标签高度 /// 标签高度
@@ -178,7 +178,7 @@ public class TabControl : System.Windows.Controls.TabControl
/// 是否可以滚动 /// 是否可以滚动
/// </summary> /// </summary>
public static readonly DependencyProperty IsScrollableProperty = DependencyProperty.Register( public static readonly DependencyProperty IsScrollableProperty = DependencyProperty.Register(
"IsScrollable", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsScrollable), typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 是否可以滚动 /// 是否可以滚动
@@ -193,7 +193,7 @@ public class TabControl : System.Windows.Controls.TabControl
/// 是否显示溢出按钮 /// 是否显示溢出按钮
/// </summary> /// </summary>
public static readonly DependencyProperty ShowOverflowButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowOverflowButtonProperty = DependencyProperty.Register(
"ShowOverflowButton", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowOverflowButton), typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.TrueBox));
/// <summary> /// <summary>
/// 是否显示溢出按钮 /// 是否显示溢出按钮
@@ -208,7 +208,7 @@ public class TabControl : System.Windows.Controls.TabControl
/// 是否显示滚动按钮 /// 是否显示滚动按钮
/// </summary> /// </summary>
public static readonly DependencyProperty ShowScrollButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowScrollButtonProperty = DependencyProperty.Register(
"ShowScrollButton", typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowScrollButton), typeof(bool), typeof(TabControl), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 是否显示滚动按钮 /// 是否显示滚动按钮
@@ -183,7 +183,7 @@ public class TabItem : System.Windows.Controls.TabItem
=> (bool) element.GetValue(ShowContextMenuProperty); => (bool) element.GetValue(ShowContextMenuProperty);
public static readonly DependencyProperty MenuProperty = DependencyProperty.Register( public static readonly DependencyProperty MenuProperty = DependencyProperty.Register(
"Menu", typeof(ContextMenu), typeof(TabItem), new PropertyMetadata(default(ContextMenu), OnMenuChanged)); nameof(Menu), typeof(ContextMenu), typeof(TabItem), new PropertyMetadata(default(ContextMenu), OnMenuChanged));
private static void OnMenuChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnMenuChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -45,7 +45,7 @@ public class TabPanel : Panel
/// 是否将标签填充 /// 是否将标签填充
/// </summary> /// </summary>
public static readonly DependencyProperty IsTabFillEnabledProperty = DependencyProperty.Register( public static readonly DependencyProperty IsTabFillEnabledProperty = DependencyProperty.Register(
"IsTabFillEnabled", typeof(bool), typeof(TabPanel), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(IsTabFillEnabled), typeof(bool), typeof(TabPanel), new PropertyMetadata(ValueBoxes.FalseBox));
/// <summary> /// <summary>
/// 是否将标签填充 /// 是否将标签填充
@@ -60,7 +60,7 @@ public class TabPanel : Panel
/// 标签宽度 /// 标签宽度
/// </summary> /// </summary>
public static readonly DependencyProperty TabItemWidthProperty = DependencyProperty.Register( public static readonly DependencyProperty TabItemWidthProperty = DependencyProperty.Register(
"TabItemWidth", typeof(double), typeof(TabPanel), new PropertyMetadata(200.0)); nameof(TabItemWidth), typeof(double), typeof(TabPanel), new PropertyMetadata(200.0));
/// <summary> /// <summary>
/// 标签宽度 /// 标签宽度
@@ -75,7 +75,7 @@ public class TabPanel : Panel
/// 标签高度 /// 标签高度
/// </summary> /// </summary>
public static readonly DependencyProperty TabItemHeightProperty = DependencyProperty.Register( public static readonly DependencyProperty TabItemHeightProperty = DependencyProperty.Register(
"TabItemHeight", typeof(double), typeof(TabPanel), new PropertyMetadata(30.0)); nameof(TabItemHeight), typeof(double), typeof(TabPanel), new PropertyMetadata(30.0));
/// <summary> /// <summary>
/// 标签高度 /// 标签高度
@@ -23,7 +23,7 @@ public class Tag : ContentControl
} }
public static readonly DependencyProperty ShowCloseButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowCloseButtonProperty = DependencyProperty.Register(
"ShowCloseButton", typeof(bool), typeof(Tag), new PropertyMetadata(ValueBoxes.TrueBox)); nameof(ShowCloseButton), typeof(bool), typeof(Tag), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowCloseButton public bool ShowCloseButton
{ {
@@ -32,7 +32,7 @@ public class Tag : ContentControl
} }
public static readonly DependencyProperty SelectableProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectableProperty = DependencyProperty.Register(
"Selectable", typeof(bool), typeof(Tag), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(Selectable), typeof(bool), typeof(Tag), new PropertyMetadata(ValueBoxes.FalseBox));
public bool Selectable public bool Selectable
{ {
@@ -41,7 +41,7 @@ public class Tag : ContentControl
} }
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register( public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
"IsSelected", typeof(bool), typeof(Tag), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) => nameof(IsSelected), typeof(bool), typeof(Tag), new PropertyMetadata(ValueBoxes.FalseBox, (o, args) =>
{ {
var ctl = (Tag) o; var ctl = (Tag) o;
ctl.RaiseEvent(new RoutedEventArgs(SelectedEvent, ctl)); ctl.RaiseEvent(new RoutedEventArgs(SelectedEvent, ctl));
@@ -54,7 +54,7 @@ public class Tag : ContentControl
} }
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
"Header", typeof(object), typeof(Tag), new PropertyMetadata(default, OnHeaderChanged)); nameof(Header), typeof(object), typeof(Tag), new PropertyMetadata(default, OnHeaderChanged));
private static void OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -85,7 +85,7 @@ public class Tag : ContentControl
public bool HasHeader => (bool) GetValue(HasHeaderProperty); public bool HasHeader => (bool) GetValue(HasHeaderProperty);
public static readonly DependencyProperty HeaderStringFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderStringFormatProperty = DependencyProperty.Register(
"HeaderStringFormat", typeof(string), typeof(Tag), new PropertyMetadata(default(string))); nameof(HeaderStringFormat), typeof(string), typeof(Tag), new PropertyMetadata(default(string)));
public string HeaderStringFormat public string HeaderStringFormat
{ {
@@ -94,7 +94,7 @@ public class Tag : ContentControl
} }
public static readonly DependencyProperty HeaderTemplateSelectorProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderTemplateSelectorProperty = DependencyProperty.Register(
"HeaderTemplateSelector", typeof(DataTemplateSelector), typeof(Tag), new PropertyMetadata(default(DataTemplateSelector))); nameof(HeaderTemplateSelector), typeof(DataTemplateSelector), typeof(Tag), new PropertyMetadata(default(DataTemplateSelector)));
public DataTemplateSelector HeaderTemplateSelector public DataTemplateSelector HeaderTemplateSelector
{ {
@@ -103,7 +103,7 @@ public class Tag : ContentControl
} }
public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register( public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register(
"HeaderTemplate", typeof(DataTemplate), typeof(Tag), new PropertyMetadata(default(DataTemplate))); nameof(HeaderTemplate), typeof(DataTemplate), typeof(Tag), new PropertyMetadata(default(DataTemplate)));
public DataTemplate HeaderTemplate public DataTemplate HeaderTemplate
{ {
@@ -13,18 +13,18 @@ namespace HandyControl.Controls;
public class HighlightTextBlock : TextBlock public class HighlightTextBlock : TextBlock
{ {
public static readonly DependencyProperty SourceTextProperty = public static readonly DependencyProperty SourceTextProperty =
DependencyProperty.Register("SourceText", typeof(string), typeof(HighlightTextBlock), DependencyProperty.Register(nameof(SourceText), typeof(string), typeof(HighlightTextBlock),
new PropertyMetadata(null, OnSourceTextChanged)); new PropertyMetadata(null, OnSourceTextChanged));
public static readonly DependencyProperty QueriesTextProperty = public static readonly DependencyProperty QueriesTextProperty =
DependencyProperty.Register("QueriesText", typeof(string), typeof(HighlightTextBlock), DependencyProperty.Register(nameof(QueriesText), typeof(string), typeof(HighlightTextBlock),
new PropertyMetadata(null, OnQueriesTextChanged)); new PropertyMetadata(null, OnQueriesTextChanged));
public static readonly DependencyProperty HighlightBrushProperty = public static readonly DependencyProperty HighlightBrushProperty =
DependencyProperty.Register("HighlightBrush", typeof(Brush), typeof(HighlightTextBlock)); DependencyProperty.Register(nameof(HighlightBrush), typeof(Brush), typeof(HighlightTextBlock));
public static readonly DependencyProperty HighlightTextBrushProperty = public static readonly DependencyProperty HighlightTextBrushProperty =
DependencyProperty.Register("HighlightTextBrush", typeof(Brush), typeof(HighlightTextBlock)); DependencyProperty.Register(nameof(HighlightTextBrush), typeof(Brush), typeof(HighlightTextBlock));
private static void OnSourceTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) => private static void OnSourceTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) =>
((HighlightTextBlock) d).RefreshInlines(); ((HighlightTextBlock) d).RefreshInlines();
@@ -25,7 +25,7 @@ public class OutlineText : FrameworkElement
} }
public static readonly DependencyProperty StrokePositionProperty = DependencyProperty.Register( public static readonly DependencyProperty StrokePositionProperty = DependencyProperty.Register(
"StrokePosition", typeof(StrokePosition), typeof(OutlineText), new PropertyMetadata(default(StrokePosition))); nameof(StrokePosition), typeof(StrokePosition), typeof(OutlineText), new PropertyMetadata(default(StrokePosition)));
public StrokePosition StrokePosition public StrokePosition StrokePosition
{ {
@@ -34,7 +34,7 @@ public class OutlineText : FrameworkElement
} }
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(OutlineText), new FrameworkPropertyMetadata( nameof(Text), typeof(string), typeof(OutlineText), new FrameworkPropertyMetadata(
string.Empty, string.Empty,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsMeasure |
FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated)); FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated));
@@ -46,7 +46,7 @@ public class OutlineText : FrameworkElement
} }
public static readonly DependencyProperty TextAlignmentProperty = DependencyProperty.Register( public static readonly DependencyProperty TextAlignmentProperty = DependencyProperty.Register(
"TextAlignment", typeof(TextAlignment), typeof(OutlineText), nameof(TextAlignment), typeof(TextAlignment), typeof(OutlineText),
new PropertyMetadata(default(TextAlignment), OnFormattedTextUpdated)); new PropertyMetadata(default(TextAlignment), OnFormattedTextUpdated));
public TextAlignment TextAlignment public TextAlignment TextAlignment
@@ -56,7 +56,7 @@ public class OutlineText : FrameworkElement
} }
public static readonly DependencyProperty TextTrimmingProperty = DependencyProperty.Register( public static readonly DependencyProperty TextTrimmingProperty = DependencyProperty.Register(
"TextTrimming", typeof(TextTrimming), typeof(OutlineText), nameof(TextTrimming), typeof(TextTrimming), typeof(OutlineText),
new PropertyMetadata(default(TextTrimming), OnFormattedTextInvalidated)); new PropertyMetadata(default(TextTrimming), OnFormattedTextInvalidated));
public TextTrimming TextTrimming public TextTrimming TextTrimming
@@ -66,7 +66,7 @@ public class OutlineText : FrameworkElement
} }
public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register( public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register(
"TextWrapping", typeof(TextWrapping), typeof(OutlineText), nameof(TextWrapping), typeof(TextWrapping), typeof(OutlineText),
new PropertyMetadata(TextWrapping.NoWrap, OnFormattedTextInvalidated)); new PropertyMetadata(TextWrapping.NoWrap, OnFormattedTextInvalidated));
public TextWrapping TextWrapping public TextWrapping TextWrapping
@@ -76,7 +76,7 @@ public class OutlineText : FrameworkElement
} }
public static readonly DependencyProperty FillProperty = DependencyProperty.Register( public static readonly DependencyProperty FillProperty = DependencyProperty.Register(
"Fill", typeof(Brush), typeof(OutlineText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated)); nameof(Fill), typeof(Brush), typeof(OutlineText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
public Brush Fill public Brush Fill
{ {
@@ -85,7 +85,7 @@ public class OutlineText : FrameworkElement
} }
public static readonly DependencyProperty StrokeProperty = DependencyProperty.Register( public static readonly DependencyProperty StrokeProperty = DependencyProperty.Register(
"Stroke", typeof(Brush), typeof(OutlineText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated)); nameof(Stroke), typeof(Brush), typeof(OutlineText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
public Brush Stroke public Brush Stroke
{ {
@@ -94,7 +94,7 @@ public class OutlineText : FrameworkElement
} }
public static readonly DependencyProperty StrokeThicknessProperty = DependencyProperty.Register( public static readonly DependencyProperty StrokeThicknessProperty = DependencyProperty.Register(
"StrokeThickness", typeof(double), typeof(OutlineText), new PropertyMetadata(ValueBoxes.Double0Box, OnFormattedTextUpdated)); nameof(StrokeThickness), typeof(double), typeof(OutlineText), new PropertyMetadata(ValueBoxes.Double0Box, OnFormattedTextUpdated));
public double StrokeThickness public double StrokeThickness
{ {
@@ -19,7 +19,7 @@ public class SimpleText : FrameworkElement
} }
public static readonly DependencyProperty TextProperty = DependencyProperty.Register( public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(SimpleText), new FrameworkPropertyMetadata( nameof(Text), typeof(string), typeof(SimpleText), new FrameworkPropertyMetadata(
string.Empty, string.Empty,
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsMeasure |
FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated)); FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated));
@@ -31,7 +31,7 @@ public class SimpleText : FrameworkElement
} }
public static readonly DependencyProperty TextAlignmentProperty = DependencyProperty.Register( public static readonly DependencyProperty TextAlignmentProperty = DependencyProperty.Register(
"TextAlignment", typeof(TextAlignment), typeof(SimpleText), nameof(TextAlignment), typeof(TextAlignment), typeof(SimpleText),
new PropertyMetadata(default(TextAlignment), OnFormattedTextUpdated)); new PropertyMetadata(default(TextAlignment), OnFormattedTextUpdated));
public TextAlignment TextAlignment public TextAlignment TextAlignment
@@ -41,7 +41,7 @@ public class SimpleText : FrameworkElement
} }
public static readonly DependencyProperty TextTrimmingProperty = DependencyProperty.Register( public static readonly DependencyProperty TextTrimmingProperty = DependencyProperty.Register(
"TextTrimming", typeof(TextTrimming), typeof(SimpleText), nameof(TextTrimming), typeof(TextTrimming), typeof(SimpleText),
new PropertyMetadata(default(TextTrimming), OnFormattedTextInvalidated)); new PropertyMetadata(default(TextTrimming), OnFormattedTextInvalidated));
public TextTrimming TextTrimming public TextTrimming TextTrimming
@@ -51,7 +51,7 @@ public class SimpleText : FrameworkElement
} }
public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register( public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register(
"TextWrapping", typeof(TextWrapping), typeof(SimpleText), nameof(TextWrapping), typeof(TextWrapping), typeof(SimpleText),
new PropertyMetadata(TextWrapping.NoWrap, OnFormattedTextInvalidated)); new PropertyMetadata(TextWrapping.NoWrap, OnFormattedTextInvalidated));
public TextWrapping TextWrapping public TextWrapping TextWrapping
@@ -61,7 +61,7 @@ public class SimpleText : FrameworkElement
} }
public static readonly DependencyProperty ForegroundProperty = DependencyProperty.Register( public static readonly DependencyProperty ForegroundProperty = DependencyProperty.Register(
"Foreground", typeof(Brush), typeof(SimpleText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated)); nameof(Foreground), typeof(Brush), typeof(SimpleText), new PropertyMetadata(Brushes.Black, OnFormattedTextUpdated));
public Brush Foreground public Brush Foreground
{ {
@@ -73,7 +73,7 @@ public class CalendarWithClock : Control
#region Public Properties #region Public Properties
public static readonly DependencyProperty DateTimeFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty DateTimeFormatProperty = DependencyProperty.Register(
"DateTimeFormat", typeof(string), typeof(CalendarWithClock), new PropertyMetadata("yyyy-MM-dd HH:mm:ss")); nameof(DateTimeFormat), typeof(string), typeof(CalendarWithClock), new PropertyMetadata("yyyy-MM-dd HH:mm:ss"));
public string DateTimeFormat public string DateTimeFormat
{ {
@@ -82,7 +82,7 @@ public class CalendarWithClock : Control
} }
public static readonly DependencyProperty ShowConfirmButtonProperty = DependencyProperty.Register( public static readonly DependencyProperty ShowConfirmButtonProperty = DependencyProperty.Register(
"ShowConfirmButton", typeof(bool), typeof(CalendarWithClock), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowConfirmButton), typeof(bool), typeof(CalendarWithClock), new PropertyMetadata(ValueBoxes.FalseBox));
public bool ShowConfirmButton public bool ShowConfirmButton
{ {
@@ -91,7 +91,7 @@ public class CalendarWithClock : Control
} }
public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register(
"SelectedDateTime", typeof(DateTime?), typeof(CalendarWithClock), new PropertyMetadata(default(DateTime?), OnSelectedDateTimeChanged)); nameof(SelectedDateTime), typeof(DateTime?), typeof(CalendarWithClock), new PropertyMetadata(default(DateTime?), OnSelectedDateTimeChanged));
private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -110,7 +110,7 @@ public class CalendarWithClock : Control
} }
public static readonly DependencyProperty DisplayDateTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty DisplayDateTimeProperty = DependencyProperty.Register(
"DisplayDateTime", typeof(DateTime), typeof(CalendarWithClock), new FrameworkPropertyMetadata(DateTime.MinValue, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnDisplayDateTimeChanged)); nameof(DisplayDateTime), typeof(DateTime), typeof(CalendarWithClock), new FrameworkPropertyMetadata(DateTime.MinValue, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnDisplayDateTimeChanged));
private static void OnDisplayDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnDisplayDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -60,7 +60,7 @@ public class Clock : ClockBase
#region Public Properties #region Public Properties
public static readonly DependencyProperty ClockRadioButtonStyleProperty = DependencyProperty.Register( public static readonly DependencyProperty ClockRadioButtonStyleProperty = DependencyProperty.Register(
"ClockRadioButtonStyle", typeof(Style), typeof(Clock), new PropertyMetadata(default(Style))); nameof(ClockRadioButtonStyle), typeof(Style), typeof(Clock), new PropertyMetadata(default(Style)));
public Style ClockRadioButtonStyle public Style ClockRadioButtonStyle
{ {
@@ -29,7 +29,7 @@ public abstract class ClockBase : Control
} }
public static readonly DependencyProperty TimeFormatProperty = DependencyProperty.Register( public static readonly DependencyProperty TimeFormatProperty = DependencyProperty.Register(
"TimeFormat", typeof(string), typeof(ClockBase), new PropertyMetadata("HH:mm:ss")); nameof(TimeFormat), typeof(string), typeof(ClockBase), new PropertyMetadata("HH:mm:ss"));
public string TimeFormat public string TimeFormat
{ {
@@ -38,7 +38,7 @@ public abstract class ClockBase : Control
} }
public static readonly DependencyProperty SelectedTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty SelectedTimeProperty = DependencyProperty.Register(
"SelectedTime", typeof(DateTime?), typeof(ClockBase), new PropertyMetadata(default(DateTime?), OnSelectedTimeChanged)); nameof(SelectedTime), typeof(DateTime?), typeof(ClockBase), new PropertyMetadata(default(DateTime?), OnSelectedTimeChanged));
private static void OnSelectedTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnSelectedTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
@@ -58,7 +58,7 @@ public abstract class ClockBase : Control
} }
public static readonly DependencyProperty DisplayTimeProperty = DependencyProperty.Register( public static readonly DependencyProperty DisplayTimeProperty = DependencyProperty.Register(
"DisplayTime", typeof(DateTime), typeof(ClockBase), nameof(DisplayTime), typeof(DateTime), typeof(ClockBase),
new FrameworkPropertyMetadata(DateTime.Now, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new FrameworkPropertyMetadata(DateTime.Now, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
OnDisplayTimeChanged)); OnDisplayTimeChanged));
@@ -77,7 +77,7 @@ public abstract class ClockBase : Control
} }
internal static readonly DependencyProperty ShowConfirmButtonProperty = DependencyProperty.Register( internal static readonly DependencyProperty ShowConfirmButtonProperty = DependencyProperty.Register(
"ShowConfirmButton", typeof(bool), typeof(ClockBase), new PropertyMetadata(ValueBoxes.FalseBox)); nameof(ShowConfirmButton), typeof(bool), typeof(ClockBase), new PropertyMetadata(ValueBoxes.FalseBox));
internal bool ShowConfirmButton internal bool ShowConfirmButton
{ {
Loaded 100 of 116 files, more files were not shown because too many files have changed in this diff. Show more