2016-03-03 190 views
0

我一直在使用MahApp.Metro幾個項目現在,和WinForms圖表太,也將它們結合在一起。 所以沒有在這一方面在這個新項目中,除了:Mahapps.Metro彈出按鈕後面出現圖表的WinForms

圖表的位置。 這也是造成在Mahapps.Metro彈出菜單我有打開後面的圖表的問題。看截圖。

enter image description here

有什麼辦法解決?我查了一下,什麼也沒找到。在CSS中,它將是一個簡單的Z-index設置...但在C#中我不知道。

任何幫助表示讚賞。根據要求

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> 

+1

你會粘貼一些代碼?圖表放置在哪裏? –

+0

當然,我會包括XAML的那部分,真的是基本的,沒有什麼比普通的,這就是爲什麼我一開始沒有打擾。 –

+1

看看這個。 http://stackoverflow.com/q/9920480/1456174 –

回答

1

那混合WinForms和WPF的時候,並沒有涉及到MahApps.Metro是一個已知的問題。只要搜索Airspace在這裏StackOverflow上。