Ich möchte MetroProgressBar in meinem UserControl verwenden.MahApps MetroProgressBar funktioniert nicht in ControlTemplate
<UserControl x:Class="WpfApplication7.UserControl1">
<StackPanel Background="#ccc">
<controls:MetroProgressBar IsIndeterminate="True"/>
</StackPanel>
</UserControl>
Es funktioniert gut. Aber jetzt muss ich externen Inhalt in der Benutzerkontrolle unterstützen. Also habe ich ein neues "UserControl2" zu Demo:
<StackPanel>
<local:UserControl1 Background="#ccc"/>
<local:UserControl2 Background="#ccc" Margin="0,6,0,0"/>
</StackPanel>
Als Ergebnis sehe ich, dass UserControl2 nicht Progress Bar besagen:
<UserControl x:Class="WpfApplication7.UserControl2">
<UserControl.Resources>
<Style TargetType="{x:Type local:UserControl2}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:UserControl2}">
<StackPanel Background="#ccc">
<controls:MetroProgressBar IsIndeterminate="True"/>
<!--<ContentPresenter/>-->
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
</UserControl>
Dann habe ich die beiden Kontrollen in die Form zu bringen. Wie kann ich es beheben?
Hinweis: Im Designer UserControl2 gemacht wird, wie mit Fortschrittsbalken erwartet.
Dies wird behoben und wird in v1 verfügbar sein. 6.0. Es ist jetzt auch mit der neuesten Pre-Release-Version, die auch bei NuGet erhältlich ist, testbar. – punker76
@ punker76 Vielen Dank! – Serg046