public override IScriptCommand Execute(FileExplorer.ParameterDic pm) { IWindowManager wm = pm.GetValue <IWindowManager>(WindowManagerKey) ?? new WindowManager(); WPF.MDI.MdiContainer container = pm.GetValue <WPF.MDI.MdiContainer>(MdiContainerKey); if (container == null) { return(ResultCommand.Error(new KeyNotFoundException("MdiContainerKey"))); } IExplorerViewModel explorer = pm.GetValue <IExplorerViewModel>(ExplorerKey); if (explorer == null) { return(ResultCommand.Error(new KeyNotFoundException("ExplorerKey"))); } var view = new ExplorerView(); Caliburn.Micro.Bind.SetModel(view, explorer); //Set the ViewModel using this command. var mdiChild = new WPF.MDI.MdiChild { DataContext = explorer, ShowIcon = true, Content = view }; mdiChild.SetBinding(WPF.MDI.MdiChild.TitleProperty, new Binding("DisplayName") { Mode = BindingMode.OneWay }); mdiChild.SetBinding(WPF.MDI.MdiChild.IconProperty, new Binding("CurrentDirectory.Icon") { Mode = BindingMode.OneWay }); mdiChild.SetBinding(WPF.MDI.MdiChild.WidthProperty, new Binding("Parameters.Width") { Mode = BindingMode.TwoWay }); mdiChild.SetBinding(WPF.MDI.MdiChild.HeightProperty, new Binding("Parameters.Height") { Mode = BindingMode.TwoWay }); mdiChild.SetBinding(WPF.MDI.MdiChild.PositionProperty, new Binding("Parameters.Position") { Mode = BindingMode.TwoWay }); container.Children.Add(mdiChild); return(NextCommand); }
public override IScriptCommand Execute(FileExplorer.ParameterDic pm) { var ivm = pm.GetValue <ItemViewModel>(ItemKey); ivm.Value += Delta; return(NextCommand); }
public override IScriptCommand Execute(FileExplorer.ParameterDic pm) { var rvm = pm.GetValue <RootViewModel>(RootKey); rvm.Items.Clear(); return(NextCommand); }