I code C# WPF in MVVM pattern and want to create graphic figure programmatically using code like
Ellipse el = new Ellipse();
el.Width = 50;
el.Height = 50;
el.VerticalAlignment = VerticalAlignment.Top;
el.Fill = Brushes.Green;
el.Stroke = Brushes.Red;
el.StrokeThickness = 3;
grid1.Children.Add(el);
Should this code be in Model or in ViewModel? If in Model, what should I write in ViewModel? Thanks.
Aucun commentaire:
Enregistrer un commentaire