简体   繁体   English

Mahapps.Metro Flyout出现在Winforms图表后面

[英]Mahapps.Metro Flyout appearing behind Winforms chart

I have been using MahApp.Metro for a few project now, and WinForms charts too, and also combined them. 我现在一直在使用MahApp.Metro进行一些项目,也使用WinForms图表,并将它们组合在一起。 So nothing new on that front in this project, except : 因此,该项目在这方面没有新内容,除了:

The placement of the chart. 图表的位置。 And this is causing an issue where the Mahapps.Metro Flyout menu i have opens BEHIND the chart. 这会导致我在图表后面打开Mahapps.Metro Flyout菜单的问题。 See Screenshot. 参见屏幕截图。

在此处输入图片说明

Is there any way to solve this? 有什么办法解决这个问题? i have searched a bit and found nothing. 我搜索了一下,一无所获。 In CSS it would be a simple z-index setting... but in C# i have no idea. 在CSS中,这将是一个简单的z-index设置...但是在C#中,我不知道。

Any help appreciated. 任何帮助表示赞赏。

XAML as requested : 要求的XAML:

<Controls:MetroWindow x:Name="wdw_MainWindow" x:Class="AdminProgram.MainWindow"
    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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns:winformchart="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
    xmlns:local="clr-namespace:AdminProgram"
    mc:Ignorable="d"
    Title="MainWindow" Height="600" Width="1024" GlowBrush="{DynamicResource AccentColorBrush}" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" BorderThickness="2,2,0,2" ShowMinButton="False" ShowMaxRestoreButton="False" IsMinButtonEnabled="False" IsMaxRestoreButtonEnabled="False" BorderBrush="#FF7C7C7C" TitleForeground="White">
<Controls:MetroWindow.Flyouts>
    <Controls:FlyoutsControl>
        <Controls:Flyout x:Name="fyo_Menu" Header="Menu" Width="200" Theme="Accent">
            <Grid>
                <Controls:Tile x:Name="btn_AddNew" Title="Add New" 
                Width="150" Height="150" TitleFontSize="20" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0" Click="btn_AddNew_Click" KeepDragging="False" MouseEnter="Tile_MouseEnter" MouseLeave="Tile_MouseLeave" BorderBrush="#FFC89632">
                </Controls:Tile>
                <Controls:Tile x:Name="btn_ViewAll" Title="View All" 
                Width="150" Height="150" TitleFontSize="20" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,160,0,0" Padding="0" Click="btn_ViewAll_Click" MouseEnter="Tile_MouseEnter" MouseLeave="Tile_MouseLeave" BorderBrush="#FFC89632" >
                </Controls:Tile>
            </Grid>
        </Controls:Flyout>
    </Controls:FlyoutsControl>
</Controls:MetroWindow.Flyouts>
<GroupBox x:Name="gpb_Home_Stats" Header="Latest information and statistics" Margin="0,50,0,0">
  <Grid>
    <!--- Winforms Integrated charting -->
    <!--Strength bars -->
    <WindowsFormsHost x:Name="wfh_Statistics_Strengthometer" VerticalAlignment="Center"  HorizontalAlignment="Center" Margin="0,0,0,0" Width="950" Height="425">
        <winformchart:Chart x:Name="chart_Strengthometer" Dock="None">
            <winformchart:Chart.Legends>
                <winformchart:Legend Docking="Left" TitleSeparator="Line" Title="Coffee count by strength"/>
            </winformchart:Chart.Legends>
            <winformchart:Chart.Series>
                <winformchart:Series Name="Strength" ChartType="Column"/>
            </winformchart:Chart.Series>
            <winformchart:Chart.ChartAreas>
                <winformchart:ChartArea/>
            </winformchart:Chart.ChartAreas>
        </winformchart:Chart>
    </WindowsFormsHost>
  </Grid>
</GroupBox>

That's a known issue when mixing WinForms and WPF and is not related to MahApps.Metro. 混合WinForms和WPF时,这是一个已知问题,与MahApps.Metro无关。 Just search for Airspace here at StackOverflow. 只需在StackOverflow此处搜索Airspace

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM