private void MainWindow_StateChanged(object sender, EventArgs e) { LastWindowStates.Enqueue(WindowState); if (LastWindowStates.Count > 2) { LastWindowStates.Dequeue(); } }
public MainWindow() { InitializeComponent(); DPI.GetDefault(this); setting = Application.Current.LoadSetting(); FontFamily = setting.FontFamily; Title = $"{Title} [Version: {Application.Current.Version()}]"; SearchBox.ItemsSource = AutoSuggestList; #region Themem Init. CommandToggleTheme.ItemsSource = Application.Current.GetAccentColorList(); CommandToggleTheme.SelectedIndex = Application.Current.GetAccentIndex(); #endregion #region DatePicker Init. DatePicker.DisplayMode = CalendarMode.Month; DatePicker.FirstDayOfWeek = DayOfWeek.Monday; DatePicker.IsTodayHighlighted = true; DatePicker.SelectedDate = DateTime.Now; DatePicker.DisplayDate = DateTime.Now; DatePicker.DisplayDateStart = new DateTime(2007, 09, 11); DatePicker.DisplayDateEnd = DateTime.Now; DatePicker.Language = System.Windows.Markup.XmlLanguage.GetLanguage(System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag); #endregion #if DEBUG CommandAttachMetaFolder.Show(); CommandMaintainDetailPage.Show(); #else CommandAttachMetaFolder.Hide(); CommandMaintainDetailPage.Hide(); #endif Contents = new Pages.TilesPage() { Name = "CategoryTiles", FontFamily = FontFamily }; Content = Contents; NavPageTitle.Text = Contents.TargetPage.ToString(); LastWindowStates.Enqueue(WindowState.Normal); CreateNamedPipeServer(); }
public ContentWindow(string title) { InitializeComponent(); //this.GlowBrush = null; Title = string.IsNullOrEmpty(title) ? $"{GetType().Name}_{GetHashCode()}" : title; Application.Current.UpdateContentWindows(this, Title); SearchBox.ItemsSource = AutoSuggestList; //Topmost = true; ShowActivated = true; //Activate(); LastWindowStates.Enqueue(WindowState.Normal); UpdateTheme(this); }