Пример #1
0
        //private void OnLaunch(object sender, RoutedEventArgs e)
        //{
        //    if (!string.IsNullOrWhiteSpace(scenario.Url))
        //    {
        //        this.Frame.Navigate(typeof(ActionPage), scenario);
        //    }
        //}

        private async void OnSave(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(Title.Text) && !string.IsNullOrWhiteSpace(Url.Text))
            {
                Scenario.Title        = Title.Text;
                Scenario.Url          = Url.Text;
                Scenario.VoiceCommand = VoiceCommand.Text;

                if (IsNewOne)
                {
                    Context.Instance.Scenarios.Add(Scenario);
                }
                Context.Instance.SaveSettings();

                await VoiceService.UpdateAvailableScenarios();

                this.Frame.Navigate(typeof(MainPage));
            }
        }