Ejemplo n.º 1
0
        /// <summary>
        /// Update on IsOpen changed
        /// </summary>
        private void UpdateOpenStatesAsync()
        {
            bool targetState = !IsOpen;
            var  frdCommands = PrimaryCommands;
            var  secCommands = SecondaryCommands;

            for (int i = 0; i < frdCommands.Count; ++i)
            {
                frdCommands[i].IsCompact = targetState;
            }
            //Update state
            if (IsOpen)
            {
                if (IsSticky == false)
                {
                    Mouse.Capture(this, CaptureMode.SubTree);
                    Mouse.AddPreviewMouseUpOutsideCapturedElementHandler(this, OnMouseDownOutsideElement);
                }
                VisualStateManager.GoToState(this, States.OPEN, false);
                Keyboard.Focus(this);
            }
            else
            {
                GotoCloseState();
                Keyboard.ClearFocus();
            }
        }
Ejemplo n.º 2
0
        public MainContainerWindow()
        {
            InitializeComponent();
            this.Top    = 0;
            this.Left   = 0;
            this.Width  = SystemParameters.PrimaryScreenWidth;
            this.Height = SystemParameters.PrimaryScreenHeight;

            BezierDefineStartCoordinates();

            //Releasing Mouse.Capture
            Mouse.AddPreviewMouseUpOutsideCapturedElementHandler(this, BezierReleaseMouseCapture);
            Mouse.AddPreviewMouseUpHandler(this, BezierReleaseMouseCapture);

            MainContainerWindow.MainContainer = this;
        }
Ejemplo n.º 3
0
        //public TopPanelItem()
        //{
        //    InitializeComponent();
        //}


        public TopPanelItem(TopPanelItemConfiguration config, TopPanel parent)
        {
            InitializeComponent();
            Configuration = config;
            C_Name.Text   = System.IO.Path.GetFileNameWithoutExtension(config.Path);
            SetIcon();

            Canvas.SetLeft(this, config.X);
            Canvas.SetTop(this, config.Y);

            _parentPanel = parent;

            Mouse.AddPreviewMouseUpOutsideCapturedElementHandler(this, ReleaseMouseCapture);
            Mouse.AddPreviewMouseUpHandler(this, ReleaseMouseCapture);

            InitializeAnimations();
        }