public OnScreenKeyBoard()
        {
            KeyboardViewModel vm = new KeyboardViewModel(this);

            DataContext = vm;
            InitializeComponent();
            AppKeyboard = this;

            vm.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(vm.IsEnabled))
                {
                    bool newIsEnabled = vm.IsEnabled;
                    if (newIsEnabled)
                    {
                        VisualStateManager.GoToState(this, CommonStates.States[1].Name, true);
                    }
                    else
                    {
                        VisualStateManager.GoToState(this, CommonStates.States[0].Name, true);
                    }
                }
            };
        }
Example #2
0
 public KeyboardViewModel(OnScreenKeyBoard container)
 {
     this.container = container;
     KeyModel.theKeyboardViewModel = this;
 }