void RemoveInternalFocus() { if (_internalFocus) { //Notify the system that this edit context is no longer in focus _editContext.NotifyFocusLeave(); RemoveInternalFocusWorker(); } }
/* * ボタンがフォーカスを喪失した。 */ private void OverlappedButton_LostFocus(object sender, RoutedEventArgs e) { Debug.WriteLine("<<--- Button LostFocus"); if (DesignMode.DesignModeEnabled) { // ビューデザイナーの中で動作している場合は何もしない。 return; } // グリッドの外枠を灰色にしてフォーカスの喪失を視覚的にユーザーに示します。 MainGrid.BorderBrush = new SolidColorBrush(Colors.Gray); if (editContext != null) { // IMEにフォーカスの喪失を知らせます。 Debug.WriteLine("--->> NotifyFocusLeave"); editContext.NotifyFocusLeave(); } }
/* * ボタンがフォーカスを喪失した。 */ private void OverlappedButton_LostFocus(object sender, RoutedEventArgs e) { Debug.WriteLine("<<--- Button LostFocus"); if (DesignMode.DesignModeEnabled) { // ビューデザイナーの中で動作している場合は何もしない。 return; } if (editContext != null) { // IMEにフォーカスの喪失を知らせます。 Debug.WriteLine("--->> NotifyFocusLeave"); editContext.NotifyFocusLeave(); } // 再描画します。 Win2DCanvas.Invalidate(); }