0

So I have a UserControl that is used to play a video. This control is displayed as an overlay of other controls. The controls behind the UC with the video player have a Back button that allows the user to move around the UI. The problem is that when the video is playing, the user can still use the keyboard to navigate to the back button, and then interact with the UI. What I need is this:

When the video is playing, the keyboard should essentially be disabled. If that's not possible, I need to disable to the user from pressing the Tab key (or having the Tab key do anything) while the video is playing.

Any thoughts?

Will Custode
  • 4,576
  • 3
  • 26
  • 51
  • 1
    have you tried IsTabStop=false. – yo chauhan Mar 04 '13 at 16:18
  • Can you just throw in the logic to make the object or the whole UC IsHitTestVisible=False when the video is playing? – Chris W. Mar 04 '13 at 16:32
  • IsTabStop would not solve the problem because I need to disable all navigation, and not just one item. And with IsHitTestVisible, won't that do the opposite? Making everything but my video UC focused? – Will Custode Mar 04 '13 at 16:40
  • http://msdn.microsoft.com/en-us/library/system.windows.uielement.ishittestvisible.aspx – Chris W. Mar 04 '13 at 16:55
  • Oh and for reference, you might specify whether what you're doing is winrt or wpf in your questions. http://stackoverflow.com/questions/7697414/winrt-and-wpf-in-windows-8 – Chris W. Mar 04 '13 at 17:10
  • Thanks, it's specified in the title that it's WinRT. And the article posted about IsHitTestVisible only furthers my point that this will disable my control, and not anything else. – Will Custode Mar 04 '13 at 19:00
  • wpf is in your tags, and IsHitTestVisible is inherited by all children of a parent, so when applied to your Window, or UC, or however you're displaying your buttons etc, it disables everything included all at once when invoked with the playing of the video. Might be worth some further investigation of the docs. Best of luck :) – Chris W. Mar 05 '13 at 03:14
  • Thanks everyone for the advice. I found a workaround that just throws away keystrokes while the popup is displayed. The biggest problem with the codebase I just stepped into is that it's not MVVM so it's difficult to manage everything. :/ – Will Custode Mar 05 '13 at 15:38

0 Answers0