static MineButton() { if (SharedUtils.InDesignMode()) { return; } ButtonTypesImageSource = new BitmapImage(SharedUtils.ButtonTypeUri); }
/// <summary> /// Static constructor. /// </summary> static CounterControl() { if (SharedUtils.InDesignMode()) { return; } NumbersImageSource = new BitmapImage(SharedUtils.NumbersUri); NumberProperty = DependencyProperty.Register( nameof(Number), typeof(int?), typeof(CounterControl), new PropertyMetadata(0, NumberChangedCallback)); }
/// <summary> /// <see cref="CounterControl"/> constructor. /// </summary> public CounterControl() { if (SharedUtils.InDesignMode()) { return; } ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); NumberChanged(); }
static EmotionButton() { if (SharedUtils.InDesignMode()) { return; } EmotionsImageSource = new BitmapImage(SharedUtils.EmotionsUri); ParentWindowProperty = DependencyProperty.Register( nameof(ParentWindow), typeof(Window), typeof(EmotionButton), new PropertyMetadata(default(Window), (source, args) => { ((EmotionButton)source).ParentChanged(); })); EmotionTypeValueProperty = DependencyProperty.Register( nameof(EmotionTypeValue), typeof(EmotionType), typeof(EmotionButton), new PropertyMetadata( default(EmotionType), (source, args) => { ((EmotionButton)source).EmotionTypeChanged(); })); }