Пример #1
0
 public AudioSettingsDialogWindow(AudioSettingsPage page)
 {
     InitializeComponent();
     mainPage                       = CreatePageFromIndex(page);
     mainPage.DataContext           = this;
     subAzureLoginPage              = new AzureVoiceLoginPage();
     subAzureLoginPage.DataContext  = this;
     subWatsonLoginPage             = new WatsonVoiceLoginPage();
     subWatsonLoginPage.DataContext = this;
     windowDisplayOption            = AudioSettingsWindowDisplayOptions.GoToMainPage;
     DataContext                    = this;
     audioSettingsDialogWindow.AllowsTransparency = true;
     audioSettingsDialogWindow.Opacity            = 0;
 }
Пример #2
0
        private Page CreatePageFromIndex(AudioSettingsPage index)
        {
            switch (index)
            {
            case AudioSettingsPage.MainSettingsPage:
                return(new AudioMainSettingsPage());

            case AudioSettingsPage.AzureLoginPage:
                AzureVoiceLoginPage loginInstance = new AzureVoiceLoginPage();
                loginInstance.key.Text = "";
                loginInstance.endpoint.SelectedIndex = -1;
                return(loginInstance);

            case AudioSettingsPage.AudioPreviewPage:
                return(new AudioPreviewPage());

            default:
                return(null);
            }
        }
        public AudioSettingsDialogWindow(AudioSettingsPage page)
        {
            InitializeComponent();
            mainPage                       = CreatePageFromIndex(page);
            mainPage.DataContext           = this;
            subAzureLoginPage              = new AzureVoiceLoginPage();
            subAzureLoginPage.DataContext  = this;
            subWatsonLoginPage             = new WatsonVoiceLoginPage();
            subWatsonLoginPage.DataContext = this;
            windowDisplayOption            = AudioSettingsWindowDisplayOptions.GoToMainPage;
            DataContext                    = this;
            audioSettingsDialogWindow.AllowsTransparency = true;
            audioSettingsDialogWindow.Opacity            = 0;

            // Add this DialogWindow's Resources to the MergedDictionaries of the pages so that
            // when they get updated due to theme changes, the updates get propagated to the pages.
            mainPage.Resources.MergedDictionaries.Add(Resources);
            subAzureLoginPage.Resources.MergedDictionaries.Add(Resources);
            subWatsonLoginPage.Resources.MergedDictionaries.Add(Resources);
        }