0

私は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ファイルに特別なものはありません。どうすればこのエラーを修正できますか?

4

1 に答える 1

2

「MetroWindow.Flyout」を削除してみると……

<controls:FlyoutsControl>
            <controls:Flyout Position="Bottom">
                      //  .. some controls .. 
             </controls:Flyout>
</controls:FlyoutsControl>
于 2015-01-13T22:08:03.150 に答える