Ich versuche, eine Schaltfläche "Aktualisieren" in der Titelleiste des Fensters mit MahApps.Metro 0.13.1.0 hinzuzufügen.MahApps.Metro Symbol wird nicht angezeigt
Mein App.xaml ist dies:
<Application x:Class="VersionSwitcher.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Views/MainWindow.xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d1p1:Ignorable="d"
xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<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/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
<ResourceDictionary Source="/Resources/Icons.xaml" />
</ResourceDictionary.MergedDictionaries>
<vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" xmlns:vm="clr-namespace:VersionSwitcher.ViewModel" />
</ResourceDictionary>
</Application.Resources>
</Application>
Und dann in meiner MainWindow.xaml:
<Controls:MetroWindow.WindowCommands>
<Controls:WindowCommands>
<Button ToolTip="{x:Static p:Resources.Button_Refresh}"
Style="{DynamicResource MetroCircleButtonStyle}" Width="30" Height="30">
<Rectangle Fill="Black">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Fill"
Visual="{DynamicResource appbar_refresh}" />
</Rectangle.OpacityMask>
</Rectangle>
</Button>
</Controls:WindowCommands>
</Controls:MetroWindow.WindowCommands>
ich einen grauen Kreis in der Titelleiste, aber kein Symbol! Jedes Symbol (von Resources/Icons.xaml) macht dasselbe.
Wenn das Symbol im Fensterinhalt statt in der Titelleiste platziert wird, macht es das Gleiche.
Was habe ich verpasst?
Danke!
aktualisiert
ich herausgefunden habe, dass das Symbol, um das Rechteck eine Breite und eine Höheneinstellung zeigt. Was muss ich tun, um den Button immer zu füllen?
haben Sie versucht, das Rechteck eine Größe geben ? also statt '' probiere < '?? –
Viv
Ja, vor ein paar Sekunden: Es zeigt jetzt etwas. Ich kenne nicht viel WPF, also weiß ich nicht, warum es das tut? – thomasb
Überprüfen Sie meine Antwort für das "Warum" – Viv