Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting binding failures
Message
From
18/12/2009 12:55:29
 
 
To
All
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Detecting binding failures
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01439787
Message ID:
01439787
Views:
90
Hi,
Given, say, this binding in XAML:
<TextBox Width="200" Text="{Binding Path=SelectedItem.Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
where 'SelectedItem' may or may not have a 'Text' property.

It would be ideal to have some method of binding the 'IsEnabled' property so that the control was disabled if the binding fails but I can't think of a way of implementing this in a generic sort of way (I can't even find a way of detecting when the binding fails except by programatically monitoring the Trace - which is kludgy at best and certainly not something to use in production code)

Any suggestions?
Viv
Next
Reply
Map
View

Click here to load this message in the networking platform