public Settings(AppBar appbar) { InitializeComponent(); DataContext = Model = new SettingsModel(appbar); Owner = appbar; ShowDialog(); }
private void Hide_Click(object sender, EventArgs e) { AppBar _appbar = GetAppBar; if (_appbar == null || _appbar.Visibility == Visibility.Hidden) { return; } _appbar.AppBarHide(); }
private void Show_Click(object sender, EventArgs e) { AppBar _appbar = GetAppBar; if (_appbar == null || _appbar.Visibility == Visibility.Visible) { return; } _appbar.AppBarShow(); }
private void Reload_Click(object sender, EventArgs e) { AppBar _appbar = GetAppBar; if (_appbar == null) { return; } _appbar.Reload(); }
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; }
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); })); }
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); }