private void InitializeWindowConfig() { var width = wConfig.GetAttribute("Width"); if (width != null) { this.Width = float.Parse(width); } var height = wConfig.GetAttribute("Height"); if (height != null) { this.Height = float.Parse(height); } var wState = wConfig.GetAttribute("WindowState"); if (wState != null) { this.WindowState = wState == "Maximized" ? WindowState.Maximized : WindowState.Normal; } this.Closing += delegate(object sender, System.ComponentModel.CancelEventArgs e) { wConfig.SetAttribute("Width", this.Width.ToString()); wConfig.SetAttribute("Height", this.Height.ToString()); wConfig.SetAttribute("WindowState", this.WindowState.ToString()); wConfig.Write(); SaveFoldState(); }; }
private void SaveFoldState() { foreach (var nav in Navigator.Children) { if (nav is NavigatorView) { GetcollapseStyle((NavigatorView)nav, foldState); } } foldState.Write(); }