Exemplo n.º 1
0
        static MineButton()
        {
            if (SharedUtils.InDesignMode())
            {
                return;
            }

            ButtonTypesImageSource =
                new BitmapImage(SharedUtils.ButtonTypeUri);
        }
Exemplo n.º 2
0
        /// <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));
        }
Exemplo n.º 3
0
        /// <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();
        }
Exemplo n.º 4
0
        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(); }));
        }