Inheritance: System.Windows.Controls.ItemsControl
Exemplo n.º 1
0
        protected override void OnStateChanged(EventArgs e)
        {
            if (WindowCommands != null)
            {
                WindowCommands.RefreshMaximiseIconState();
            }

            base.OnStateChanged(e);
        }
Exemplo n.º 2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (WindowCommands == null)
            {
                WindowCommands = new WindowCommands();
            }

            var titleBar = GetTemplateChild(PART_TitleBar) as UIElement;

            if (ShowTitleBar && titleBar != null)
            {
                titleBar.MouseDown += TitleBarMouseDown;
                titleBar.MouseUp   += TitleBarMouseUp;
                titleBar.MouseMove += TitleBarMouseMove;
            }
            else
            {
                MouseDown += TitleBarMouseDown;
            }
        }
Exemplo n.º 3
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (this.iconImage != null)
            {
                this.iconImage.MouseUp -= this.HandleIconMouseUp;
            }

            this.iconImage = GetTemplateChild(PART_Icon) as FrameworkElement;

            if (WindowCommands == null)
            {
                WindowCommands = new WindowCommands();
            }

            if (ShowTitleBar)
            {
                var titleBar = GetTemplateChild(PART_TitleBar) as FrameworkElement;

                if (titleBar != null)
                {
                    titleBar.MouseDown += TitleBarMouseDown;
                    titleBar.MouseUp   += TitleBarMouseUp;
                    titleBar.MouseMove += TitleBarMouseMove;
                }

                if (this.iconImage != null)
                {
                    this.iconImage.MouseUp += this.HandleIconMouseUp;
                }
            }
            else
            {
                MouseDown += TitleBarMouseDown;
            }
        }