WPF MVVM Unit Tests for the ViewModel? [closed]
WPF MVVM Unit Tests for the ViewModel? [closed]
WPF MVVM Unit Tests for the ViewModel? [closed]
You can create multiple ObservableCollections and then bind your ItemsSource to a CompositeCollection which joins those collections. Then in your XAML you can create different DataTemplates for the respective types using the DataType property which like styles gets automatically applied if it is placed in the resources. (You can also create the composite in XAML … Read more
It’s OK to pass the DTO to the view. If you need to change or enhance the DTO then create a ViewModel. A common scenario would be to add links. It’s also OK for the ViewModel to reference the DTO as a complex property.
I personally prefer the nested approach for presentation because it leads to a more logical design when you use partial views. You might have a CompanyPartialView used all across the application that knows how to render a Company, so it makes a lot of sense to expose the Company as a nested structure. On the … Read more
I was also experiencing the same issue. When I debug the Action and look at the ModelState.Values[1].Errors[0].Exception for example, I see the following: {“The parameter conversion from type ‘System.String’ to type ‘System.Collections.Generic.KeyValuePair`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int64, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]’ failed because no type converter can convert between these types.”} System.Exception {System.InvalidOperationException} In my scenario, … Read more