Exemplo n.º 1
0
        public DoubleDataInputDialogViewModel(ref InputDialogData data)
        {
            Data = data;

            _OkCmd     = new RelayCommand(OnOkCmd);
            _CancelCmd = new RelayCommand(OnCancelCmd);
        }
        public DoubleDataInputDialog(ref InputDialogData data)
        {
            InitializeComponent();
            this.DataContext = new DoubleDataInputDialogViewModel(ref data);

            CommandBinding Cb0         = new CommandBinding(_Cmd0, RunCommand_0);
            CommandBinding Cb1         = new CommandBinding(_Cmd1, RunCommand_1);
            CommandBinding Cb2         = new CommandBinding(_Cmd2, RunCommand_2);
            CommandBinding Cb3         = new CommandBinding(_Cmd3, RunCommand_3);
            CommandBinding Cb4         = new CommandBinding(_Cmd4, RunCommand_4);
            CommandBinding Cb5         = new CommandBinding(_Cmd5, RunCommand_5);
            CommandBinding Cb6         = new CommandBinding(_Cmd6, RunCommand_6);
            CommandBinding Cb7         = new CommandBinding(_Cmd7, RunCommand_7);
            CommandBinding Cb8         = new CommandBinding(_Cmd8, RunCommand_8);
            CommandBinding Cb9         = new CommandBinding(_Cmd9, RunCommand_9);
            CommandBinding CbShortLine = new CommandBinding(_CmdShortLine, RunCommand_ShortLine);
            CommandBinding CbPoint     = new CommandBinding(_CmdPoint, RunCommand_Point);
            CommandBinding CbBackSpace = new CommandBinding(_CmdBackSpace, RunCommand_BackSpace);

            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb0);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb1);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb2);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb3);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb4);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb5);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb6);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb7);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb8);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), Cb9);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), CbShortLine);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), CbPoint);
            CommandManager.RegisterClassCommandBinding(typeof(DoubleDataInputDialog), CbBackSpace);

            Messenger.Default.Register <bool>(this, "DoubleDataInputDialogQuitMsg", msg =>
            {
                this.Close();
            });
        }