Beispiel #1
0
 public TextBoxBase()
 {
     this.editBox = Global.FrameProvider.CreateFrame(FrameType.EditBox) as IEditBox;
     this.editBox.SetScript(FrameHandler.OnUpdate, this.OnUpdateHandler);
     this.editBox.SetScript(EditBoxHandler.OnTextChanged, this.OnTextChangedHandler);
     this.editBox.SetScript(EditBoxHandler.OnArrowPressed, this.OnArrowPressedHandler);
     this.editBox.SetScript(EditBoxHandler.OnEnterPressed, this.OnEnterPressedHandler);
     this.editBox.SetScript(EditBoxHandler.OnTabPressed, this.OnTabPressedHandler);
     this.editBox.SetScript(EditBoxHandler.OnEscapePressed, this.OnEscapePressedHandler);
     this.editBox.SetScript(EditBoxHandler.OnCursorChanged, this.OnCursorChangedHandler);
 }
        private void EditBox_Loaded(object sender, RoutedEventArgs e)
        {
            this.Loaded -= EditBox_Loaded;

            _ViewModel = DataContext as IEditBox;

            if (_ViewModel != null)
            {
                // Link to show notification pop-up message event
                _ViewModel.ShowNotificationMessage += ViewModel_ShowNotificationMessage;
                _ViewModel.RequestEdit             += ViewModel_RequestEdit;
            }
        }
 public void notify(IEditBox editbox, float temp)
 {
     if (editbox == fEditBox)
     {
         cEditBox.update(Utils.convertFC(temp));
         tempBar.display(temp);
     }
     else
     {
         float tmp = Utils.convertCF(temp);
         fEditBox.update(tmp);
         tempBar.display(tmp);
     }
 }
Beispiel #4
0
        /// <summary>
        /// Method is invoked when the datacontext is changed.
        /// This requires changing event hook-up on attached viewmodel to enable
        /// notification event conversion from viewmodel into view.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (this.mViewModel != null)
            {
                this.mViewModel.ShowNotificationMessage -= ViewModel_ShowNotificationMessage;
                this.mViewModel.RequestEdit             -= ViewModel_RequestEdit;
            }

            this.mViewModel = e.NewValue as IEditBox;

            if (this.mViewModel != null)
            {
                // Link to show notification pop-up message event
                this.mViewModel.ShowNotificationMessage += ViewModel_ShowNotificationMessage;
                this.mViewModel.RequestEdit             += ViewModel_RequestEdit;
            }
        }
        private void ChangeViewModelLink(IEditBox viewmodel, bool destroyEvents = false)
        {
            if (_ViewModel != null)
            {
                _ViewModel.ShowNotificationMessage -= ViewModel_ShowNotificationMessage;
                _ViewModel.RequestEdit             -= ViewModel_RequestEdit;
            }

            _ViewModel = viewmodel;

            if (_ViewModel != null)
            {
                // Link to show notification pop-up message event
                _ViewModel.ShowNotificationMessage += ViewModel_ShowNotificationMessage;
                _ViewModel.RequestEdit             += ViewModel_RequestEdit;
            }
            else
            {
                if (destroyEvents == false)
                {
                    Console.WriteLine("----> VIEW Cannot find IEditBox interface.");
                }
            }
        }
Beispiel #6
0
 public TabableEditBox(IEditBox editBox)
 {
     this.editBox = editBox;
 }
Beispiel #7
0
 public KeyboardInputSimulator()
 {
     this.editBox = GlobalFrames.CurrentFocus;
 }
 public void setcEditBox(IEditBox cEditBox)
 {
     this.cEditBox = cEditBox;
 }
 public void setfEditBox(IEditBox fEditBox)
 {
     this.fEditBox = fEditBox;
 }