Esempio n. 1
0
        void ListViewModel_ObjectCreated(IDataObject obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }

            // Same like choose
            var mdl = DataObjectViewModel.Fetch(ViewModelFactory, DataContext, ViewModelFactory.GetWorkspace(DataContext), obj);

            Choose(new[] { mdl });
        }
Esempio n. 2
0
        private void HandleResult(object result, object callback)
        {
            IDataObject obj = result as IDataObject;

            if (obj != null && obj.Context == DataContext)
            {
                this.ViewModelFactory.ShowModel(DataObjectViewModel.Fetch(this.ViewModelFactory, DataContext, ViewModelFactory.GetWorkspace(DataContext), obj), true);
            }
            else if (result != null)
            {
                ViewModelFactory.ShowMessage(result.ToString(), "Result");
            }

            if (callback is Action)
            {
                ((Action)callback)();
            }
        }