private void ButtonPressUp(ButtonAndKey button)
 {
     if (button != null)
     {
         button.IsKeyPressed = false;
     }
 }
 /// <summary>
 /// Поиск нажатой визуальной кнопки (соответствующей физической клавише).
 /// </summary>
 /// <param name="lastKeyPressed">Последняя нажатая физическая кнопка.</param>
 private void SearchForAPressedVisualButton(Key lastKeyPressed)
 {
     if (this.blockButtons.Visibility == Visibility.Visible)
     {
         this.currentPressedButton = SearchingVisualButtons(this.blockButtons, lastKeyPressed);
     }
     else if (this.blockButtonsWithShift.Visibility == Visibility.Visible)
     {
         this.currentPressedButton = SearchingVisualButtons(this.blockButtonsWithShift, lastKeyPressed);
     }
     else if (this.blockButtonsWithCapsLock.Visibility == Visibility.Visible)
     {
         this.currentPressedButton = SearchingVisualButtons(this.blockButtonsWithCapsLock, lastKeyPressed);
     }
     else if (this.blockButtonsWithCapsLockWithShift.Visibility == Visibility.Visible)
     {
         this.currentPressedButton = SearchingVisualButtons(this.blockButtonsWithCapsLockWithShift, lastKeyPressed);
     }
 }