void OnDisposing() { MVVMContext.RegisterXtraMessageBoxService(); var context = MVVMContext.FromControl(this); if (context != null) { context.Dispose(); } }
private void InitBindings() { MVVMContext.RegisterXtraMessageBoxService(); MVVMContext.RegisterXtraDialogService(); mvvmContext1.ViewModelType = typeof(BusinessPartnerViewModel); var fluentAPI = mvvmContext1.OfType <BusinessPartnerViewModel>(); //mvvmContext1.RegisterService(new NewAgentFrm()); mvvmContext1.RegisterService(SplashScreenService.Create(splashScreenManager1)); fluentAPI.SetBinding(gridControl1, gv => gv.DataSource, x => x.Agents); fluentAPI.WithEvent <ColumnView, FocusedRowObjectChangedEventArgs>(gridView1, "FocusedRowObjectChanged") .SetBinding(x => x.SelectedAgent, args => args.Row as Agent, (gView, entity) => { gView.FocusedRowHandle = gView.FindRow(entity); if (entity != null) { gpcPush.Enabled = entity.bit_synPush; gpcQuery.Enabled = entity.bit_synQuery; gpcSync.Enabled = entity.bit_synOpen; } }); fluentAPI.SetBinding(txtAgentName, x => x.EditValue, x => x.SelectedAgent.vchar_AGname); fluentAPI.SetBinding(txtContactor, x => x.EditValue, x => x.SelectedAgent.vchar_AGLinkMan); fluentAPI.SetBinding(txtContactNum, x => x.EditValue, x => x.SelectedAgent.vchar_AGcontect); fluentAPI.SetBinding(txtAgentCode, x => x.EditValue, x => x.SelectedAgent.vchar_AGcode); fluentAPI.SetBinding(txtAgentType, x => x.EditValue, x => x.SelectedAgent.int_AGtype); fluentAPI.SetBinding(cbxOpenSyncServer, x => x.EditValue, x => x.SelectedAgent.bit_synOpen); fluentAPI.SetBinding(cbxSearchService, x => x.EditValue, x => x.SelectedAgent.bit_synQuery); fluentAPI.SetBinding(cbxOpenPushServer, x => x.EditValue, x => x.SelectedAgent.bit_synPush); fluentAPI.SetBinding(txtVerifyCode, x => x.EditValue, x => x.SelectedAgent.vchar_synVerify); fluentAPI.SetBinding(txtSearchVerifyCode, x => x.EditValue, x => x.SelectedAgent.vchar_QueryVerify); fluentAPI.SetBinding(txtPushServerVerifyCode, x => x.EditValue, x => x.SelectedAgent.vchar_PushVerify); fluentAPI.SetBinding(txtPushUser, x => x.EditValue, x => x.SelectedAgent.vchar_PushUser); fluentAPI.SetBinding(txtKeyWords, x => x.EditValue, x => x.SelectedAgent.vchar_synStopKeyWord); fluentAPI.SetBinding(txtSyncTimSpan, x => x.EditValue, x => x.SelectedAgent.int_synSpacing); fluentAPI.BindCommand(btnAdd, x => x.AddAgentInfo()); fluentAPI.BindCommand(btnDelete, x => x.DeleteSelectedAgent()); fluentAPI.BindCommand(btnSave, x => x.SaveAgentInfo()); fluentAPI.SetBinding(gpcSync, x => x.Enabled, x => x.IsGPCSync); fluentAPI.SetBinding(gpcQuery, x => x.Enabled, x => x.IsGPCQuery); fluentAPI.SetBinding(gpcPush, x => x.Enabled, x => x.IsGPCPush); fluentAPI.WithEvent <EventArgs>(txtAgentType, "SelectedIndexChanged").EventToCommand(x => x.AgentTypeChanged()); }
public QueryPane() { InitializeComponent(); HookupEvents(); SetupGridButtons(); if (!mvvmContextQueryControl.IsDesignMode) { mvvmContextQueryControl.ViewModelSet += MvvmContextQueryControlOnViewModelSet; } MVVMContext.RegisterXtraMessageBoxService(); ApplyGridLayout(); }
//TODO this is just plain nasty, clean it up public ConnectionWindowView() { InitializeComponent(); if (!mvvmContextConnectionWindowView.IsDesignMode) { InitializeBindings(); } MVVMContext.RegisterXtraMessageBoxService(); HackControls(); HookupEvents(); }
public static void Init() { WindowsFormsSettings.ForceDirectXPaint(); WindowsFormsSettings.EnableFormSkins(); WindowsFormsSettings.DefaultLookAndFeel.SetSkinStyle(SkinSvgPalette.Bezier.DarkTurquoise); var fs = WindowsFormsSettings.DefaultFont.Size; WindowsFormsSettings.DefaultFont = new System.Drawing.Font("Segoe UI", fs); MVVMContext.RegisterXtraMessageBoxService(); MVVMContext.RegisterOpenFileDialogService(); MVVMContext.RegisterSaveFileDialogService(); }
public ManualViewModel() { MVVMContext.RegisterXtraMessageBoxService(); OperationEngine.Instance.OnLaserEnabled += Engine_OnLaserEnabled; OperationEngine.Instance.OnBlowingEnabled += Engine_OnBlowingEnabled; OperationEngine.Instance.OnFollowEnabled += Engine_OnFollowEnabled; Messenger.Default.Register <object>(this, "OperStatusChanged", this.OnOperStatusChanged); Messenger.Default.Register <object>(this, "SetCoordinate", x => this.SwichContext(0)); var coordinatePara = SystemContext.CoordinatePara; var p = coordinatePara.MarkSeries[0]; var color = this.colorMap[0]; Messenger.Default.Send <object>(Tuple.Create(p, color), "MarkFlagChanged"); }
public MachineViewModel() { MVVMContext.RegisterXtraMessageBoxService(); Messenger.Default.Register <object>(this, "ReceiveDataProvider", this.OnDataProviderReceive); Messenger.Default.Register <object>(this, "ReceiveDrawObjectsCnt", this.OnDrawObjectsCntReceive); Messenger.Default.Register <object>(this, "DataProviderChanged", this.OnDataProviderChanged); Messenger.Default.Register <bool>(this, "OnManualMovement", this.OnManualMovement); Messenger.Default.Register <object>(this, "OnOperationTrigger", this.OnOperationTrigger); Messenger.Default.Register <object>(this, "AutoSuspend", this.OnAutoSuspend); OperationEngine.Instance.OnFinishOnce += () => { Messenger.Default.Send <object>(null, "ClearMark"); Messenger.Default.Send <object>(null, "OnMachineOnce"); }; OperationEngine.Instance.OnLog += Engine_OnLog; }
public XtraMessageBoxServiceUserControl() { InitializeComponent(); #region SetUp MVVMContext mvvmContext = new MVVMContext(); mvvmContext.ContainerControl = this; SimpleButton commandButton = new SimpleButton(); commandButton.Text = "Execute Command"; commandButton.Dock = DockStyle.Top; commandButton.Parent = this; #endregion SetUp #region #xtraMessageBoxService // Force use the XtraMessageBoxService MVVMContext.RegisterXtraMessageBoxService(); // mvvmContext.ViewModelType = typeof(SayHelloViewModel); // UI binding for button mvvmContext.BindCommand <SayHelloViewModel>(commandButton, x => x.SayHello()); #endregion #xtraMessageBoxService }
private void RegisterServices() { mvvmContextSettingsView.RegisterService(new FontDialogService()); MVVMContext.RegisterXtraMessageBoxService(); }
private void RegisterService() { MVVMContext.RegisterXtraMessageBoxService(); }