What is the best way to go about displaying a validation error to the user for a particular field on a Windows 8 (WinRT) app?
One solution is to use the Csla.Xaml.PropertyInfo control as a data source to get at the metastate and other data about a property. Then you can bind other UI elements to that PropertyInfo control, like a tooltip, or red Rectangle or whatever you'd like.
Thanks, Rocky. Would you happen to have an example of using that in a style applicable to WinRT? I see the examples of it being used in styles in the Using series projects, but I know Triggers aren't supported in WinRT.
I have the following XAML defined for the PropertyInfo control:
<csla:PropertyInfo x:Name="piField1" Source="{Binding Model}" Property="{Binding Model.Field1}"/>
I then have the following Border element with its BorderThickness bound to the PropertyInfo's IsValid path, as follows:
<Border BorderBrush="Red" BorderThickness="{Binding ElementName=piField1, Path=IsValid, Converter={StaticResource ValidationToBorderConverter}}" Margin="0,5,0,0" >
...
</Border>
However, the BorderThicnkness binding is only triggered once when the page is first loaded. If I update the Field1 property of the BO, the BorderThickness binding never gets triggered. What am I doing wrong? (Note - "Model" is my ViewModelBase class that is set as the page's data context.)
Copyright (c) Marimer LLC