I have a TabControl with six tabs in my ResultView. The ViewModel that sits behind this View can be either a ResultTypeOneViewModel or ResultTypeTwoViewModel, each of which deri
To answer your question directly, you can use the ObjectDataProvider
to call a method for you so you can work with the results:
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:Windows="clr-namespace:System.Windows;assembly=PresentationCore"
...
0
You should then be able to access the result like this (but you'd need one of these for each TabItem
):
However, it's generally not good practice to manipulate UI properties such as Visibility
in code, so a better idea would be to use a BooleanToVisibilityConverter
to Bind
the Visibility
properties to bool
values as @Highcore suggested. You can see an example of this in the Binding a Button Visibility to bool value in ViewModel post here on StackOverflow.
In my opinion, an even better solution would be to simply provide one view for every view model.