public VmServerListPage(VmMain vmMain) { Debug.Assert(vmMain != null); Vm = vmMain; var lastSelectedGroup = ""; if (!string.IsNullOrEmpty(SystemConfig.Instance.Locality.MainWindowTabSelected)) { lastSelectedGroup = SystemConfig.Instance.Locality.MainWindowTabSelected; } RebuildVmServerCardList(); GlobalData.Instance.ServerList.CollectionChanged += (sender, args) => { RebuildVmServerCardList(); }; SystemConfig.Instance.General.PropertyChanged += (sender, args) => { if (args.PropertyName == nameof(SystemConfig.General.ServerOrderBy)) { RebuildVmServerCardList(); } }; if (!string.IsNullOrEmpty(lastSelectedGroup) && ServerGroupList.Contains(lastSelectedGroup)) { SelectedGroup = lastSelectedGroup; } }
public VmSystemConfigPage(VmMain vmMain) { Host = vmMain; // create new SystemConfigGeneral object SystemConfig = SystemConfig.Instance; }