CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • Windows 8 and NotifyOnValidationError

    rated by 0 users
    Answered (Verified) This post has 1 verified answer | 3 Replies | 2 Followers

    Top 25 Contributor
    202 Posts
    Tim posted on Mon, Sep 10 2012 9:15 PM

    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?

    Tim

    Answered (Verified) Verified Answer

    Top 10 Contributor
    9,475 Posts
    Verified by Tim

    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.

    Rocky

    All Replies

    Top 10 Contributor
    9,475 Posts
    Verified by Tim

    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.

    Rocky

    Top 25 Contributor
    202 Posts
    Tim replied on Tue, Sep 11 2012 8:30 AM

    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.

    Tim

    Top 25 Contributor
    202 Posts
    Tim replied on Tue, Sep 11 2012 3:04 PM

    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.)

    Tim

    Page 1 of 1 (4 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems