Example #1
0
        private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
        {
            // Hook up x:Bind source.
            global::Microsoft.Toolkit.Wpf.UI.XamlHost.WindowsXamlHost windowsXamlHost =
                sender as global::Microsoft.Toolkit.Wpf.UI.XamlHost.WindowsXamlHost;
            global::App1.SpeakerWithSMTC userControl =
                windowsXamlHost.GetUwpInternalObject() as global::App1.SpeakerWithSMTC;

            if (userControl != null)
            {
                speechSynthesizer = new SpeechSynthesizer(userControl);
            }
        }
        public SpeechSynthesizer(global::App1.SpeakerWithSMTC speaker)
        {
            this.speaker = speaker;

            //windowsXamlHost = new WindowsXamlHost();

            //var a = windowsXamlHost.Parent;

            //using(new WindowsXamlHost())
            //{
            //    speaker = new App1.SpeakerWithSMTC();

            //}
            // windowsXamlHost.InitialTypeName = typeof(App1.SpeakerWithSMTC).FullName;
        }