Answers for "uinput dialog uwp c#"

C#
0

uinput dialog uwp c#

private async void Button_Click(object sender, RoutedEventArgs e)
{
    TextBox input = new TextBox()
    {
        Height = (double)App.Current.Resources["TextControlThemeMinHeight"],
        PlaceholderText = "Display Text"
    };
    ContentDialog dialog = new ContentDialog()
    {
        Title = "Input Dialog",
        MaxWidth = this.ActualWidth,
        PrimaryButtonText = "OK",
        SecondaryButtonText = "Cancel",
        Content = input
    };
    ContentDialogResult result = await dialog.ShowAsync();
    if (result == ContentDialogResult.Primary)
    {
        input = (TextBox)dialog.Content;
        await new Windows.UI.Popups.MessageDialog(input.Text).ShowAsync();
    }
}
Posted by: Guest on June-18-2020

C# Answers by Framework

Browse Popular Code Answers by Language