Пример #1
0
        public Settings(AppBar appbar)
        {
            InitializeComponent();

            DataContext = Model = new SettingsModel(appbar);

            Owner = appbar;
            ShowDialog();
        }
Пример #2
0
        public Settings(AppBar appbar)
        {
            InitializeComponent();

            DataContext = Model = new SettingsModel(appbar);

            Owner = appbar;
            ShowDialog();
        }
Пример #3
0
        private void Hide_Click(object sender, EventArgs e)
        {
            AppBar _appbar = GetAppBar;

            if (_appbar == null || _appbar.Visibility == Visibility.Hidden)
            {
                return;
            }

            _appbar.AppBarHide();
        }
Пример #4
0
        private void Show_Click(object sender, EventArgs e)
        {
            AppBar _appbar = GetAppBar;

            if (_appbar == null || _appbar.Visibility == Visibility.Visible)
            {
                return;
            }

            _appbar.AppBarShow();
        }
Пример #5
0
        private void Reload_Click(object sender, EventArgs e)
        {
            AppBar _appbar = GetAppBar;

            if (_appbar == null)
            {
                return;
            }

            _appbar.Reload();
        }
Пример #6
0
        private void Visibility_SubmenuOpened(object sender, EventArgs e)
        {
            AppBar _appbar = GetAppBar;

            if (_appbar == null)
            {
                return;
            }

            MenuItem _this = (MenuItem)sender;

            (_this.Items.GetItemAt(0) as MenuItem).IsChecked = _appbar.Visibility == Visibility.Visible;
            (_this.Items.GetItemAt(1) as MenuItem).IsChecked = _appbar.Visibility == Visibility.Hidden;
        }
Пример #7
0
        private void Save(bool finalize)
        {
            Model.Save();

            Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
            {
                AppBar _appbar = (Application.Current as App).GetAppBar;

                if (_appbar == null)
                {
                    return;
                }

                _appbar.Reset(finalize);
            }));
        }
Пример #8
0
        public void OpenSettings()
        {
            Settings _settings = Windows.OfType <Settings>().FirstOrDefault();

            if (_settings != null)
            {
                _settings.WindowState = WindowState.Normal;
                _settings.Activate();
                return;
            }

            AppBar _appbar = GetAppBar;

            if (_appbar == null)
            {
                return;
            }

            new Settings(_appbar);
        }