chore: use file-scoped namespace
This commit is contained in:
1 parent
99d2fafb72
commit
bbf1b7d4c6
748 files changed
+57929
-58678
No files matched your search
@@ -4,38 +4,37 @@ using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
namespace HandyControl.Controls;
|
||||
|
||||
public class ButtonGroup : ItemsControl
|
||||
{
|
||||
public class ButtonGroup : ItemsControl
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is Button or RadioButton or ToggleButton;
|
||||
|
||||
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
|
||||
"Orientation", typeof(Orientation), typeof(ButtonGroup), new PropertyMetadata(default(Orientation)));
|
||||
|
||||
public Orientation Orientation
|
||||
{
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is Button or RadioButton or ToggleButton;
|
||||
get => (Orientation) GetValue(OrientationProperty);
|
||||
set => SetValue(OrientationProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
|
||||
"Orientation", typeof(Orientation), typeof(ButtonGroup), new PropertyMetadata(default(Orientation)));
|
||||
public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register(
|
||||
"Layout", typeof(LinearLayout), typeof(ButtonGroup), new PropertyMetadata(LinearLayout.Uniform));
|
||||
|
||||
public Orientation Orientation
|
||||
public LinearLayout Layout
|
||||
{
|
||||
get => (LinearLayout) GetValue(LayoutProperty);
|
||||
set => SetValue(LayoutProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnRender(DrawingContext drawingContext)
|
||||
{
|
||||
var count = Items.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
get => (Orientation) GetValue(OrientationProperty);
|
||||
set => SetValue(OrientationProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LayoutProperty = DependencyProperty.Register(
|
||||
"Layout", typeof(LinearLayout), typeof(ButtonGroup), new PropertyMetadata(LinearLayout.Uniform));
|
||||
|
||||
public LinearLayout Layout
|
||||
{
|
||||
get => (LinearLayout) GetValue(LayoutProperty);
|
||||
set => SetValue(LayoutProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnRender(DrawingContext drawingContext)
|
||||
{
|
||||
var count = Items.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var item = (ButtonBase) Items[i];
|
||||
item.Style = ItemContainerStyleSelector?.SelectStyle(item, this);
|
||||
}
|
||||
var item = (ButtonBase) Items[i];
|
||||
item.Style = ItemContainerStyleSelector?.SelectStyle(item, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user