Ankush Madankar
Ankush Madankar

Reputation: 3834

How to change style of title of Content Dialog in Windows Phone 8.1

How to change style of title property of ContentDialog page in Windows Phone 8.1.

XAML:

<ContentDialog
    x:Class="MyApp.View.Login.ContentDialog1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MyApp.View.Login"
    Title="DIALOG TITLE">

    <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
        <TextBox Name="email" Header="Email address"/>
    </StackPanel>
</ContentDialog>

Here we have Title="DIALOG TITLE", can I change style of text show in title?

EDIT

enter image description here

How to reduce top most empty space in ContentDialog if title not mention?

Upvotes: 2

Views: 3126

Answers (1)

Rob Caplan - MSFT
Rob Caplan - MSFT

Reputation: 21899

The title will show in the ContentDialog's TitleTemplate. You can change that as needed.

<ContentDialog
    x:Class="MyApp.View.Login.ContentDialog1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MyApp.View.Login"
    Title="DIALOG TITLE">

    <ContentDialog.TitleTemplate>
        <DataTemplate>
            <!-- what do you want the title to look like -->
        </DataTemplate>
    </ContentDialog.TitleTemplate>

    <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
        <TextBox Name="email" Header="Email address"/>
    </StackPanel>
</ContentDialog>

Upvotes: 9

Related Questions