Slide 25
Slide 25 text
• csproj > 追加 > ユーザー コントロール
• NumericUpDown.xaml.cs (UserControl からの派生)
public int Value
{
get { return (int)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register("Value", typeof(int), typeof(NumericUpDown), new PropertyMetadata(0));
private void CountUp(object sender, RoutedEventArgs e)
{
this.Value++;
}
Case 1: User Control
依存関係プロパティ