Then I modify "ProductName" and press "Cancel" button property is reset to passed parameter. But if i modify ProgramIds (add, or delete) and press "Cancel" button collection no set to passed. Why?
I have in ViewModel:
[Model]
[Catel.Fody.Expose("ProductName")]
[Catel.Fody.Expose("ProgramIds")]
Public ProgramDataModel DataModel
{
get { return GetValue<ProgramDataModel>(DataModelProperty); }
set { SetValue(DataModelProperty, value); }
}
In Model:
public string ProductName
{
get { return GetValue<string>(ProductNameProperty); }
set { SetValue(ProductNameProperty, value); }
}
public static readonly PropertyData ProductNameProperty = RegisterProperty(nameof(ProductName), typeof(string));
public ObservableCollection<ProgramIDModel> ProgramIds
{
get { return GetValue<ObservableCollection<ProgramIDModel>>(ProgramIdsProperty); }
set { SetValue(ProgramIdsProperty, value); }
}
public static readonly PropertyData ProgramIdsProperty = RegisterProperty(nameof(ProgramIds), typeof(ObservableCollection<ProgramIDModel>));
In MainViewModel:
var viewModel = new ProductWindowViewModel(DataViewModel);
await _uiVisualizerService.ShowDialogAsync(viewModel);