| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- using GeekDesk.Util;
- using System;
- using System.Collections.ObjectModel;
- using System.ComponentModel;
- using System.Windows;
- namespace GeekDesk.ViewModel
- {
- [Serializable]
- public class MenuInfo : INotifyPropertyChanged
- {
-
- private string menuName;
- private string menuId;
- private Visibility menuEdit = Visibility.Collapsed;
- private Visibility notMenuEdit = Visibility.Visible;
- private ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
- public string MenuName
- {
- get
- {
- return menuName;
- }
- set
- {
- menuName = value;
- OnPropertyChanged("MenuName");
- }
- }
- public string MenuId
- {
- get
- {
- return menuId;
- }
- set
- {
- menuId = value;
- OnPropertyChanged("MenuId");
- }
- }
- public Visibility MenuEdit
- {
- get
- {
- return menuEdit;
- }
- set
- {
- menuEdit = value;
- if (menuEdit == Visibility.Visible)
- {
- NotMenuEdit = Visibility.Collapsed;
- } else
- {
- NotMenuEdit = Visibility.Visible;
- }
- OnPropertyChanged("MenuEdit");
- }
- }
- public Visibility NotMenuEdit
- {
- get
- {
- return notMenuEdit;
- }
- set
- {
- notMenuEdit = value;
- 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));
- CommonCode.SaveAppData(MainWindow.appData);
- }
- }
- }
|