2014-06-10 42 views
1

我在C#中用XAML做了一個彈出窗口,現在我想更改爲標題和返回按鈕保留的空間背景顏色。但該區域未在彈出頁面中定義。有誰知道我可以如何改變圍繞標題和後退按鈕的面板的背景顏色?C#XAML Flyout更改headerbackground顏色

<SettingsFlyout 
x:Class="CatalogApp.FlyoutControl.Login" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:CatalogApp.FlyoutControl" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d" 
IconSource="Assets/SmallLogo.png" 
Title="Login" 
d:DesignWidth="346"> 


<!-- This StackPanel acts as a root panel for vertical layout of the content sections --> 
<StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch" RenderTransformOrigin="0.458,1.194" Width="250" > 

    <!-- The StackPanel(s) below define individual content sections --> 

    <!-- Content Section 1 Maring: left, up, down, right--> 
    <TextBlock x:Name="LBLuserName" TextWrapping="Wrap" Text="Username" FontSize="18" Margin="10,0,0,0"/> 
    <TextBox x:Name="TbUserName" TextWrapping="Wrap" Margin="10,0,0,0"/> 
    <TextBlock x:Name="LBLpassWord" TextWrapping="Wrap" FontSize="18" Text="Password" Margin="10,20,0,0"/> 
    <TextBox x:Name="TbPassWord" TextWrapping="Wrap" Margin="10,0,0,0" KeyDown="TbPassWord_KeyDown"/> 
    <TextBlock x:Name="TAWebService" TextWrapping="Wrap" Text="WebserviceURL (Inclusief HTTP://)" Margin=" 10,20,0,0" FontSize="15"/> 
    <TextBox x:Name="TBWebServiceURL" TextWrapping="Wrap" Margin="10,0,0,20" PlaceholderText=""/> 
    <Button x:Name="BTCheckConnection" Content="Check connectie" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10,0,100,0" Click="BTCheckConnection_Click"/> 
    <TextBlock x:Name="TBConnection" TextWrapping="Wrap" Margin="10,20,0,0"/> 
    <Button x:Name="btTrue" Content="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="btTrue_Click"/> 
    <Button x:Name="btFalse" Content="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="btFalse_Click"/> 
    <!-- Content Section 1--> 

    <!-- Define more Content Sections below as necessary --> 

</StackPanel> 

回答

2

你只需要添加HeaderBackground等;

<SettingsFlyout 
x:Class="CatalogApp.FlyoutControl.Login" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:CatalogApp.FlyoutControl" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d" 
IconSource="Assets/SmallLogo.png" 
Title="Login" 
d:DesignWidth="346" 
HeaderBackground="Green"> 

乾杯

+0

正確的答案,我也心疼。謝謝 – Proliges