void OnDisposing()
        {
            MVVMContext.RegisterXtraMessageBoxService();
            var context = MVVMContext.FromControl(this);

            if (context != null)
            {
                context.Dispose();
            }
        }
コード例 #2
0
        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());
        }
コード例 #3
0
 public QueryPane()
 {
     InitializeComponent();
     HookupEvents();
     SetupGridButtons();
     if (!mvvmContextQueryControl.IsDesignMode)
     {
         mvvmContextQueryControl.ViewModelSet += MvvmContextQueryControlOnViewModelSet;
     }
     MVVMContext.RegisterXtraMessageBoxService();
     ApplyGridLayout();
 }
コード例 #4
0
        //TODO this is just plain nasty, clean it up
        public ConnectionWindowView()
        {
            InitializeComponent();
            if (!mvvmContextConnectionWindowView.IsDesignMode)
            {
                InitializeBindings();
            }
            MVVMContext.RegisterXtraMessageBoxService();

            HackControls();
            HookupEvents();
        }
コード例 #5
0
ファイル: WFSettings.cs プロジェクト: ftlab/CheckList
        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();
        }
コード例 #6
0
        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");
        }
コード例 #7
0
ファイル: MachineViewModel.cs プロジェクト: liyangTeam/WSXCut
 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
        }
コード例 #9
0
ファイル: SettingsView.cs プロジェクト: dragnilar/Databvase
 private void RegisterServices()
 {
     mvvmContextSettingsView.RegisterService(new FontDialogService());
     MVVMContext.RegisterXtraMessageBoxService();
 }
コード例 #10
0
 private void RegisterService()
 {
     MVVMContext.RegisterXtraMessageBoxService();
 }