簡體   English   中英

mahapps:在“ MetroWindow”類型中找不到可附加屬性“ Flyouts”

[英]mahapps:The attachable property 'Flyouts' was not found in type 'MetroWindow'

我在WPF中非常新。 我想在Windows8中有一個彈出窗口,例如應用程序(右側)窗口。 使用nuget將mahapps( http://mahapps.com )添加到我的項目中,並向應用程序添加資源,但是當向窗口添加彈出窗口時,出現此錯誤:

    The attachable property 'Flyouts' was not found in type 'MetroWindow'

我的XAML程式碼是:

    <controls:MetroWindow x:Class="WpfApplication3.MainWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
                  Title="MainWindow"
                  Height="600"
                  Width="800" WindowState="Maximized">
<Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Window.Resources>

<Controls:MetroWindow.Flyouts>
    <Controls:FlyoutsControl>
        <Controls:Flyout Header="Flyout" Position="Right" Width="200">

        </Controls:Flyout>
    </Controls:FlyoutsControl>
</Controls:MetroWindow.Flyouts>
<!-- some content -->

在cs文件中沒有任何特殊的東西。 我該如何解決這個錯誤?

嘗試刪除“ MetroWindow.Flyout” ...

<controls:FlyoutsControl>
            <controls:Flyout Position="Bottom">
                      //  .. some controls .. 
             </controls:Flyout>
</controls:FlyoutsControl>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM