示例#1
0
        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;
            }
        }
示例#2
0
 public VmSystemConfigPage(VmMain vmMain)
 {
     Host = vmMain;
     // create new SystemConfigGeneral object
     SystemConfig = SystemConfig.Instance;
 }