Ejemplo n.º 1
0
        void PlayWithCooperatingLibrary()
        {
            var coopViewModel = new CoopViewModel();

            var proxyFactory = new ProxyFactory();
            var proxy = proxyFactory.CreateProxy<CoopViewModel>(new ViewModelInvokeWrapper<CoopViewModel>(coopViewModel), typeof(IViewModel));

            // When using coopViewModel directly, the bindings are updated correctly, when using the proxy the binding update breaks
            var view = new CoopView(coopViewModel /* proxy */);
            var win = new Window { Topmost = true, Content = view, SizeToContent = SizeToContent.WidthAndHeight };
             win.Show();
        }
Ejemplo n.º 2
0
 public CoopView(CoopViewModel coopViewModel)
     : this()
 {
     DataContext = _viewModel = coopViewModel;
     _viewModel.InitializeCommand();
 }