I'm new to WPF so pardon me if i'm asking something stupid. I have an class named Person in my application. Can i do something like
<local:Person x:Key="p" BirthYear="{Binding Path=Value, ElementName=year}" />
where 'year' is a control?
I'm new to WPF so pardon me if i'm asking something stupid. I have an class named Person in my application. Can i do something like
<local:Person x:Key="p" BirthYear="{Binding Path=Value, ElementName=year}" />
where 'year' is a control?
you are probably better off inverting your binding and binding the control to your class
<Control Value="{Binding Path=BirthYear}" DataContext="{StaticResource p}"/>
No, you can't because resources are not part of the same naming container (and are added differently to the visual tree).
Why do you need to store a Person (business object I assume) as a resource, but having its value coming from another control? Maybe if you explain your motivation we can help you find a better alternative.