I want to change the Title root property in the following XAML file in code behind. I have tried several ideas with no success.
<ContentDialog
x:Class="KCam8_GUI_Test.LogInContentDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="KCam8_GUI_Test"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="USER SIGN IN"
PrimaryButtonText="Sign In"
SecondaryButtonText="Clear"
CloseButtonText="Cancel"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
SecondaryButtonClick="ContentDialog_SecondaryButtonClick"
CloseButtonClick="ContentDialog_CloseButtonClick">
<ContentDialog.Resources>
<!-- These flyouts or used for confirmation when the user changes
the option to save their user name. -->
</ContentDialog.Resources>
<StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<TextBox x:Name="UserName" Header="User name"/>
<PasswordBox x:Name="Password" Header="Password" Margin="0,0,0,10" PasswordRevealMode="Peek"/>
<TextBlock x:Name="ErrorText" Foreground="Red" Text="Place holder" Margin="0,0,0,10" Visibility="Collapsed"/>
<TextBlock x:Name="Instructions" TextWrapping="Wrap">
<TextBlock.Text>
Sign in with your User name and/or Password.
</TextBlock.Text>
</TextBlock>
</StackPanel>
</ContentDialog>
My code behind would be something like:
<root>.Title(L"NEW TITLE");
I just can't figure out what goes in place of <root>. In this case I think it should be ContentDialog(). But if I do use this, then the Title(L"NEW TITLE") gives an error It also gives an error if I set Title() = L"NEW TITLE"; I even remove the L, but it does not help. Not sure what the answer is. Thanks for your help.