Exemplo n.º 1
0
        /// <summary>
        /// Unlock the window and make it return to normal.
        /// </summary>
        private void UnlockWindow()
        {
            isLocked = false;
            notifyIcon.ContextMenu.MenuItems[0].Text = "Lock";

            WindowUtility.SetWindowNormal(this, extendedStyle);

            clockWidget.Background       = new SolidColorBrush(Color.FromArgb(1, 255, 255, 255));
            this.PanelBorder.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Lock the window and make it transparent.
        /// </summary>
        private void LockWindow()
        {
            isLocked = true;
            notifyIcon.ContextMenu.MenuItems[0].Text = "Unlock";

            WindowUtility.SetWindowTransparent(this, extendedStyle);

            clockWidget.Background       = new SolidColorBrush(Color.FromArgb(0, 255, 255, 255));
            this.PanelBorder.BorderBrush = Brushes.Transparent;
        }
Exemplo n.º 3
0
        private void Widget_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (!isLocked && e.LeftButton == MouseButtonState.Pressed)
            {
                var element = sender as UIElement;

                WindowUtility.SendWindowToBack(this);

                moveFrom = e.GetPosition(element);
                Mouse.Capture(element);

                isMoving = true;
            }
        }
Exemplo n.º 4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            extendedStyle = WindowUtility.GetExtendedStyle(this);

            isLocked = FileIO.LoadWindowLock();

            if (isLocked)
            {
                LockWindow();
            }
            else
            {
                UnlockWindow();
            }
        }
Exemplo n.º 5
0
        private void Menu_EditWidget(object sender, RoutedEventArgs e)
        {
            var item = sender as MenuItem;

            if (item != null)
            {
                var menu = item.Parent as ContextMenu;

                if (menu != null)
                {
                    var clock = menu.PlacementTarget as Clock;

                    if (clock != null)
                    {
                        new EditClock(this, clock).Show();
                    }
                }
            }

            WindowUtility.SendWindowToBack(this);
        }
Exemplo n.º 6
0
 private void Window_ContentRendered(object sender, EventArgs e)
 {
     WindowUtility.SendWindowToBack(this);
 }
Exemplo n.º 7
0
 private void Window_MouseDown(object sender, MouseButtonEventArgs e)
 {
     WindowUtility.SendWindowToBack(this);
 }