public void CreateView(ObjectCreated notification) { Panel.Dispatcher.Invoke(new Action(() => { if (notification.GameObject is TestTank) { var model = new TestTankViewModel((TestTank)notification.GameObject); TestTankView view = new TestTankView(model); Panel.Children.Add(view); Views.Add(notification.GameObject, view); } })); }
public TestTankView(TestTankViewModel model) : this() { this.Model = model; this.DataContext = model; }