简体   繁体   中英

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

im very new in wpf. i want to have a flyout window like application (right side) window in windows8. use nuget to add mahapps( http://mahapps.com ) to my project and add resources to application but when add a flyout to window i get this error:

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

my xaml code is:

    <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 -->

in cs file there is not any special thing. how could i fix this error?

Try removing the "MetroWindow.Flyout" ...

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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