Exemple #1
0
        /// <summary>
        /// Default contructor
        /// </summary>
        /// <param name="parent"></param>
        public StringByte(HexaEditor parent)
        {
            LoadDictionary("/WPFHexaEditor;component/Resources/Dictionary/ToolTipDictionary.xaml");

            //Default properties
            Width         = 10;
            Focusable     = true;
            DataContext   = this;
            Padding       = new Thickness(0);
            TextAlignment = TextAlignment.Center;

            //Binding
            var txtBinding = new Binding()
            {
                Source = FindResource("ByteToolTip"),
                UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
                Mode = BindingMode.OneWay
            };

            SetBinding(TextBlock.ToolTipProperty, txtBinding);

            //Event
            MouseEnter += UserControl_MouseEnter;
            MouseLeave += UserControl_MouseLeave;
            KeyDown    += UserControl_KeyDown;
            MouseDown  += StringByteLabel_MouseDown;

            //Parent hexeditor
            _parent = parent;
        }
Exemple #2
0
        public HexByte(HexaEditor parent)
        {
            //Default properties
            DataContext   = this;
            Focusable     = true;
            Width         = 20;
            TextAlignment = TextAlignment.Left;
            Padding       = new Thickness(2, 0, 0, 0);

            //Event
            KeyDown    += UserControl_KeyDown;
            MouseDown  += HexChar_MouseDown;
            MouseEnter += UserControl_MouseEnter;
            MouseLeave += UserControl_MouseLeave;

            //Parent hexeditor
            _parent = parent;
        }