本文整理汇总了C#中MainWindowViewModel类的典型用法代码示例。如果您正苦于以下问题:C# MainWindowViewModel类的具体用法?C# MainWindowViewModel怎么用?C# MainWindowViewModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MainWindowViewModel类属于命名空间,在下文中一共展示了MainWindowViewModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)));
}
开发者ID:dermeister0,项目名称:helix-toolkit,代码行数:7,代码来源:MainWindow.xaml.cs
示例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;
}
开发者ID:hh54188,项目名称:King,代码行数:26,代码来源:MainWindow.xaml.cs
示例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();
}
开发者ID:c0a5tar,项目名称:Mystique,代码行数:7,代码来源:ColumnOwnerViewModel.cs
示例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();
}
开发者ID:ZERUELX,项目名称:GestionDocumental20140711,代码行数:9,代码来源:PantallaInicioViewModel.cs
示例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);
}
开发者ID:yuriik83,项目名称:OPC-UA-OOI,代码行数:7,代码来源:MainWindowViewModelUnitTest.cs
示例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();
}
开发者ID:axs221,项目名称:TaskDash,代码行数:31,代码来源:MainWindow.xaml.cs
示例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);
}
开发者ID:ananse23,项目名称:EsriWPF,代码行数:7,代码来源:MainWindowViewModelTest.cs
示例8: MainWindow
public MainWindow()
{
MainWindowViewModel viewModel = new MainWindowViewModel();
this.DataContext = viewModel;
InitializeComponent();
this.Closing += viewModel.OnWindowClosing;
}
开发者ID:egormozzharov,项目名称:packageManager,代码行数:7,代码来源:MainWindow.xaml.cs
示例9: uvSaleOrderManagementViewModel
public uvSaleOrderManagementViewModel(MainWindowViewModel pMainWindowViewModel)
: base(pMainWindowViewModel)
{
SearchCommand = new RelayCommand(Search);
OpenOrderCommand = new RelayCommand<OrderEntity>(OpenOrder);
ClearSearch();
}
开发者ID:locdht,项目名称:MyVinaGerman,代码行数:7,代码来源:uvSaleOrderManagementViewModel.cs
示例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;
}
开发者ID:digitalnelson,项目名称:BrainLab,代码行数:26,代码来源:MainWindow.xaml.cs
示例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);
}
开发者ID:Davipb,项目名称:XKCDReader,代码行数:7,代码来源:MainWindowTests.cs
示例12: GetAllUsersUICommand
public GetAllUsersUICommand(MainWindowViewModel mainWindowViewModel, CommandExecutor commandExecutor, QueryExecutor queryExecutor, RequestExecutor requestExecutor)
: base(commandExecutor, queryExecutor, requestExecutor)
{
Argument.IsNotNull(mainWindowViewModel, "mainWindowViewModel");
_mainWindowViewModel = mainWindowViewModel;
}
开发者ID:vipinyadav08,项目名称:Pragmatic,代码行数:7,代码来源:GetAllUsersUICommand.cs
示例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);
}
开发者ID:ssickles,项目名称:archive,代码行数:28,代码来源:StartPageVM_Tests.cs
示例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);
}
开发者ID:ssickles,项目名称:archive,代码行数:26,代码来源:StartPageVM_Tests.cs
示例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);
}
开发者ID:changhongfu,项目名称:TDDKata,代码行数:7,代码来源:MainWindowViewModelTest.cs
示例16: ProjectDetailsViewModel
public ProjectDetailsViewModel(Project project, MainWindowViewModel mainWindow)
{
_project = project;
_mainWindow = mainWindow;
SetTabTitle();
}
开发者ID:stuartleyland,项目名称:GreenPadMvvm,代码行数:7,代码来源:ProjectDetailsViewModel.cs
示例17: MainWindow
public MainWindow()
{
InitializeComponent();
viewModel = new MainWindowViewModel(this);
DataContext = viewModel;
SetUpAnimations();
}
开发者ID:nuc134r,项目名称:CinemaTicketOffice,代码行数:8,代码来源:MainWindow.xaml.cs
示例18: Window_Loaded
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;
}
开发者ID:md74671,项目名称:HoneyDew,代码行数:8,代码来源:MainWindow.xaml.cs
示例19: MainWindow
public MainWindow()
{
var viewModel = new MainWindowViewModel();
DataContext = viewModel;
InitializeComponent();
}
开发者ID:Hakan77,项目名称:ArticleFinder,代码行数:8,代码来源:MainWindow.xaml.cs
示例20: MainWindow
public MainWindow()
{
InitializeComponent();
DataContext = new MainWindowViewModel(
BoardControl,
new PuzzleSolverTaskFactory(),
new WpfTimer());
}
开发者ID:taylorjg,项目名称:SudokuDlx,代码行数:8,代码来源:MainWindow.xaml.cs
注:本文中的MainWindowViewModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论