Using WPF I was able to get the path of a {Binding} bound property through the BindingExpression. In UWP is there a way to determine which property is bound using the {x:Bind} syntax? I need to discover which properties are bound to which controls. I Understand that there is no BindingExpression with {x:Bind}. Is there another way to map between a control and it's bound property?
Asked
Active
Viewed 280 times
0
-
Could you please tell me what the purpose of getting the property which bound to a control? It seems no approach to get the path information when using {x:Bind} extension. If you do want to get the path information, you could also using {Binding} extension in UWP. – YanGu Mar 29 '21 at 07:09
-
@YanGu - It is necessary to know what property path is bound, to perform validation and then set focus to the input control associated with the invalid data. FYI: the question was general for UWP, but is a use case for Project Reunion 0.5 WinUI. – Randall B Mar 29 '21 at 17:39
1 Answers
1
{x:Bind} extension is directive executed at design time to generate code to register event handlers and explicitly set the relevant properties, bypassing the {Binding} registration that uses reflection at runtime, so at runtime there is no way to detect or get a handler to the binding statement from an {x:Bind} because there is none.

YanGu
- 3,006
- 1
- 3
- 7