How to create a tabbed dialog in UWP

Apptacular Apps 391 Reputation points
2020-07-06T17:55:20.39+00:00

Does UWP provide any type of dialog where content can be shown in tabs like the screenshot below?

It seems that the Dialogs and Flyouts document doesn't provide any information about this.
https://learn.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/dialogs-and-flyouts/

YnGth.png

Developer technologies | Universal Windows Platform (UWP)
{count} votes

Answer accepted by question author
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,871 Reputation points
    2020-07-07T01:30:46.877+00:00

    Hello,

    Welcome come to Microsoft Q & A,

    How to create a tabbed dialog in UWP

    Sure, you could use ContentDialog to implement like the screenshot. Right click the project -> Add-> Select ContentDialog template-> write the following code.

    <ContentDialog  
        x:Class="MapIconTest.TabbedDialog"  
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
        xmlns:local="using:MapIconTest"  
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
        Title="My Title"  
        PrimaryButtonClick="ContentDialog_PrimaryButtonClick"  
        PrimaryButtonText="Cancel"  
        SecondaryButtonClick="ContentDialog_SecondaryButtonClick"  
        SecondaryButtonText="OK"  
        mc:Ignorable="d"  
        >  
        <Grid>  
            <Pivot>  
                <PivotItem Header="1">  
                    <TextBlock Text="all emails go here." />  
                </PivotItem>  
                <PivotItem Header="2">  
                    <TextBlock Text="unread emails go here." />  
                </PivotItem>  
                <PivotItem Header="3">  
                    <TextBlock Text="flagged emails go here." />  
                </PivotItem>  
            </Pivot>  
        </Grid>  
    </ContentDialog>  
    

    Usage

    private async void Button_Click(object sender, RoutedEventArgs e)  
    {  
        TabbedDialog TBDialog = new TabbedDialog();  
        await TBDialog.ShowAsync();  
    }  
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.