Example #1
0
        public TrayMenu(Window window)
        {
            this.openingWindow = window;

            DataContext = this;

            dragMoveCommand.act += () => { WindowStaticFunctionsHelper.WindowDragMove(Window.GetWindow(this)); };
            AppOpenClick.act    += () => { openingWindow.Show(); this.Hide(); };
            AppExitClick.act    += () => { Application.Current.Shutdown(); };

            InitializeComponent();
        }
Example #2
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            minimizeCommand.act += () => { WindowStaticFunctionsHelper.MinimizeForm(Window.GetWindow(this)); };
            maximizeCommand.act += () => { WindowStaticFunctionsHelper.ResizeForm(Window.GetWindow(this)); };

            if (HideIntoTray == "True")
            {
                closeCommand.act += () => { WindowStaticFunctionsHelper.CloseOrHideForm(Window.GetWindow(this)); };
            }
            else
            {
                closeCommand.act += () => { WindowStaticFunctionsHelper.CloseForm(Window.GetWindow(this)); };
            }

            dragMoveCommand.act += () => { WindowStaticFunctionsHelper.WindowDragMove(Window.GetWindow(this)); };
        }