예제 #1
0
        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);
                    }
                }));
        }
예제 #2
0
 public TestTankView(TestTankViewModel model)
     : this()
 {
     this.Model = model;
     this.DataContext = model;
 }