Ejemplo n.º 1
0
        public IntroductionWindow()
        {
            InitializeComponent();

            IKeyboardCapture kb = new LockoutKeyboardCapture(Key.Space);
            var contianer       = ServiceLocator.Current.GetInstance <CompositionContainer>();

            contianer.ComposeExportedValue(kb);
        }
Ejemplo n.º 2
0
        public ClueWindow()
        {
            InitializeComponent();
            _kb = ServiceLocator.Current.GetInstance <IKeyboardCapture>() as LockoutKeyboardCapture;
            _kb.PropertyChanged += _kb_PropertyChanged;
            DataContext          = this;

            // TODO: start timer?
        }
Ejemplo n.º 3
0
        /// <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>();
        }