public IntroductionWindow() { InitializeComponent(); IKeyboardCapture kb = new LockoutKeyboardCapture(Key.Space); var contianer = ServiceLocator.Current.GetInstance <CompositionContainer>(); contianer.ComposeExportedValue(kb); }
public ClueWindow() { InitializeComponent(); _kb = ServiceLocator.Current.GetInstance <IKeyboardCapture>() as LockoutKeyboardCapture; _kb.PropertyChanged += _kb_PropertyChanged; DataContext = this; // TODO: start timer? }
/// <summary> /// Constructor /// </summary> public PlayMainControl() { InitializeComponent(); eventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>(); kb = ServiceLocator.Current.GetInstance <IKeyboardCapture>() as LockoutKeyboardCapture; kb.SuspendNotifications(true); cardClickToken = eventAggregator.GetEvent <PubSubEvent <ClickCard> >().Subscribe((card) => CardClick(card)); clueClickToken = eventAggregator.GetEvent <PubSubEvent <ClickClue> >().Subscribe((clue) => ClueClick(clue)); }
private void OnLoaded(object sender, RoutedEventArgs e) { //SpeechSynthesizer syn = new SpeechSynthesizer(); //var voices = syn.GetInstalledVoices(); //syn.SpeakAsync(ClueText); kb = ServiceLocator.Current.GetInstance <IKeyboardCapture>() as LockoutKeyboardCapture; kb.Reset(); kb.KeyboardNotification += KeyboardNotification; kb.PropertyChanged += Kb_PropertyChanged; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsLocked))); eventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>(); }