i am going to do the same. build my stackpanel with controls because the time to edit the default template is too much...
namespace ToolkitExt { public class ToolbarExt : Toolbar { public ToolbarExt() { this.DefaultStyleKey = typeof(ToolbarExt); } �?? public Orientation Orientation { get { return (Orientation)GetValue(OrientationProperty); } set { SetValue(OrientationProperty, value); } } public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register("Orientation", typeof(Orientation), typeof(ToolbarExt), new PropertyMetadata(Orientation.Horizontal)); } }
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkitext="clr-namespace:ToolkitExt"> <Style TargetType="toolkitext:ToolbarExt"> <Setter Property="ToolbarItemClickEffect" Value="Bounce" /> <Setter Property="MaxItemHeight" Value="110" /> <Setter Property="MaxItemWidth" Value="110" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="toolkitext:ToolbarExt"> <StackPanel x:Name="RootElement" Background="Transparent" HorizontalAlignment="Center" Orientation="{TemplateBinding Orientation}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.