public VMMainMenu() { Exit = new MVVMCommand(p => { App.Current.Shutdown(0); }); OpenLoggingWindow = new MVVMCommand(p => { new LogWindow().Show(); }); OpenUpdateLogs = new MVVMCommand(p => MainWindowBus.ShowSlice(new UpdateLog(), "Farewell under the stars")); OpenSettings = new MVVMCommand(p => new SettingsWindow().ShowDialog()); UpdateCheck = new MVVMCommand(P => MainWindowBus.Info("wtf")); OpenOSInformation = new MVVMCommand(p => MainWindowBus.ShowSlice(new OpenSourceInformation(), "Open Source")); OpenShell = new MVVMCommand(p => { ProcessStartInfo info = new ProcessStartInfo { WorkingDirectory = Adb.AdbToolsDir.FullName, FileName = "cmd", UseShellExecute = false, Verb = "runas", }; info.EnvironmentVariables["ANDROID_ADB_SERVER_PORT"] = Adb.Server.Port.ToString(); if (Properties.Settings.Default.EnvVarCmdWindow) { var pathEnv = info.EnvironmentVariables["path"]; info.EnvironmentVariables["path"] = $"{Adb.AdbToolsDir.FullName};" + pathEnv; } if (Properties.Settings.Default.StartCmdAtDesktop) { info.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); } info.FileName = p?.ToString() ?? "cmd.exe"; Process.Start(info); }); }
public PeopleViewModel() { People = new ObservableCollection <PersonViewModel>() { new PersonViewModel(new Person() { Id = 1, FirstName = "Tareq", LastName = "Jehad" }), new PersonViewModel(new Person() { Id = 2, FirstName = "Ahmad", LastName = "Mohammad" }), new PersonViewModel(new Person() { Id = 3, FirstName = "Visual", LastName = "Studio" }), new PersonViewModel(new Person() { Id = 4, FirstName = "MVVM", LastName = "Way" }) }; DeleteCommand = new MVVMCommand(Delete, CanDelete); NewCommand = new MVVMCommand(New); }
public VmCars() { layerService = new LayerService(); Cars = new ObservableCollection <Auto>(); Aktualisieren(); GuiRefresh = new MVVMCommand((para) => Aktualisieren(), (para) => { return(true); }); }
public VMPerson() { handler = new MQHandler <PersonenBeschreibung>("entries"); handlerDelete = new MQHandler <PersonenBeschreibung>("entriesDelete"); handlerUpdate = new MQHandler <PersonenBeschreibung>("entriesUpdate"); client = new ServiceReference1.MeinTollerServiceClient(); clientFileWriter = new FileWriterService.FileWriteServiceClient(); this.Personen = client.getPersonenBeschreibung(); BtnWrite = new MVVMCommand((param) => { WriteToQueue(); }, (param) => { return(true); }); BtnUpdate = new MVVMCommand((param) => { updatePersonen(); }, (param) => { return(true); }); BtnDeleteById = new MVVMCommand((param) => { deleteById(param); }, (param) => { return(true); }); BtnUpdateById = new MVVMCommand((param) => { updateById(param); }, (param) => { return(true); }); }
public VMMainTabs() { if (IsDesignMode()) { return; } ClosingTab = new MVVMCommand(p => { var e = (CancelRoutedEventArgs)p; var tabController = (ITabController)e.OriginalSource; e.Cancel = !tabController.OnClosing(); }); TabClosed = new MVVMCommand(p => { var tabController = ((p as RoutedEventArgs).OriginalSource as ITabController); tabController?.OnClosed(); }); }
public VMAbout() { UpdateCheck = new MVVMCommand((p) => OpenFxManager.RunExtension("EAutumnBoxUpdateChecker")); }