-
I created TextBlock control with x:Name property inside .axaml, but I can't access to this control inside code (ViewModel). I found code like this:
Code like this not working as well:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
"this" is supposed to be a reference to the your view (control or window) when using FindControl. |
Beta Was this translation helpful? Give feedback.
-
Your ViewModel should not know anything about your View so the MVVM way of solving this is binding a property in your ViewModel to your TextBlock. |
Beta Was this translation helpful? Give feedback.
Your ViewModel should not know anything about your View so the MVVM way of solving this is binding a property in your ViewModel to your TextBlock.