暂时可简单使用
This commit is contained in:
@@ -14,10 +14,24 @@ namespace GeekDesk.ViewModel
|
||||
private double windowWidth = (double)DefaultConstant.WINDOW_WIDTH; //窗口宽度
|
||||
private double windowHeight = (double)DefaultConstant.WINDOW_HEIGHT; //窗口高度
|
||||
private double menuCardWidth = (double)DefaultConstant.MENU_CARD_WIDHT;//菜单栏宽度
|
||||
private int selectedMenuIndex = 0; //上次选中菜单索引
|
||||
|
||||
|
||||
|
||||
#region GetSet
|
||||
public int SelectedMenuIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return selectedMenuIndex;
|
||||
}
|
||||
set
|
||||
{
|
||||
selectedMenuIndex = value;
|
||||
OnPropertyChanged("SelectedMenuIndex");
|
||||
}
|
||||
}
|
||||
|
||||
public int MenuSortType
|
||||
{
|
||||
get
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace GeekDesk.ViewModel
|
||||
class AppData : INotifyPropertyChanged
|
||||
{
|
||||
private ObservableCollection<MenuInfo> menuList = new ObservableCollection<MenuInfo>();
|
||||
private Dictionary<string, ObservableCollection<IconInfo>> iconMap = new Dictionary<string, ObservableCollection<IconInfo>>();
|
||||
private AppConfig appConfig = new AppConfig();
|
||||
|
||||
public ObservableCollection<MenuInfo> MenuList
|
||||
@@ -25,18 +24,6 @@ namespace GeekDesk.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<string, ObservableCollection<IconInfo>> IconMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return iconMap;
|
||||
}
|
||||
set
|
||||
{
|
||||
iconMap = value;
|
||||
OnPropertyChanged("IconMap");
|
||||
}
|
||||
}
|
||||
|
||||
public AppConfig AppConfig
|
||||
{
|
||||
|
||||
@@ -116,6 +116,21 @@ namespace GeekDesk.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public int ImageHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return imageHeight;
|
||||
}
|
||||
set
|
||||
{
|
||||
imageHeight = value;
|
||||
OnPropertyChanged("ImageHeight");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[field: NonSerializedAttribute()]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -12,17 +13,13 @@ namespace GeekDesk.ViewModel
|
||||
[Serializable]
|
||||
class MenuInfo : INotifyPropertyChanged
|
||||
{
|
||||
[field: NonSerializedAttribute()]
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
|
||||
private string menuName;
|
||||
private string menuId;
|
||||
private int menuEdit = (int)Visibility.Collapsed;
|
||||
private int notMenuEdit = (int)Visibility.Visible;
|
||||
private ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
|
||||
|
||||
public string MenuName
|
||||
{
|
||||
@@ -82,5 +79,25 @@ namespace GeekDesk.ViewModel
|
||||
OnPropertyChanged("NotMenuEdit");
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<IconInfo> IconList
|
||||
{
|
||||
get
|
||||
{
|
||||
return iconList;
|
||||
}
|
||||
set
|
||||
{
|
||||
iconList = value;
|
||||
OnPropertyChanged("IconList");
|
||||
}
|
||||
}
|
||||
|
||||
[field: NonSerializedAttribute()]
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user