public void CreatorTestMethod1() { MainWindowViewModel _vm = new MainWindowViewModel(); Assert.IsFalse(_vm.MulticastGroupSelection); Assert.IsNull(_vm.DebugGetMulticastGroupIPAddress()); Assert.AreEqual<string>("239.255.255.1", _vm.MulticastGroup); }
public void SearchCustomersCommand_Test() { MainWindowViewModel mainWindowVM = new MainWindowViewModel(); mainWindowVM.Workspaces.Add(new AddEditCustomerViewModel()); mainWindowVM.Workspaces.Add(new SearchCustomersViewModel()); //MainWindowViewModel.Workspaces starts out //with a StartPageViewModel already present Assert.AreEqual(mainWindowVM.Workspaces.Count(), 3); //Now remove all the current SearchCustomersViewModel //from the list of Workspaces in MainWindowViewModel var searchCustomersVM = mainWindowVM.Workspaces.Where(x => x.GetType() == typeof(SearchCustomersViewModel)).FirstOrDefault(); mainWindowVM.Workspaces.Remove(searchCustomersVM); Assert.AreEqual(mainWindowVM.Workspaces.Count(), 2); //Create a new StartPageViewModel and test its SearchCustomersCommand //is able to add a new Workspace item to the MainWindowViewModel StartPageViewModel startPageVM = new StartPageViewModel(); //Test SearchCustomersCommand : Should be able //to add a new AddEditCustomerViewModel startPageVM.SearchCustomersCommand.Execute(null); Assert.AreEqual(mainWindowVM.Workspaces.Count(), 3); }
public void CheckNoMoreWorkSpacesCanBeAdded() { MainWindowViewModel mainWindowVM = new MainWindowViewModel(); mainWindowVM.Workspaces.Add(new AddEditCustomerViewModel()); mainWindowVM.Workspaces.Add(new SearchCustomersViewModel()); //MainWindowViewModel.Workspaces starts out //with a StartPageViewModel already present Assert.AreEqual(mainWindowVM.Workspaces.Count(), 3); //Create a new StartPageViewModel and test its command //to ensure that they do no effect the number of workspace //items in the MainWindowViewModel StartPageViewModel startPageVM = new StartPageViewModel(); //Test AddCustomerCommand : Should not be able //to add a new AddEditCustomerViewModel startPageVM.AddCustomerCommand.Execute(null); Assert.AreEqual(mainWindowVM.Workspaces.Count(), 3); //Test SearchCustomersViewModel : Should not be able //to add a new SearchCustomersViewModel startPageVM.SearchCustomersCommand.Execute(null); Assert.AreEqual(mainWindowVM.Workspaces.Count(), 3); }
public uvSaleOrderManagementViewModel(MainWindowViewModel pMainWindowViewModel) : base(pMainWindowViewModel) { SearchCommand = new RelayCommand(Search); OpenOrderCommand = new RelayCommand<OrderEntity>(OpenOrder); ClearSearch(); }
public void AddComic_UserCancels_DoesntAddComic() { var viewModel = new MainWindowViewModel(new MockInteractionService(), new MockComicService(null), new MockPropertiesService()); viewModel.AddComicCommand.Execute(null); Assert.IsFalse(viewModel.Comics.Count > 0); }
public MainWindow() { this.InitializeComponent(); var vm = new MainWindowViewModel(this.view1.Viewport); this.DataContext = vm; this.view1.InputBindings.Add(new MouseBinding(vm.SelectionCommand, new MouseGesture(MouseAction.LeftClick))); }
public MainWindow() { MainWindowViewModel viewModel = new MainWindowViewModel(); this.DataContext = viewModel; InitializeComponent(); this.Closing += viewModel.OnWindowClosing; }
public ColumnOwnerViewModel(MainWindowViewModel parent) { this.Parent = parent; this.CurrentFocusColumn = CreateColumn(); Setting.Instance.StateProperty.TabPropertyProvider = () => Columns.Select(cvm => cvm.TabItems.Select(s => s.TabProperty)); RegisterKeyAssign(); }
public ProjectDetailsViewModel(Project project, MainWindowViewModel mainWindow) { _project = project; _mainWindow = mainWindow; SetTabTitle(); }
public void Setup() { _dataService = new Mock<IDataService>(); _mapControl = new Mock<IMapControl>(); _dataService.Setup(x => x.GeneralQuery<BlocTBE>(It.IsAny<ITable>(), string.Empty)).Returns(new List<BlocTBE>() {new BlocTBE() {NoBloc = "abc"}}); _viewModel = new MainWindowViewModel<TestListViewModel, TestEntityViewModel>(_dataService.Object, _mapControl.Object); }
public void HasCommandsForViewAllCustomerAndCreateNewCustomer_WhenCreated() { var model = new MainWindowViewModel(); var commands = model.Commands.ToArray(); Assert.AreEqual("View all customers", commands[0].DisplayName); Assert.AreEqual("Create new customer", commands[1].DisplayName); }
public MainWindow() { InitializeComponent(); InitializeUserControlViews(); _viewModel = new MainWindowViewModel(this, _taskListView, _taskDetailsView); DataContext = _viewModel; _notificationManager = new NotificationManager(_viewModel); _notificationManager.Start(); _viewModel.Search(); _saveService = new SaveService(_viewModel.Tasks); _saveService.Start(); _controlCycle = new List<Control> { _viewModel.UserControlViewList.ListBoxTasks, _viewModel.ViewDetails.ListBoxItems, _viewModel.ViewDetails.ListBoxLogs }; SetParentWindow(); }
public MainWindow() { InitializeComponent(); // Set up user prefs for file locations _txtRegionFile.Text = DataStore.AppPrefs.RoiFilePath; _txtSubjectFile.Text = DataStore.AppPrefs.SubjectfilePath; _txtDataFolder.Text = DataStore.AppPrefs.DataFileDir; _txtOutputFolder.Text = DataStore.AppPrefs.OutputDir; // Set up last window location and size if (DataStore.AppPrefs.WindowLocation != null && DataStore.AppPrefs.WindowLocation.Width != 0.0d && DataStore.AppPrefs.WindowLocation.Height != 0.0d) { this.Left = DataStore.AppPrefs.WindowLocation.X; this.Top = DataStore.AppPrefs.WindowLocation.Y; this.Width = DataStore.AppPrefs.WindowLocation.Width; this.Height = DataStore.AppPrefs.WindowLocation.Height; } // Create and connect our modules to our data manager _dataManager = new DataManager(); oComponents.SetDataManager(_dataManager); _viewModel = new MainWindowViewModel(_dataManager); this.DataContext = _viewModel; }
public GetAllUsersUICommand(MainWindowViewModel mainWindowViewModel, CommandExecutor commandExecutor, QueryExecutor queryExecutor, RequestExecutor requestExecutor) : base(commandExecutor, queryExecutor, requestExecutor) { Argument.IsNotNull(mainWindowViewModel, "mainWindowViewModel"); _mainWindowViewModel = mainWindowViewModel; }
// ***************************** ***************************** ***************************** // Constructor y carga de elementos. public PantallaInicioViewModel(MainWindowViewModel mainWindowViewModel) { this._MainWindowViewModel = mainWindowViewModel; this.Usuario = mainWindowViewModel.Usuario; this._AsuntoRepository = new GestorDocument.DAL.Repository.AsuntoRepository(); this.LoadInfoGrid(); }
public MainWindow() { InitializeComponent(); // 监听Sensor状态 // 如果状态改变,则更新视图 // 我确定一定以及肯定,sdk1.8的statusChanged事件是有问题的!! KinectSensor.KinectSensors.StatusChanged += KinectSensors_StatusChanged; // 绑定窗口级别事件, // 在打开窗口与关闭窗口时 // 分别打开与关闭Kinect this.Loaded += this.MainWindow_Loaded; this.Closing += this.MainWinow_Closed; // 绑定数据 this.viewModel = new MainWindowViewModel(); this.viewModel.CanStart = false; this.viewModel.CanStop = false; this.DataContext = this.viewModel; // 绑定点击事件 this.BUTTON_SENSOR_CLOSE.Click += BUTTON_SENSOR_CLOSE_Click; this.BUTTON_SENSOR_START.Click += BUTTON_SENSOR_START_Click; }
public MainWindow() { var viewModel = new MainWindowViewModel(); DataContext = viewModel; InitializeComponent(); }
public MainWindow() { InitializeComponent(); viewModel = new MainWindowViewModel(this); DataContext = viewModel; SetUpAnimations(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { viewModel = (MainWindowViewModel)this.DataContext; var desktopWorkingArea = System.Windows.SystemParameters.WorkArea; this.Left = desktopWorkingArea.Right - this.Width; this.Top = desktopWorkingArea.Bottom - this.Height; }
public MainWindow() { InitializeComponent(); DataContext = new MainWindowViewModel( BoardControl, new PuzzleSolverTaskFactory(), new WpfTimer()); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); MainWindow window = new MainWindow(); var viewModel = new MainWindowViewModel(); window.DataContext = viewModel; window.Show(); }
public void AddComic_Normal_SelectsAddedComic() { var result = new XKCDComic(500); var viewModel = new MainWindowViewModel(new MockInteractionService(), new MockComicService(result), new MockPropertiesService()); viewModel.AddComicCommand.Execute(null); Assert.AreEqual(viewModel.SelectedComic, result); }
public MainWindow() { InitializeComponent(); vm = DataContext as MainWindowViewModel; composite = new LivetCompositeDisposable(); ctxlistener = new PropertyChangedWeakEventListener(vm); ctxlistener.Add("AccessTokenRequest", StartAccountSelect); ctxlistener.Add("ReplyStart", ExpandNewTweet); ctxlistener.Add("ToggleNewStatus", ToggleNewTweet); ctxlistener.Add("StatusAction", (s, e) => RequestAction(vm.StatusAction.Type, vm.StatusAction.Information)); ctxlistener.Add("UserTimeline", (s, e) => AddTab("ユーザー定義タブ1", new Frame { NavigationUIVisibility = NavigationUIVisibility.Hidden, Content = new UserCustomizableTimelinePage(vm.UserTimelineViewModel) }, vm.UserTimelineViewModel)); ctxlistener.Add("StatusUpdate", (s, e) => { DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => { if (TabControlMain.SelectedIndex != 0 && setting.MainWindow.NotifyNewStatus) { EmphasisTextBlock(TextBlockTimeline); urs++; TextBlockUnreadStatuses.Text = String.Format(" {0}", urs); } })); }); ctxlistener.Add("EventUpdate", (s, e) => { DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => { if (TabControlMain.SelectedIndex != 1 && setting.MainWindow.NotifyNewNotification) { EmphasisTextBlock(TextBlockNotification); urn++; TextBlockUnreadNotifications.Text = String.Format(" {0}", urn); } })); }); composite.Add(ctxlistener); setting = Kbtter3Extension.LoadJson<Kbtter3Setting>(App.ConfigurationFileName); if (!setting.MainWindow.AllowJokeCommands) ToolBarJokes.Visibility = Visibility.Collapsed; SetShortcuts(); }
public MainWindowCommands(MainWindowViewModel viewModel) { this.viewModel = viewModel; LoadFractalCommand = new LoadFractalCommand(viewModel); SaveImageCommand = new SaveImageCommand(viewModel); CloseWindowCommand = new CloseWindowCommand(viewModel); MinimizeWindowCommand = new MinimizeWindowCommand(viewModel); }
public MainWindow() { _vm = new MainWindowViewModel(); DataContext = _vm; _logger = LogManager.GetLogger("LogFileAppender"); InitializeComponent(); Loaded += OnLoaded; }
public void RefreshCommandIsInstance(MainWindowViewModel sut) { // Fixture setup // Exercise system ICommand result = sut.RefreshCommand; // Verify outcome Assert.NotNull(result); // Teardown }
public MainWindow() { InitializeComponent(); DataContext = new MainWindowViewModel { View = this }; }
public void ProductsIsInstance(MainWindowViewModel sut) { // Fixture setup // Exercise system ObservableCollection<ProductViewModel> result = sut.Products; // Verify outcome Assert.NotNull(result); // Teardown }
public MainWindow() { InitializeComponent(); MainWindowViewModel mwvm = new MainWindowViewModel(); DataContext = mwvm; CommonViewModel cvvm = new CommonViewModel(); //DataContext = cvvm; }
public void ExecuteCloseCommandWillCloseWindow([Frozen]Mock<IWindow> windowMock, MainWindowViewModel sut, object p) { // Fixture setup // Exercise system sut.CloseCommand.Execute(p); // Verify outcome windowMock.Verify(w => w.Close()); // Teardown }
public MainWindow() { viewModel = new MainWindowViewModel(this); error = new ErrorViewModel(this); InitializeComponent(); }
// ==================================================================== // コンストラクター // ==================================================================== // -------------------------------------------------------------------- // メインコンストラクター // -------------------------------------------------------------------- public SyncDataImporter(MainWindowViewModel mainWindowViewModel, String extractFolder) { // 初期化 _mainWindowViewModel = mainWindowViewModel; Debug.Assert(extractFolder[^ 1] == '\\', "SyncDataImporter() bad extractFolder");
public MainWindow(MainWindowViewModel dataContext) { InitializeComponent(); DataContext = dataContext; }
public MainWindow() { InitializeComponent(); MainWindowViewModel = new MainWindowViewModel(); DataContext = MainWindowViewModel; }
public UpdateCommand(MainWindowViewModel mainWindowViewModel) { this.mainWindowViewModel = mainWindowViewModel; }
public FilterCommand(MainWindowViewModel mainWindowViewModel) { this.mainWindowViewModel = mainWindowViewModel; }
public MainWindow(MainWindowViewModel viewModel) { InitializeComponent(); base.DataContext = viewModel; }
public OpenEcaConnection(string connectionString, MainWindowViewModel parent) { m_connectionString = connectionString; m_parent = parent; }
/// <summary> /// Default constructor. /// </summary> public RedoCommand(MainWindowViewModel viewModel) { m_ViewModel = viewModel; }
public PinsHandler(MainWindowViewModel viewModel) : base(viewModel) { }
public MainWindow() { DataContext = new MainWindowViewModel(); InitializeComponent(); }
public MainWindow() { InitializeComponent(); _mainWindowViewModel = (MainWindowViewModel)base.DataContext; }
public ProfilFilmuView(int ID, MainWindowViewModel main) { InitializeComponent(); this.DataContext = new ProfilFilmuViewModel(ID, main); }
public PianoSheetViewModel(MainWindowViewModel main) { _main = main; }
public MainWindow() { if (WpfUtil.IsInDesignMode) { return; } if (!NTMinerConsole.IsEnabled) { NTMinerConsole.Enable(); } this.Vm = new MainWindowViewModel(); this.DataContext = Vm; this.MinHeight = 430; this.MinWidth = 640; this.Width = AppRoot.MainWindowWidth; this.Height = AppRoot.MainWindowHeight; #if DEBUG NTStopwatch.Start(); #endif ConsoleWindow.Instance.MouseDown += (sender, e) => { MoveConsoleWindow(); }; SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; this.Loaded += (sender, e) => { ConsoleTabItemTopBorder.Margin = new Thickness(0, ConsoleTabItem.ActualHeight - 1, 0, 0); MoveConsoleWindow(); hwndSource = PresentationSource.FromVisual((Visual)sender) as HwndSource; hwndSource.AddHook(new HwndSourceHook(Win32Proc.WindowProc)); }; InitializeComponent(); _leftDrawerGripWidth = LeftDrawerGrip.Width; _btnOverClockBackground = BtnOverClock.Background; // 下面几行是为了看见设计视图 this.ResizeCursors.Visibility = Visibility.Visible; this.HideLeftDrawerGrid(); // 上面几行是为了看见设计视图 DateTime lastGetServerMessageOn = DateTime.MinValue; // 切换了主界面上的Tab时 this.MainTabControl.SelectionChanged += (sender, e) => { // 延迟创建,以加快主界面的启动 #region var selectedItem = MainTabControl.SelectedItem; if (selectedItem == TabItemSpeedTable) { if (SpeedTableContainer.Child == null) { SpeedTableContainer.Child = GetSpeedTable(); } } else if (selectedItem == TabItemMessage) { if (MessagesContainer.Child == null) { MessagesContainer.Child = new Messages(); } } else if (selectedItem == TabItemToolbox) { if (ToolboxContainer.Child == null) { ToolboxContainer.Child = new Toolbox(); } } else if (selectedItem == TabItemMinerProfileOption) { if (MinerProfileOptionContainer.Child == null) { MinerProfileOptionContainer.Child = new MinerProfileOption(); } } RpcRoot.SetIsServerMessagesVisible(selectedItem == TabItemMessage); if (selectedItem == TabItemMessage) { if (lastGetServerMessageOn.AddSeconds(10) < DateTime.Now) { lastGetServerMessageOn = DateTime.Now; VirtualRoot.Execute(new LoadNewServerMessageCommand()); } } if (selectedItem == ConsoleTabItem) { ConsoleTabItemTopBorder.Visibility = Visibility.Visible; } else { ConsoleTabItemTopBorder.Visibility = Visibility.Collapsed; } #endregion }; this.IsVisibleChanged += (sender, e) => { #region if (this.IsVisible) { NTMinerContext.IsUiVisible = true; } else { NTMinerContext.IsUiVisible = false; } MoveConsoleWindow(); #endregion }; this.StateChanged += (s, e) => { #region if (Vm.MinerProfile.IsShowInTaskbar) { ShowInTaskbar = true; } else { if (WindowState == WindowState.Minimized) { ShowInTaskbar = false; } else { ShowInTaskbar = true; } } if (WindowState == WindowState.Maximized) { ResizeCursors.Visibility = Visibility.Collapsed; } else { ResizeCursors.Visibility = Visibility.Visible; } MoveConsoleWindow(); #endregion }; this.ConsoleRectangle.IsVisibleChanged += (sender, e) => { MoveConsoleWindow(); }; this.ConsoleRectangle.SizeChanged += (s, e) => { MoveConsoleWindow(); }; if (this.Width < 860) { NTMinerConsole.UserWarn("左侧面板已折叠,可点击侧边的'开始挖矿'按钮展开。"); } this.SizeChanged += (s, e) => { #region if (this.Width < 860) { this.CloseLeftDrawer(); this.BtnAboutNTMiner.Visibility = Visibility.Collapsed; } else { this.OpenLeftDrawer(); this.BtnAboutNTMiner.Visibility = Visibility.Visible; } if (!this.ConsoleRectangle.IsVisible) { if (e.WidthChanged) { ConsoleWindow.Instance.Width = e.NewSize.Width; } if (e.HeightChanged) { ConsoleWindow.Instance.Height = e.NewSize.Height; } } #endregion }; NotiCenterWindow.Bind(this, ownerIsTopmost: true); this.LocationChanged += (sender, e) => { MoveConsoleWindow(); }; VirtualRoot.BuildCmdPath <TopmostCommand>(path: message => { UIThread.Execute(() => { if (!this.Topmost) { this.Topmost = true; } }); }, this.GetType()); VirtualRoot.BuildCmdPath <UnTopmostCommand>(path: message => { UIThread.Execute(() => { if (this.Topmost) { this.Topmost = false; } }); }, this.GetType()); VirtualRoot.BuildCmdPath <CloseMainWindowCommand>(path: message => { UIThread.Execute(() => { if (message.IsAutoNoUi) { SwitchToNoUi(); } else { this.Close(); } }); }, location: this.GetType()); this.BuildEventPath <Per1MinuteEvent>("挖矿中时自动切换为无界面模式", LogEnum.DevConsole, path: message => { if (NTMinerContext.IsUiVisible && NTMinerContext.Instance.MinerProfile.IsAutoNoUi && NTMinerContext.Instance.IsMining) { if (NTMinerContext.MainWindowRendedOn.AddMinutes(NTMinerContext.Instance.MinerProfile.AutoNoUiMinutes) < message.BornOn) { VirtualRoot.ThisLocalInfo(nameof(MainWindow), $"挖矿中界面展示{NTMinerContext.Instance.MinerProfile.AutoNoUiMinutes}分钟后自动切换为无界面模式,可在选项页调整配置"); VirtualRoot.Execute(new CloseMainWindowCommand(isAutoNoUi: true)); } } }, location: this.GetType()); #if DEBUG var elapsedMilliseconds = NTStopwatch.Stop(); if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) { NTMinerConsole.DevTimeSpan($"耗时{elapsedMilliseconds} {this.GetType().Name}.ctor"); } #endif }
public OpenSettingsCommand(MainWindowViewModel vm) { _vm = vm; }
public MainViewModelHandler(MainWindowViewModel mainWindowViewModel) { this._viewModel = mainWindowViewModel; }
public SubmitNewEntryCommand(MainWindowViewModel vM) { viewModel = vM; }
public MainWindow() { InitializeComponent(); mainWindowViewModel = IocManager.Resolve <MainWindowViewModel>(); Fram_Content.NavigationUIVisibility = NavigationUIVisibility.Hidden; // IocManager.Instance.IocContainer.Register(Component.For<MainWindowViewModel>().Instance(mainWindowViewModel).LifestyleSingleton()); //注册mainwindowViewMOdel List <Menu> menus = new List <Menu> { new Menu() { IsOpen = false, Title = "首页", IsFull = true, PageType = typeof(Index), Icon = "/icon/icon001.png" }, new Menu() { IsOpen = false, ParentDefultIndex = 0, Title = "车场基础信息", Icon = "/icon/icon002.png", Menus = new Menu[] { new Menu { Title = "车场基本信息", IsSelectedParkIn = true, PageType = typeof(Pages.ParkInfo) }, new Menu { Title = "区域配置", IsSelectedParkIn = true, PageType = typeof(ParkArea) }, new Menu { Title = "停车位", IsSelectedParkIn = true, PageType = typeof(ParkCarport) }, new Menu { Title = "出入口", IsSelectedParkIn = true, PageType = typeof(BackList) }, new Menu { Title = "岗亭设置", IsSelectedParkIn = true, PageType = typeof(Pages.ParkBox) }, } }, new Menu() { IsOpen = false, Title = "车主账户设置", Icon = "/icon/icon003.png", Menus = new Menu[] { new Menu { Title = "用户管理", IsSelectedParkIn = true, PageType = typeof(Pages.UserManager) }, new Menu { Title = "免费用户", IsSelectedParkIn = true, PageType = typeof(FreeUser) }, new Menu { Title = "车位费催缴", PageType = typeof(ParkingFeeCollection) }, } }, new Menu() { IsOpen = false, ParentDefultIndex = 0, Title = "车场设备设置", Icon = "/icon/icon003.png", Menus = new Menu[] { new Menu { Title = "摄像机", IsSelectedParkIn = true, PageType = typeof(CameraManager) }, new Menu { Title = "显示屏", IsSelectedParkIn = true, PageType = typeof(LedManager) }, new Menu { Title = "收费标准", IsSelectedParkIn = true, PageType = typeof(FareRuleManager) }, } }, new Menu() { IsOpen = false, ParentDefultIndex = 0, Title = "报表相关", Icon = "/icon/icon004.png", Menus = new Menu[] { new Menu { Title = "操作明细", IsSelectedParkIn = true, PageType = typeof(OperationDetails) }, new Menu { Title = "进出场报表", IsSelectedParkIn = true, PageType = typeof(InOutReport) }, new Menu { Title = "场内车辆报表", IsSelectedParkIn = true, PageType = typeof(CarInReport) }, new Menu { Title = "收费报表", IsSelectedParkIn = true, PageType = typeof(ChargeDetails) }, new Menu { Title = "车牌修改记录", IsSelectedParkIn = true, PageType = typeof(EditCarNumberReport) }, new Menu { Title = "充值延期报表", IsSelectedParkIn = true, PageType = typeof(RechargeReport) }, new Menu { Title = "异常出入场报表", IsSelectedParkIn = true, PageType = typeof(ErrorInOutReport) }, } }, new Menu() { IsOpen = false, ParentDefultIndex = 0, Title = "系统管理", Icon = "/icon/icon005.png", Menus = new Menu[] { new Menu { Title = "用户设置", IsSelectedParkIn = true, PageType = typeof(SysUserManager) }, new Menu { Title = "系统设置", IsSelectedParkIn = true, PageType = typeof(SysSetting) }, new Menu { Title = "车类型", IsSelectedParkIn = true, PageType = typeof(CarTypeManager) }, new Menu { Title = "班次设置", IsSelectedParkIn = true, PageType = typeof(ShiftManager) }, new Menu { Title = "黑名单", IsSelectedParkIn = true, PageType = typeof(BackLisReportt) } } } }; foreach (var item in menus) { if (item.Menus != null) { foreach (var child in item.Menus) { child.Parent = item; } } } mainWindowViewModel.Menus = menus; control = new LeftMenuControl(mainWindowViewModel); control.ItemClickEventHandler += new RoutedEventHandler(MenuItemClick); Dkp_LeftMenu.Children.Add(control); DataContext = mainWindowViewModel; }
public MainWindow() { InitializeComponent(); this.viewModel = new MainWindowViewModel(); this.DataContext = viewModel; }
public MainWindow() { InitializeComponent(); ViewModel = new MainWindowViewModel(); }
public LoadingFileCommand(LoaderViewModel viewModel, MainWindowViewModel mwvm) { this.loaderViewModel = viewModel; this.mwvm = mwvm; }
public ModListDragHandler(MainWindowViewModel vm) : base() { _viewModel = vm; }
protected override void OnStartup(StartupEventArgs e) { DispatcherUtil.UIDispatcher = Dispatcher; Environment.CurrentDirectory = Path.GetDirectoryName(GetType().Assembly.Location); if (!Debugger.IsAttached) { DispatcherUnhandledException += App_DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; } base.OnStartup(e); if (e.Args.Length >= 3 && e.Args[0] == "browser") { var rLayoutEngine = e.Args[1]; var rHostProcessID = int.Parse(e.Args[2]); new BrowserWrapper(rLayoutEngine, rHostProcessID); Task.Factory.StartNew(() => { Process.GetProcessById(rHostProcessID).WaitForExit(); Process.GetCurrentProcess().Kill(); }, TaskCreationOptions.LongRunning); return; } ThemeManager.Instance.Initialize(this, Accent.Blue); CoreDatabase.Initialize(); DataService.Instance.EnsureDirectory(); RecordService.Instance.Initialize(); QuestProgressService.Instance.Initialize(); MapService.Instance.Initialize(); ExpeditionService.Instance.Initialize(); EnemyEncounterService.Instance.Initialize(); Preference.Instance.Initialize(); Preference.Instance.Reload(); StringResources.Instance.Initialize(); StringResources.Instance.LoadMainResource(Preference.Instance.Language); StringResources.Instance.LoadExtraResource(Preference.Instance.ExtraResourceLanguage); StatusBarService.Instance.Initialize(); CacheService.Instance.Initialize(); NotificationService.Instance.Initialize(); ServiceManager.Register <IBrowserService>(BrowserService.Instance); PluginService.Instance.Initialize(); Preference.Instance.Reload(); ShutdownMode = ShutdownMode.OnMainWindowClose; Task.Factory.StartNew(UpdateService.Instance.CheckForUpdate); if (e.Args.Any(r => r.OICEquals("--background"))) { return; } var rMainWindow = new MainWindow(); r_MainWindowHandle = rMainWindow.Handle; MainWindow = rMainWindow; MainWindow.DataContext = Root = new MainWindowViewModel(); MainWindow.Show(); }
public MainWindow() { //Setting a new MainWindow View Model as the datacontext of the MainWindow DataContext = new MainWindowViewModel(this); InitializeComponent(); }
public AddNewNoteViewModel(MainWindowViewModel mainWindowViewModel) { _mainWindowViewModel = mainWindowViewModel; AddNewNoteCommand = new AddNewNoteCommand(this, mainWindowViewModel); UpdateViewCommand = new UpdateViewCommand(mainWindowViewModel); }
public OpenEcaConnection(MainWindowViewModel parent) : this("server=localhost:6190;interface=0.0.0.0", parent) { }
public StartCommandWithEncryption(MainWindowViewModel MainWindowViewModel) { this.MainWindowViewModel = MainWindowViewModel; }
public MainWindow(MainWindowViewModel mainWindowViewModel) { DataContext = mainWindowViewModel; InitializeComponent(); }
public MainWindow(MainWindowViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; }