编辑浮动窗口关闭按钮

时间:2015-10-07 13:47:41

标签: c# wpf window syncfusion

我想知道是否可以在wpf中更改浮动窗口上的关闭按钮?我现在有一个窗口关闭与白色十字和红色背景。我还有一个黑色十字架的图像,想知道是否可以取下红色背景和白色十字架并用我的图像替换它?

    <syncfusion:DockingManager x:Name="DockingManager"
                           PersistState="True"
                           UseDocumentContainer="True"
                           Margin="0,0,0,0"
                           syncfusion:SkinManager.ActiveColorScheme="#E7E7E7"
                           HeaderForeground="Black"
                           SelectedHeaderBackground="{DynamicResource selectedHeaderBackground}"
                           syncfusion:DockingManager.DesiredHeightInFloatingMode="27"
                           syncfusion:DockingManager.DesiredHeightInDockedMode="27"
                           FloatWindowMouseOverHeaderBackground="#F6CD1D"
                           FloatWindowHeaderBackground="#F6CD1D"
                           HeaderForegroundSelected="Black"
                           TabItemBackgroundSelected="{DynamicResource headerBackground}"
                           TabPanelBackground="#FFE7E7E7"
                           SidePanelBackground="White" 
                           TabItemsForeground="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrushKey}}" 
                           Background="White" 
                           FloatWindowHeaderForeground="{DynamicResource headerBackground}"
                           TabItemsBackground="{DynamicResource headerBackground}" 
                           FloatWindowSelectedHeaderForeground="{DynamicResource headerBackground}" 
                           FloatWindowMouseOverHeaderForeground="{DynamicResource headerBackground}" 
                           HeaderBorderBrush="{x:Null}"
                           OpacityMask="{DynamicResource headerBackground}" 
                           TabItemsBorderBrush="{DynamicResource headerBackground}" 
                           FloatWindowSelectedHeaderBackground="{DynamicResource headerBackground}"
                           HeaderBackground="{DynamicResource headerBackground}" 
                           TabItemForegroundSelected="#FF4A515A">
    <syncfusion:DockingManager.SideItemsBorderBrush>
        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#FFEFEEEE" Offset="0"/>
            <GradientStop Color="#E7000000"/>
        </LinearGradientBrush>
    </syncfusion:DockingManager.SideItemsBorderBrush>
    <dockWindow:LocationMap x:Name="Locationmap"
                            syncfusion:DockingManager.DesiredHeightInDockedMode="100"
                            Background="White"
                            syncfusion:DockingManager.SideInDockedMode="Left"
                            syncfusion:DockingManager.State="Dock"
                            syncfusion:DockingManager.DesiredWidthInDockedMode="300" FontWeight="Bold" FontSize="10.667">
        <syncfusion:DockingManager.HeaderTemplate>
            <DataTemplate>
                <DockPanel>
                    <Image Source="Images/dragger.png" Height="20" Width="5" HorizontalAlignment="Left"/>
                    <Image Source="Images/Earth.png" Height="15" Width="15" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                    <TextBlock Text="Location Map" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2"/>
                </DockPanel>
            </DataTemplate>
        </syncfusion:DockingManager.HeaderTemplate>
        <dockWindow:LocationMap.Foreground>
            <ImageBrush />
        </dockWindow:LocationMap.Foreground>
    </dockWindow:LocationMap>
    <dockWindow:Tornado x:Name="TornadoDiagram"
                  syncfusion:DockingManager.SideInDockedMode="Right"
                  syncfusion:DockingManager.State="Dock" 
                  syncfusion:DockingManager.DesiredWidthInDockedMode="400"
                  syncfusion:DockingManager.DesiredHeightInDockedMode="200" FontWeight="Bold">
        <syncfusion:DockingManager.HeaderTemplate>
            <DataTemplate>
                <DockPanel>
                    <Image Source="Images/dragger.png" Height="20" Width="5" HorizontalAlignment="Left"/>
                    <Image Source="Images/Tornado1.png" Height="15" Width="15" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                    <TextBlock Text="Tornado Diagram" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2"/>
                </DockPanel>
            </DataTemplate>
        </syncfusion:DockingManager.HeaderTemplate>
    </dockWindow:Tornado>
    <dockWindow:Cdf x:Name="CdfDiagram"
                  syncfusion:DockingManager.SideInDockedMode="Bottom"
                  syncfusion:DockingManager.State="Dock"
                  syncfusion:DockingManager.TargetNameInDockedMode="TornadoDiagram"
                  syncfusion:DockingManager.DesiredWidthInDockedMode="400"
                  syncfusion:DockingManager.DesiredHeightInDockedMode="200" FontWeight="Bold" >
        <syncfusion:DockingManager.HeaderTemplate>
            <DataTemplate>
                <DockPanel>
                    <Image Source="Images/dragger.png" Height="20" Width="5" HorizontalAlignment="Left" Margin="1"/>
                    <Image Source="Images/CDF1.png" Height="15" Width="15" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="1"/>
                    <TextBlock Text="CDF" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2"/>
                    <Image Source="Images/dragger.png" Height="20" Width="5" HorizontalAlignment="Right" Margin="1"/>
                </DockPanel>
            </DataTemplate>
        </syncfusion:DockingManager.HeaderTemplate>
    </dockWindow:Cdf>

1 个答案:

答案 0 :(得分:0)

因此,最好的方法是自己创建自定义窗口,然后这允许您按照自己的需要创建窗口。这比XAML中一件事的简单改变有点长,但它可以工作