本文整理汇总了C#中MainWindowViewModel类的典型用法代码示例。如果您正苦于以下问题:C# MainWindowViewModel类的具体用法?C# MainWindowViewModel怎么用?C# MainWindowViewModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MainWindowViewModel类属于命名空间,在下文中一共展示了MainWindowViewModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainWindow
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)));
}
示例2: MainWindow
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;
}
示例3: ColumnOwnerViewModel
public ColumnOwnerViewModel(MainWindowViewModel parent)
{
this.Parent = parent;
this.CurrentFocusColumn = CreateColumn();
Setting.Instance.StateProperty.TabPropertyProvider = () => Columns.Select(cvm => cvm.TabItems.Select(s => s.TabProperty));
RegisterKeyAssign();
}
示例4: PantallaInicioViewModel
// ***************************** ***************************** *****************************
// 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();
}
示例5: CreatorTestMethod1
public void CreatorTestMethod1()
{
MainWindowViewModel _vm = new MainWindowViewModel();
Assert.IsFalse(_vm.MulticastGroupSelection);
Assert.IsNull(_vm.DebugGetMulticastGroupIPAddress());
Assert.AreEqual<string>("239.255.255.1", _vm.MulticastGroup);
}
示例6: MainWindow
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();
}
示例7: Setup
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);
}
示例8: MainWindow
public MainWindow()
{
MainWindowViewModel viewModel = new MainWindowViewModel();
this.DataContext = viewModel;
InitializeComponent();
this.Closing += viewModel.OnWindowClosing;
}
示例9: uvSaleOrderManagementViewModel
public uvSaleOrderManagementViewModel(MainWindowViewModel pMainWindowViewModel)
: base(pMainWindowViewModel)
{
SearchCommand = new RelayCommand(Search);
OpenOrderCommand = new RelayCommand<OrderEntity>(OpenOrder);
ClearSearch();
}
示例10: MainWindow
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;
}
示例11: AddComic_UserCancels_DoesntAddComic
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);
}
示例12: GetAllUsersUICommand
public GetAllUsersUICommand(MainWindowViewModel mainWindowViewModel, CommandExecutor commandExecutor, QueryExecutor queryExecutor, RequestExecutor requestExecutor)
: base(commandExecutor, queryExecutor, requestExecutor)
{
Argument.IsNotNull(mainWindowViewModel, "mainWindowViewModel");
_mainWindowViewModel = mainWindowViewModel;
}
示例13: SearchCustomersCommand_Test
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);
}
示例14: CheckNoMoreWorkSpacesCanBeAdded
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);
}
示例15: HasCommandsForViewAllCustomerAndCreateNewCustomer_WhenCreated
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);
}