Answer the question
In order to leave comments, you need to log in
How to create an element in code in MVVM?
Here I am creating a button in my VM
Button myButton = new Button();
myButton.Width = 100;
myButton.Height = 30;
myButton.Content = "Кнопка";
layoutGrid.Children.Add(myButton);
<Button Source="{Binding myButton}" />
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question