Esempio n. 1
0
        private void Init()
        {
            _range    = GetTemplateChild("range") as Range;
            _sign     = GetTemplateChild("sign") as SelectSign;
            _disabled = GetTemplateChild("disabled") as ImagePro;

            this.MakeChildsLoaded(_sign);

            this.MouseUp += OnSelectItem;
        }
Esempio n. 2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            _image = GetTemplateChild("image") as ImagePro;
            _range = GetTemplateChild("range") as Range;

            this.MakeChildsLoaded(_range);

            IsFiexdFocusChanged(this, new DependencyPropertyChangedEventArgs(IsFiexdFocusProperty, null, false));
        }
Esempio n. 3
0
 private bool ReplaceStatus(string targetName, ImagePro g)
 {
     for (var i = 0; i < _status.Children.Count; i++)
     {
         var c = _status.Children[i] as FrameworkElement;
         var s = c.DataContext as TitleBarStatus;
         if (s.Name == targetName)
         {
             _status.Children.RemoveAt(i);
             _status.Children.Insert(i, g);
             return(true);
         }
     }
     return(false);
 }
Esempio n. 4
0
        public void AddStatus(TitleBarStatus status, ImagePro g)
        {
            bool finded = false;

            foreach (FrameworkElement c in _status.Children)
            {
                var s = c.DataContext as TitleBarStatus;
                if (s.Name == status.Name)
                {
                    finded = true;
                    break;
                }
            }

            if (!finded)
            {
                _status.Children.Insert(0, g);
            }
        }
Esempio n. 5
0
        private static ImagePro GetImage(TitleBarStatus status)
        {
            var g = new ImagePro()
            {
                Opacity             = 0.5,
                Height              = status.IconHeight,
                Width               = status.IconWidth,
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Center,
                Margin              = new Thickness(5, 0, 5, 0),
                Source              = status.Icon,
            };

            g.ToolTip = new ToolTipText()
            {
                Description = status.Description
            };
            g.DataContext = status;
            return(g);
        }
Esempio n. 6
0
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     _image = GetTemplateChild("image") as ImagePro;
 }