Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Edited Issue: PropertyGrid should not bind directly to SelectedObject.Name [19305]

$
0
0
Binding directly to __SelectedObject.Name__ like done in __PropertyGrid/Themes/Generic.xaml__ causes WPF 4 to emit binding errors (visible in Visual Studio Output window) when the type bound to __PropertyGrid.SelectedObject__ does not contain a __Name__ property:
```
(Setter Property="SelectedObjectName"
Value="{Binding RelativeSource={RelativeSource Self},
Path=SelectedObject.Name,
FallbackValue={StaticResource EmptyString}}" /)
```
Solution for this issue is to use __PriorityBinding__ instead of a __FallbackValue__ :
```
(Setter Property="SelectedObjectName")
(Setter.Value)
(PriorityBinding)
(Binding Path="SelectedObject.Name"
RelativeSource="{RelativeSource Self}" /)
(Binding Source="{x:Static sys:String.Empty}" /)
(/PriorityBinding)
(/Setter.Value)
(/Setter)
```
Sorry, due to the limitations of this editor I cannot use angle brackets here - using parentheses instead.
Comments: ** Comment from web user: BoucherS **

Hi,

this is fixed in v2.1.


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>