예제 #1
0
        private async void currentWebView_ScriptNotify(object sender, NotifyEventArgs e)
        {
            string[] messageArray = e.Value.Split(':');
            string   message;
            string   type;

            if (messageArray.Length > 1)
            {
                message = messageArray[1];
                type    = messageArray[0];
            }
            else
            {
                message = e.Value;
                type    = "typeAlert";
            }

            if (type.Equals("typeAlert"))
            {
                AlertTextBlock.Text = message;
                var result = await AlertContentDialog.ShowAsync();
            }
            else if (type.Equals("typeConfirm"))
            {
                ConfirmTextBlock.Text = message;
                var result = await ConfirmContentDialog.ShowAsync();
            }
            else if (type.Equals("typePrompt"))
            {
                PromptTextBlock.Text = message;
                var result = await PromptContentDialog.ShowAsync();
            }
        }
예제 #2
0
        private async void  AddAlert_Click(object sender, RoutedEventArgs e)
        {
            var btn    = sender as Button;
            var result = await AlertContentDialog.ShowAsync();

            //  btn.Content = "Res : "+result;
            if (result.ToString() == "Primary")
            {
                var    _GridView = WatchListGrid as GridView;
                TvShow show      = ((Windows.UI.Xaml.FrameworkElement)btn.Parent).DataContext as TvShow;
                tableQueries.updateRecord(show.ShowTitle);
                WatchListGrid.ItemsSource = tableQueries.selectAll();
            }
        }
예제 #3
0
        private async void AlertButton_Click(object sender, RoutedEventArgs e)
        {
            var AlertName = "Alert" + DetailsEvent.Text;

            if (localSettings.Values[AlertName] != null)
            {
                if (localSettings.Values[AlertName].ToString() == "1")
                {
                    AlertToggleSwitch.IsOn = true;
                }
                else
                {
                    AlertToggleSwitch.IsOn = false;
                }
            }
            else
            {
                AlertToggleSwitch.IsOn          = false;
                localSettings.Values[AlertName] = "0";
            }
            var AlertName2 = "Alert" + DetailsEvent.Text + 1;

            if (localSettings.Values[AlertName2] != null)
            {
                if (localSettings.Values[AlertName2].ToString() == "1")
                {
                    AlertToggleSwitch2.IsOn = true;
                }
                else
                {
                    AlertToggleSwitch2.IsOn = false;
                }
            }
            else
            {
                AlertToggleSwitch2.IsOn          = false;
                localSettings.Values[AlertName2] = "0";
            }
            var AlertName3 = "Alert" + DetailsEvent.Text + 3;

            if (localSettings.Values[AlertName3] != null)
            {
                if (localSettings.Values[AlertName3].ToString() == "1")
                {
                    AlertToggleSwitch3.IsOn = true;
                }
                else
                {
                    AlertToggleSwitch3.IsOn = false;
                }
            }
            else
            {
                AlertToggleSwitch3.IsOn          = false;
                localSettings.Values[AlertName3] = "0";
            }
            var AlertName4 = "Alert" + DetailsEvent.Text + "Personal";

            if (localSettings.Values[AlertName4] != null)
            {
                if (localSettings.Values[AlertName4].ToString() != "0")
                {
                    AlertToggleSwitch4.IsOn = true;
                    DayComboBox.IsEnabled   = true;
                    var indexValue = localSettings.Values[AlertName4].ToString();
                    if (indexValue == "2")
                    {
                        DayComboBox.SelectedIndex = 0;
                    }
                    else
                    {
                        DayComboBox.SelectedIndex = Convert.ToInt32(indexValue) - 3;
                    }
                }

                else
                {
                    AlertToggleSwitch4.IsOn = false;
                    DayComboBox.IsEnabled   = false;
                }
            }
            else
            {
                DayComboBox.IsEnabled = false;
            }
            await AlertContentDialog.ShowAsync();
        }