using System.Windows;
using System.Windows.Controls;
namespace CodeSampleCsharp
{
///
/// Interaction logic for MainWindow.xaml.
///
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
//
Button myButton = new();
myButton.Width = 200.0;
//
//
double whatWidth = myButton.Width;
//
}
//
public static readonly DependencyProperty IsSpinningProperty = DependencyProperty.Register(
"IsSpinning", typeof(bool),
typeof(MainWindow)
);
public bool IsSpinning
{
get => (bool)GetValue(IsSpinningProperty);
set => SetValue(IsSpinningProperty, value);
}
//
}
//
public class SpinnerControl : ItemsControl
{
static SpinnerControl() => DefaultStyleKeyProperty.OverrideMetadata(
typeof(SpinnerControl),
new FrameworkPropertyMetadata(typeof(SpinnerControl))
);
}
//
}