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 GetcollapseStyle(NavigatorView nav, AttributeParser foldState, int deep = 0) { var prefix = ""; for (int i = 0; i < deep; i++) { prefix += '\t'; } var expended = nav.SubPagesContainer.Visibility == Visibility.Visible; foldState.SetAttribute(prefix + nav.Name.Content.ToString(), expended.ToString()); foreach (var subNav in nav.SubPagesContainer.Children) { if (subNav is NavigatorView) { GetcollapseStyle((NavigatorView)subNav, foldState, deep + 1); } } }