Breadcrumb ComboBox Expand on Double Tap?

Navigation for WPF Forum

Posted 6 years ago by Cory J. Geesaman
Version: 18.1.0672
Avatar

I have a Breadcrumb defined by:

<navigation:Breadcrumb x:Name="breadcrumb" AutoMinimizeItemCount="0"
Grid.Row="0"
Margin="0,10,0,0"
PathSeparator="/"
ItemContainerStyle="{StaticResource BreadcrumbItemStyle}"
ItemTemplate="{StaticResource BreadcrumbItemTemplate}"
ComboBoxItemsSource="{Binding ElementName=mainWindow, Path=ComboBoxItems}"
ComboBoxItemTemplate="{x:Null}"
ComboBoxItemTemplateSelector="{StaticResource CustomComboBoxItemTemplateSelector}"
ComboBoxTextPath="@Name"
MenuItemContainerStyle="{StaticResource MenuItemContainerStyle}"
MenuItemTemplate="{StaticResource MenuItemNormalTemplate}"
MenuItemExpandedTemplate="{StaticResource MenuItemExpandedTemplate}"
MaxTailItemCount="100"
IsEditable="False"
ConvertItem="OnBreadcrumbConvertItem"
SelectedItemChanged="OnBreadcrumbSelectedItemChanged">
</navigation:Breadcrumb>

And I'm attempting to make the ComboBoxes drop down when their element is double tapped, akin to pressing the arrow to the right of an item (then collapse again when tapping elsewhere or on the same item with the ComboBox already visible.)  The purpose of this is because it is kind of tricky to tap the arrow itself on a tablet device, and at the same time I don't want to kill the ability to navigate up/down the existing trail by a quick tap (or obscure it by making the initial tap immediately open a ComboBox dropdown.)  Is this possible?  If so, what needs to be done to make it happen?

Comments (2)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Cory,

While that would be difficult to do, might I suggest updating the popup indicator template to be wider instead?

This kind of code would let you set a Margin of your choosing.

<navigation:Breadcrumb.Resources>
	<Style TargetType="navigation:BreadcrumbItemNavigateButton">
		<Setter Property="PopupIndicatorTemplate">
			<Setter.Value>
				<DataTemplate>
					<Path Margin="7,0" Data="M 0,0 L 7,0 L 3.5,3.5 Z" Fill="{Binding RelativeSource={RelativeSource Self}, Path=(TextElement.Foreground)}" />
				</DataTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</navigation:Breadcrumb.Resources>


Actipro Software Support

Posted 6 years ago by Cory J. Geesaman
Avatar

Thanks, this looks reasonable and is probably a bit more intuitive than my initial double-tap idea.

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.