I have a label and a textfield and it will display two different values.
if(a != null && b == null) {
return "a";
}
else if(a == null && b != null) {
return "b";
}
The logic is quite simple, but how to fit this in xaml and mvvm-pattern? I have a viewmodel and a view (xaml-ui). The code should propably be placed in the viewmodel.
Youe mean to say…. you want to diplay a for first condition and b for second condition ??
if Thats true…
then ..
Make a property with Property chnaged notification in your ViewModel
Code inside your ViewModel
Binding in XAML
Dont forget to implement INotifyPropertyChanged in Setter of property.
Call the validation function when required.