Exemplo n.º 1
0
        public RibbonDialogServiceUserControl()
        {
            InitializeComponent();
            #region SetUp
            MVVMContext mvvmContext = new MVVMContext();
            mvvmContext.ContainerControl = this;

            SimpleButton commandButton = new SimpleButton();
            commandButton.Text = "Execute Command";
            commandButton.Dock = DockStyle.Top;

            MemoEdit memo = new MemoEdit();
            memo.Dock = DockStyle.Top;
            memo.Properties.ReadOnly = true;
            memo.MinimumSize         = new System.Drawing.Size(0, 100);

            commandButton.Parent = this;
            memo.Parent          = this;

            #endregion SetUp

            #region #ribbonDialogService
            // Force use the RibbonDialogService
            MVVMContext.RegisterRibbonDialogService();
            //
            mvvmContext.ViewModelType = typeof(NotesViewModel);
            // UI binding for Notes
            mvvmContext.SetBinding(memo, m => m.EditValue, "Notes");
            // UI binding for button
            mvvmContext.BindCommand <NotesViewModel>(commandButton, x => x.EditNotes());
            #endregion #ribbonDialogService
        }