How to have default value for TextBlock bound to domain data RRS feed

  • Question

  • I have some textblocks bound to the SelectedItem of my domain context.

    The problem is that these textblocks are blank if the user is not logged in yet.

    When the user logs in, the get function in the domain class executes and selects a set of domain records depending on who has logged in.

    Is there a way they (the textblocks) can have a default value string if the user is not logged in yet?



    siegfried heintze

    Saturday, July 27, 2013 10:51 PM

All replies

  • If you textblock is bounded to string property then assign default value to its field then it will be displayed as default text.

    example is as follows

    private string someProperty = "Default value";

    public string SomeProperty {

    get { return someProperty;} 

    set { someProperty = value ;}


    Thanks & Regards
    Syed Amjad Sr. Silverlight/WPF Developer,
    yahoo : syedamjad6736@yahoo.com, skype : syedamjad.0786.
    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Wednesday, August 5, 2015 11:25 AM