Wpf 使用材料设计工具包,在Mahapps Metro窗口don';我不能正常工作
上下文:我正在使用Mahapps.Metro弹出式按钮和材料设计工具包 问题:当Wpf 使用材料设计工具包,在Mahapps Metro窗口don';我不能正常工作,wpf,material-design,mahapps.metro,flyout,Wpf,Material Design,Mahapps.metro,Flyout,上下文:我正在使用Mahapps.Metro弹出式按钮和材料设计工具包 问题:当弹出按钮打开时,它未按指定位置定位。例如,如果我将弹出按钮设置为位于窗口的底部,它将位于垂直中心 我已经设置了App.xaml来支持Mahapps和材质设计。我还对主题和口音进行映射,以获得一致的体验 我采用了mdwiki中显示的配置。我有一个地铁窗口,我的应用程序使用了各种控制与Mahapps和材料设计风格-没有任何问题。只有弹出按钮不能正常工作 为了隔离问题,我将我的应用程序减少到最低限度。此外,我还使用了Mat
弹出按钮
打开时,它未按指定位置定位。例如,如果我将弹出按钮
设置为位于窗口的底部
,它将位于垂直中心
我已经设置了App.xaml来支持Mahapps和材质设计。我还对主题和口音进行映射,以获得一致的体验
我采用了mdwiki中显示的配置。我有一个地铁窗口,我的应用程序使用了各种控制与Mahapps和材料设计风格-没有任何问题。只有弹出按钮不能正常工作
为了隔离问题,我将我的应用程序减少到最低限度。此外,我还使用了Material Design Mahapps演示应用程序中的示例弹出按钮。
虽然演示应用程序运行良好,但它在我的应用程序上下文中不起作用。
如果我将Mahapps MD兼容性的内容从App.xaml中删除,弹出按钮可以正常工作,但当然没有MD主题
App.xaml:
尝试了几个小时后,我仍然不知道问题出在哪里。任何暗示都将受到高度赞赏
致以最良好的祝愿,
MarcusMaterialDesignThemes的当前版本不适用于MahApps v1.4.1。我会把更新推到回购协议上。太好了!谢谢!新版本发布后,我会尽快试用。嗨,伙计们,我已经合并了@punker76的更改,并推到了nuget:嗨,我在我的项目中加入了0.0.9。在启动时,我遇到了一个XamlParseException,内部异常表示加载程序集MahApps.Metro时出现问题,因为清单定义和程序集引用之间不匹配。我改回0.0.8,异常消失了。({“Die Datei order Assembly\”MahApps.Metro,PublicKeyToken=null\"现在的MaterialDesignThemes版本不适用于MahApps v1.4.1。我将对repo进行更新。太好了!非常感谢!我会在新版本发布后立即试用。嗨,伙计们,我是erged@punker76的更改,并推送到nuget:嗨,我将0.0.9拉到我的项目中。在启动时,我有一个XamlParseException,内部异常表示加载程序集MahApps.Metro时有问题,因为清单定义和程序集引用之间不匹配。我改回了0.0.8,异常消失了({“Die Datei order Assembly\”MahApps.Metro,PublicKeyToken=null\”或“davon wurde nicht gefunden。Die gefundene的定义不适用于组装。
<Application x:Class="Frontend.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Frontend"
StartupUri="MainWindow.xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d1p1:Ignorable="d"
xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:UiLogic="clr-namespace:EPM.Frontend.Logic;assembly=Frontend.Logic">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<UiLogic:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
</ResourceDictionary>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
<!-- Material Design -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
<!-- Material Design: MahApps Compatibility -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Defaults.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" />-->
<ResourceDictionary Source="/Resources/Icons.xaml" />
<ResourceDictionary Source="Themes/Colors.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- MahApps Brushes -->
<SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource Primary700}"/>
<SolidColorBrush x:Key="AccentColorBrush" Color="{DynamicResource Primary500}"/>
<SolidColorBrush x:Key="AccentColorBrush2" Color="{DynamicResource Primary400}"/>
<SolidColorBrush x:Key="AccentColorBrush3" Color="{DynamicResource Primary300}"/>
<SolidColorBrush x:Key="AccentColorBrush4" Color="{DynamicResource Primary200}"/>
<SolidColorBrush x:Key="WindowTitleColorBrush" Color="{DynamicResource Primary700}"/>
<SolidColorBrush x:Key="AccentSelectedColorBrush" Color="{DynamicResource Primary500Foreground}"/>
<LinearGradientBrush x:Key="ProgressBrush" EndPoint="0.001,0.5" StartPoint="1.002,0.5">
<GradientStop Color="{DynamicResource Primary700}" Offset="0"/>
<GradientStop Color="{DynamicResource Primary300}" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="CheckmarkFill" Color="{DynamicResource Primary500}"/>
<SolidColorBrush x:Key="RightArrowFill" Color="{DynamicResource Primary500}"/>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{DynamicResource Primary500Foreground}"/>
<SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{DynamicResource Primary500}" Opacity="0.4"/>
</ResourceDictionary>
</Application.Resources>
</Application>
<Controls:MetroWindow x:Class="Frontend.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:local="clr-namespace:EPM.Frontend"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d"
DataContext="{Binding Main, Mode=OneWay, Source={StaticResource Locator}}"
Title="electronic platform manager" Width="732" Height="452"
Background="{DynamicResource MaterialDesignPaper}"
BorderThickness="1"
BorderBrush="{DynamicResource AccentColorBrush}"
EnableDWMDropShadow="True">
<Controls:MetroWindow.Flyouts>
<Controls:FlyoutsControl x:Name="flyoutsControl">
<Controls:Flyout x:Name="LeftFlyout" Position="Bottom" Header="Settings" materialDesign:FlyoutAssist.HeaderColorMode="Accent" IsOpen="True" Height="80">
<local:FlyoutContent />
</Controls:Flyout>
</Controls:FlyoutsControl>
</Controls:MetroWindow.Flyouts>
</Controls:MetroWindow>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="1.3" targetFramework="net46" />
<package id="EntityFramework" version="6.1.3" targetFramework="net46" />
<package id="MahApps.Metro" version="1.4.1" targetFramework="net46" />
<package id="MahApps.Metro.IconPacks" version="1.6.0" targetFramework="net46" />
<package id="MahApps.Metro.Resources" version="0.6.1.0" targetFramework="net46" />
<package id="MaterialDesignColors" version="1.1.3" targetFramework="net46" />
<package id="MaterialDesignThemes" version="2.2.1.750" targetFramework="net46" />
<package id="MaterialDesignThemes.MahApps" version="0.0.8" targetFramework="net46" />
<package id="MvvmLight" version="5.3.0.0" targetFramework="net46" />
<package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" />
</packages>