beta
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace GeekDesk.ViewModel
|
||||
@@ -7,11 +8,11 @@ namespace GeekDesk.ViewModel
|
||||
[Serializable]
|
||||
class AppData : INotifyPropertyChanged
|
||||
{
|
||||
private List<string> menuList = new List<string>();
|
||||
private Dictionary<string, List<IconInfo>> iconMap = new Dictionary<string, List<IconInfo>>();
|
||||
private ObservableCollection<MenuInfo> menuList = new ObservableCollection<MenuInfo>();
|
||||
private Dictionary<string, ObservableCollection<IconInfo>> iconMap = new Dictionary<string, ObservableCollection<IconInfo>>();
|
||||
private AppConfig appConfig = new AppConfig();
|
||||
|
||||
public List<string> MenuList
|
||||
public ObservableCollection<MenuInfo> MenuList
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -24,7 +25,7 @@ namespace GeekDesk.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<string, List<IconInfo>> IconMap
|
||||
public Dictionary<string, ObservableCollection<IconInfo>> IconMap
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using GeekDesk.Constant;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Windows.Media.Imaging;
|
||||
@@ -15,6 +16,8 @@ namespace GeekDesk.ViewModel
|
||||
private BitmapImage bitmapImage; //位图
|
||||
private byte[] imageByteArr; //图片 base64
|
||||
private string content; //显示信息
|
||||
private int imageWidth = (int)DefaultConstant.IMAGE_WIDTH;
|
||||
private int imageHeight = (int)DefaultConstant.IMAGE_HEIGHT;
|
||||
|
||||
public int Count
|
||||
{
|
||||
@@ -100,6 +103,19 @@ namespace GeekDesk.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public int ImageWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return imageWidth;
|
||||
}
|
||||
set
|
||||
{
|
||||
imageWidth = value;
|
||||
OnPropertyChanged("ImageWidth");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[field: NonSerializedAttribute()]
|
||||
|
||||
86
ViewModel/MenuInfo.cs
Normal file
86
ViewModel/MenuInfo.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
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;
|
||||
|
||||
public string MenuName
|
||||
{
|
||||
get
|
||||
{
|
||||
return menuName;
|
||||
}
|
||||
set
|
||||
{
|
||||
menuName = value;
|
||||
OnPropertyChanged("MenuName");
|
||||
}
|
||||
}
|
||||
|
||||
public string MenuId
|
||||
{
|
||||
get
|
||||
{
|
||||
return menuId;
|
||||
}
|
||||
set
|
||||
{
|
||||
menuId = value;
|
||||
OnPropertyChanged("MenuId");
|
||||
}
|
||||
}
|
||||
|
||||
public int MenuEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return menuEdit;
|
||||
}
|
||||
set
|
||||
{
|
||||
menuEdit = value;
|
||||
if (menuEdit == (int)Visibility.Visible)
|
||||
{
|
||||
NotMenuEdit = (int)Visibility.Collapsed;
|
||||
} else
|
||||
{
|
||||
NotMenuEdit = (int)Visibility.Visible;
|
||||
}
|
||||
OnPropertyChanged("MenuEdit");
|
||||
}
|
||||
}
|
||||
|
||||
public int NotMenuEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return notMenuEdit;
|
||||
}
|
||||
set
|
||||
{
|
||||
notMenuEdit = value;
|
||||
OnPropertyChanged("NotMenuEdit");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace GeekDesk.ViewModel
|
||||
{
|
||||
class MenuViewModel
|
||||
{
|
||||
|
||||
public MenuViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ObservableCollection<Menu> GetMenus()
|
||||
{
|
||||
ObservableCollection<Menu> menus = new ObservableCollection<Menu>();
|
||||
menus.Add(new Menu() { menu = "test1" });
|
||||
menus.Add(new Menu() { menu = "test2" });
|
||||
menus.Add(new Menu() { menu = "test3" });
|
||||
return menus;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class Menu
|
||||
{
|
||||
public string menu { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user