コード例 #1
0
        public static async Task <WindowsMediaSpeechRecognizer> CreateAsync(Windows.UI.Xaml.Window window)
        {
            SpeechRecognizer sr = null;

            foreach (var item in Windows.System.UserProfile.GlobalizationPreferences.Languages)
            {
                var language = new Language(item);
                try {
                    sr = new SpeechRecognizer(language);
                    break;
                } catch (Exception ex) {
                    Debug.WriteLine(ex);
                }
            }

            if (sr is null)
            {
                sr = new SpeechRecognizer();
            }

            var d = new WindowsMediaSpeechRecognizer(sr);

            Debug.WriteLine($"SpeechRecognizer Language: { sr.CurrentLanguage.DisplayName}");

            sr.ContinuousRecognitionSession.AutoStopSilenceTimeout = TimeSpan.MaxValue;
            await sr.CompileConstraintsAsync();

            sr.ContinuousRecognitionSession.ResultGenerated += d.ContinuousRecognitionSession_ResultGenerated;
            await sr.ContinuousRecognitionSession.StartAsync();

            window.Activated += d.Window_Activated;

            return(d);
        }
コード例 #2
0
 public static void Navigate(Type typeOfPage)
 {
     Windows.UI.Xaml.Window window = Windows.UI.Xaml.Window.Current;
     if (window != null)
     {
         Windows.UI.Xaml.Controls.Frame frame = window.Content as Windows.UI.Xaml.Controls.Frame;
         if (frame != null)
         {
             frame.Navigate(typeOfPage);
         }
     }
 }
コード例 #3
0
 public void goToPage(Type page)
 {
     Windows.UI.Xaml.Window window = Windows.UI.Xaml.Window.Current;
     if (window != null)
     {
         Windows.UI.Xaml.Controls.Frame frame = window.Content as Windows.UI.Xaml.Controls.Frame;
         if (frame != null)
         {
             frame.Navigate(page);
         }
     }
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: perssondan/platformtest
        public Game(Windows.UI.Xaml.Window current)
        {
            _colliderSystem            = new ColliderSystem(_eventSystem);
            _moveSystem                = new MoveSystem();
            _physicsSystem             = new PhysicsSystem(_eventSystem);
            _inputSystem               = new InputSystem(_eventSystem);
            _graphicsSystem            = new GraphicsSystem(_eventSystem);
            _particleSystem            = new ParticleSystem();
            _playerSystem              = new PlayerSystem(_eventSystem);
            _dustParticleEmitterSystem = new DustParticleEmitterSystem(_eventSystem, _dustEntityFactory);
            _particleEmitterSystem     = new ParticleEmitterSystem(_dustEntityFactory);

            _inputSystem.Current = current;
        }
コード例 #5
0
ファイル: MainViewModel.cs プロジェクト: tovitch/IntraTek
        private void loginButtonAction()
        {
            var content = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair <string, string>("login", UserLogin),
                new KeyValuePair <string, string>("password", UserPassword)
            });

            if (WebRequest.Instance.GetAccessToken(content, UserLogin) == true)
            {
                Windows.UI.Xaml.Window window = Windows.UI.Xaml.Window.Current;
                if (window != null)
                {
                    Windows.UI.Xaml.Controls.Frame frame = window.Content as Windows.UI.Xaml.Controls.Frame;
                    if (frame != null)
                    {
                        frame.Navigate(typeof(UserPage));
                    }
                }
            }
        }
コード例 #6
0
 internal bool SetTarget(Windows.UI.Xaml.Window xamlWindow)
 {
     // Uno specific: Actual Mica is not yet supported on any target.
     return(false);
 }
コード例 #7
0
 public static void Use(Windows.UI.Xaml.Window mainWindow)
 {
     DemoUtilities.Init();
     DemoUtilitiesImplementation.Init(mainWindow);
 }