/// <summary> /// Creates a new instance of a room view model /// </summary> public RoomVM(string RoomName, int RoomNumber) { InitializeCommands(); StripViewModel = new StripVM() { RoomNumber = RoomNumber }; PanelViewModel = new PanelVM() { RoomNumber = RoomNumber }; // Subscribe room to view model's properties StripViewModel.PropertyChanged += Shelving_PropertyChanged; PanelViewModel.PropertyChanged += Shelving_PropertyChanged; ShelfViewModel.PropertyChanged += Shelving_PropertyChanged; AccessoryViewModel.PropertyChanged += Shelving_PropertyChanged; DataSet dataset = new DataSet(); dataset.ReadXml("StripColorData.xml"); StripColorData = dataset.Tables[0]; dataset = new DataSet(); dataset.ReadXml("ShelvingDepthData.xml"); ShelvingDepthData = dataset.Tables[0]; dataset = new DataSet(); dataset.ReadXml("WoodData.xml"); WoodData = dataset.Tables[0]; Room = new Model.Room(RoomName, RoomNumber) { WoodColorValues = new ObservableCollection <string>(GetWoodColorVales()), StripColorValues = new ObservableCollection <string>(GetStripColorValues()), ShelvingDepthValues = new ObservableCollection <string>(GetShelvingDepthValues()) }; Room.PropertyChanged += Room_PropertyChanged; }
/// <summary> /// Creates a new instance to a duplicate strip command /// </summary> /// <param name="viewmodel">Reference to the view model</param> public DuplicateStripCommand(StripVM viewmodel) { this.viewmodel = viewmodel; }
/// <summary> /// Creates a new instance of a remove command /// </summary> /// <param name="viewmodel"></param> public RemoveCommand(StripVM viewmodel) { this.viewmodel = viewmodel; }
/// <summary> /// Creates a new instance of a add command /// </summary> /// <param name="viewmodel">Reference to the view model</param> public AddCommand(StripVM viewmodel) { this.viewmodel = viewmodel; }