Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
As far as I remember, you can add the x:Name="name" attribute, which will automatically generate a namespace member with the same name.
That is, for example, there is a button:
And in the code:
There is also an id attribute, but there is a problem with getting and then ghosting the type. I don't remember this way yet...
But as far as I know, it's bad practice within WPF. It is better to use the built-in WPF features: events, commands.
<Button x:Name="btn1"/>
btn1.Value = "Hello, World!";
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question