Interaction logic for Sidebar.xaml
Inheritance: SidebarDiagnostics.Windows.AppBarWindow
        public Settings(Sidebar sidebar)
        {
            InitializeComponent();

            DataContext = Model = new SettingsModel(sidebar);

            Owner = sidebar;
            ShowDialog();
        }
        public Graph(Sidebar sidebar)
        {
            InitializeComponent();

            DataContext = Model = new GraphModel(OPGraph);
            Model.BindData(sidebar.Model.MonitorManager);
            
            Show();
        }
Beispiel #3
0
        public void OpenGraph()
        {
            Sidebar _sidebar = Sidebar;

            if (_sidebar == null || !_sidebar.Ready)
            {
                return;
            }

            new Graph(_sidebar);
        }
Beispiel #4
0
        private void Reload_Click(object sender, EventArgs e)
        {
            Sidebar _sidebar = Sidebar;

            if (_sidebar == null)
            {
                return;
            }

            _sidebar.Reload();
        }
Beispiel #5
0
        private void Show_Click(object sender, EventArgs e)
        {
            Sidebar _sidebar = Sidebar;

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

            _sidebar.AppBarShow();
        }
Beispiel #6
0
        private void Hide_Click(object sender, EventArgs e)
        {
            Sidebar _sidebar = Sidebar;

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

            _sidebar.AppBarHide();
        }
Beispiel #7
0
        private void Window_Closed(object sender, EventArgs e)
        {
            if (Sidebar != null && Sidebar.IsInitialized)
            {
                Sidebar.Close();
            }

            Framework.Settings.Instance.InitialSetup = false;
            Framework.Settings.Instance.Save();

            App.StartApp(_openSettings);
        }
        private void Window_Closed(object sender, EventArgs e)
        {
            if (Sidebar != null && Sidebar.IsInitialized)
            {
                Sidebar.Close();
            }

            Properties.Settings.Default.InitialSetup = false;
            Properties.Settings.Default.Save();

            App.StartApp(_openSettings);
        }
        public Settings(Sidebar sidebar)
        {
            InitializeComponent();

            DataContext = Model = new SettingsModel(sidebar);
            try
            {
                Owner = sidebar;
                ShowDialog();
            }catch (Exception e)
            {
                BacktraceLogger.Log(new BacktraceReport(e));
            }
        }
Beispiel #10
0
        private void Visibility_SubmenuOpened(object sender, EventArgs e)
        {
            Sidebar _sidebar = Sidebar;

            if (_sidebar == null)
            {
                return;
            }

            MenuItem _this = (MenuItem)sender;

            (_this.Items.GetItemAt(0) as MenuItem).IsChecked = _sidebar.Visibility == Visibility.Visible;
            (_this.Items.GetItemAt(1) as MenuItem).IsChecked = _sidebar.Visibility == Visibility.Hidden;
        }
        private void CloseButton_Click(object sender, RoutedEventArgs e)
        {
            if (Model.IsChanged)
            {
                Sidebar _sidebar = App.Current.Sidebar;

                if (_sidebar != null)
                {
                    DataContext = Model = new SettingsModel(_sidebar);
                    return;
                }
            }

            Close();
        }
        private async Task Save(bool finalize)
        {
            Model.Save();

            await App.Current.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(async() =>
            {
                Sidebar _sidebar = App.Current.Sidebar;

                if (_sidebar == null)
                {
                    return;
                }

                await _sidebar.Reset(finalize);
            }));
        }
Beispiel #13
0
        private void Save(bool finalize)
        {
            Model.Save();

            Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
            {
                Sidebar _sidebar = (Application.Current as App).GetSidebar;

                if (_sidebar == null)
                {
                    return;
                }

                _sidebar.Reset(finalize);
            }));
        }
        private void Yes_Click(object sender, RoutedEventArgs e)
        {
            switch (CurrentPage)
            {
            case Page.Initial:
            case Page.EndHighDPI:
            case Page.BeginCustom:
                ShowPage(Page.Final);
                return;

            case Page.BeginHighDPI:
                Properties.Settings.Default.HighDPISupport = true;
                Sidebar.Position();
                ShowPage(Page.EndHighDPI);
                return;
            }
        }
Beispiel #15
0
        private void Yes_Click(object sender, RoutedEventArgs e)
        {
            switch (CurrentPage)
            {
            case Page.Initial:
            case Page.EndHighDPI:
            case Page.BeginCustom:
                ShowPage(Page.Final);
                return;

            case Page.BeginHighDPI:
                Framework.Settings.Instance.HighDPISupport = true;
                Sidebar.Reposition();
                ShowPage(Page.EndHighDPI);
                return;
            }
        }
Beispiel #16
0
        public void OpenSettings()
        {
            Settings _settings = Windows.OfType <Settings>().FirstOrDefault();

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

            Sidebar _sidebar = Sidebar;

            if (_sidebar == null)
            {
                return;
            }

            new Settings(_sidebar);
        }
Beispiel #17
0
        public static void StartApp(bool openSettings)
        {
            Version _version = Assembly.GetExecutingAssembly().GetName().Version;
            string  _vstring = _version.ToString(3);

            if (!string.Equals(Framework.Settings.Instance.ChangeLog, _vstring, StringComparison.OrdinalIgnoreCase))
            {
                Framework.Settings.Instance.ChangeLog = _vstring;
                Framework.Settings.Instance.Save();

                new ChangeLog(_version).Show();
            }

            var sidebar = new Sidebar(openSettings);

            if (Framework.Settings.Instance.StartHidden)
            {
                sidebar.Opacity = 0;
            }
            sidebar.Show();
            RefreshIcon();
        }