Wednesday, May 21, 2008

If you declare a read-only property as defined by the two ways below, you cannot bind a property to it by using IDE (database icon is not available in this case):

1.

private static DependencyProperty TextToDisplayProperty =

    DependencyProperty.Register("TextToDisplay", typeof(System.String), typeof(Activity1));

 

[Description("The text to output to the console")]

public string TextToDisplay

{

    get { return (string)base.GetValue(Activity1.TextToDisplayProperty); }

}

 

2.

 

private static DependencyProperty TextToDisplayProperty =

    DependencyProperty.Register("TextToDisplay", typeof(System.String), typeof(Activity1), new PropertyMetadata(DependencyPropertyOptions.ReadOnly));

 

[Description("The text to output to the console")]

public string TextToDisplay

{

    get { return (string)base.GetValue(Activity1.TextToDisplayProperty); }

    set { base.SetValue(Activity1.TextToDisplayProperty, value); }

}

 

Although there exists a crippled way to make it happen anyway here's the statement of the Microsoft Product Group :


"General guidance is that read only properties should not be bound. The UI allows it due to the bug. In dev10 we will fix this and it should no longer be possible through the designer, but probably still possible in code. Please avoid using this pattern. We know it works, but it’s not supported or tested. Anyway, we will not disable it in code, since we now know someone has a dependency on it."

.NET | WF
Wednesday, February 17, 2010 2:03:46 PM (GMT Standard Time, UTC+00:00)
Hey. In the absences of a decent time machine, fiction remains the most sturdy vehicle for visiting other eras. Help me! Looking for sites on: Split air conditioner. I found only this - <a href="http://regrumney.co.za/Members/AirConditioners">york air conditioners</a>. Air conditioners, it filters the provider on factories not attaching essential rear temperatures - which is what heating areas - to separate first, normally and only available methods that are long warm. Durbin and his gain loretta had two disruptions, christine and jennifer, and a conditioning, paul, air conditioners. Thanks for the help ;-), Cedric from Malta.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview
Latest Postings
Tags
History
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
License
Except where otherwise noted, content on this site is licensed under Creative Commons Attribution 3.0 Unported License:
Creative Commons Attribution 3.0 Unported License