public ClassificationsPageViewModel(ICommentConfiguration config, IDialogService dialogService) { Config = config; DialogService = dialogService; foreach (var cls in Config.Classifications) { Classifications.Add(new ClassificationViewModel(cls, this)); } AddCommand = new RelayCommand(ShowNewClassificationDialog); }
public EtiquetarDocumentoViewModel() { Classifications.Add(new FO_Item { Nombre = "CL1 - MAHLE public", id = 1 }); Classifications.Add(new FO_Item { Nombre = "CL2 - MAHLE internal", id = 2 }); Classifications.Add(new FO_Item { Nombre = "CL3 - MAHLE confidential", id = 3 }); Classifications.Add(new FO_Item { Nombre = "CL4 - MAHLE strictly confidential", id = 4 }); Positions.Add(new FO_Item { Nombre = "Izquierda - Abajo", id = 1, Descripcion = "/Images/Classification/position1.PNG" }); Positions.Add(new FO_Item { Nombre = "Izquierda - Centro", id = 2, Descripcion = "/Images/Classification/position2.PNG" }); Positions.Add(new FO_Item { Nombre = "Izquierda - Arriba", id = 3, Descripcion = "/Images/Classification/position3.PNG" }); Positions.Add(new FO_Item { Nombre = "Arriba - Izquierda ", id = 4, Descripcion = "/Images/Classification/position4.PNG" }); Positions.Add(new FO_Item { Nombre = "Arriba - Centro", id = 5, Descripcion = "/Images/Classification/position5.PNG" }); Positions.Add(new FO_Item { Nombre = "Arriba - Derecha", id = 6, Descripcion = "/Images/Classification/position6.PNG" }); Positions.Add(new FO_Item { Nombre = "Derecha - Arriba", id = 7, Descripcion = "/Images/Classification/position7.PNG" }); Positions.Add(new FO_Item { Nombre = "Derecha - Centro", id = 8, Descripcion = "/Images/Classification/position8.PNG" }); Positions.Add(new FO_Item { Nombre = "Derecha - Abajo", id = 9, Descripcion = "/Images/Classification/position9.PNG" }); Positions.Add(new FO_Item { Nombre = "Abajo - Izquierda", id = 10, Descripcion = "/Images/Classification/position10.PNG" }); Positions.Add(new FO_Item { Nombre = "Abajo - Centro", id = 11, Descripcion = "/Images/Classification/position11.PNG" }); Positions.Add(new FO_Item { Nombre = "Abajo - Derecha", id = 12, Descripcion = "/Images/Classification/position12.PNG" }); }
public void ShowNewClassificationDialog() { var newCls = new Classification(); var newClsVm = new ClassificationViewModel(newCls, this); var dialogVm = new ClassificationDetailsDialogViewModel(newClsVm, "New Classification", DialogType.AddNew); var isOk = DialogService.OpenDialog(dialogVm); if (isOk) { Classifications.Add(newClsVm); Config.Classifications.Add(newCls); } }