public void SetKeyboardLayoutControl(VirtualKeyboardControl parent, FrameworkElement keyboardLayoutControl) { FrameworkElement oldKeyboardControl = _keyboardLayoutControl; _keyboardLayoutControl = null; if (oldKeyboardControl != null) { oldKeyboardControl.CleanupAndDispose(); } if (keyboardLayoutControl == null) { return; } keyboardLayoutControl.Context = parent; keyboardLayoutControl.LogicalParent = this; keyboardLayoutControl.VisualParent = this; keyboardLayoutControl.SetScreen(Screen); keyboardLayoutControl.SetElementState(_elementState); if (IsAllocated) { keyboardLayoutControl.Allocate(); } _keyboardLayoutControl = keyboardLayoutControl; InvalidateLayout(true, true); }
public void SetKeyboardLayoutControl(VirtualKeyboardControl parent, FrameworkElement keyboardLayoutControl) { FrameworkElement oldKeyboardControl = _keyboardLayoutControl; _keyboardLayoutControl = null; if (oldKeyboardControl != null) oldKeyboardControl.CleanupAndDispose(); if (keyboardLayoutControl == null) return; keyboardLayoutControl.Context = parent; keyboardLayoutControl.LogicalParent = this; keyboardLayoutControl.VisualParent = this; keyboardLayoutControl.SetScreen(Screen); keyboardLayoutControl.SetElementState(_elementState); if (IsAllocated) keyboardLayoutControl.Allocate(); _keyboardLayoutControl = keyboardLayoutControl; InvalidateLayout(true, true); }