Is there a way to use RadGlyphs as icons for the items of a RadBreadcrumb?
Thank you.
Hi, I'm using the Breadcrumb tool to display a folder path in a WPF MVVM app.
It all seems to work apart from whent he form is initially loaded...
The UI/form is a usercontrol that constructs it's ViewModel via the extended property
prism:ViewModelLocator.AutoWireViewModel="True"
(I'm using the Prism framework)
The BreadCrumb is bound to a couple of properties in the ViewModel..
<telerik:RadBreadcrumb Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="FolderPath"
ItemsSource="{Binding ImportSourceRoot.Children}"
HeaderMemberPath="Header"
HierarchicalItemsSource="Children"
HierarchicalMemberPath="Header"
HorizontalAlignment="Stretch"
IsLinearMode="False"
Path="{Binding ImportPath, Mode=TwoWay}"
TextModePath="Path"
IsTextModeEnabled="True"
VerticalAlignment="Top"
/>
The ImportSourceRoot property is a nested set of classes with the properties: Children (Observable list of more classes), Path (Folder name or drive letter, 'C:' for example) and Header (similar to Path but also annotated for the drop down).
ImportPath is simply a string property backed by a private variable.
As I said it all seems to work once started, navigation works via drop downs or typing, a pasting a path in works. The issue is when the form loads.
I initialise the ImportPath. It seems to start ok in that the displayed 'crumbed' path looks like the initial path, but the actual text path contains the path concatenated on itself. For example, "C:\temp\data" becomes "C:\temp\data\C:\temp\data" ?
I've monitored the string variable on start up and it gets read then written back in steps ....
"C:\temp\data\C:" -> "C:\temp\data\C:\temp" -> "C:\temp\data\C:\temp\data"
Any ideas?
It's not fatal but is annoying!
Thanks
Gregor
T
Hi, i'm using RadBreadcrumb in my WPF app and cannot find the way to handle when user Paste path in TextMode ? I.e. -
1) click on Breadcrumb , it will switch to text mode,
2) press Ctrl+C (Copy),
3) press Esc (to switch off TextMode)
4) Now goto another path , to make break crumb show different path
5) click on Breabcrumb, it will switch to TextMode
6) press Ctrl+V (Paste)
Any idea how i can handle that ?
Hi, I have not been able to find documentation yet on how to handle events generated by the RadBreadcrumb control, can you point me at the docs? I would really like to bind inidividual 'crumbs' to an ICommand using MVVM. (the same way I would bind a button's Command property to an ICommand) If that's not possible, is there anything else I can do to bind to this control, or do I have to use the events?
Hello,
I have a problem about BreadCrumb Sample,when I set the default Path to the root,
the BreadCrumb did't show the root Image.how can I fix it?
I have a bread-crumb, i make a control-template for this bread-crumb
(i do it automatic in the blend- "EditTemplate"->"Edit a copy")
the problem:
when i used this template my history pop-up is always empty, (the history in the model - correct, but on the view its empty!).
thenk you for helping!
the template code:
<ControlTemplate x:Key="RadBreadcrumbControlTemplate1" TargetType="{x:Type telerik:RadBreadcrumb}">
<Grid x:Name="outerGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="3"/>
<Image x:Name="image" Margin="5,0" Source="{Binding CurrentContainer.Image, RelativeSource={RelativeSource TemplatedParent}}">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="MaxHeight" Value="16"/>
<Setter Property="MaxWidth" Value="16"/>
</Style>
</Image.Style>
<Image.Visibility>
<Binding Path="IsCurrentIconVisible" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:BooleanToVisibilityConverter/>
</Binding.Converter>
</Binding>
</Image.Visibility>
</Image>
<Breadcrumb:RadBreadcrumbBar x:Name="BreadcrumbBar" Grid.Column="1" Foreground="{TemplateBinding Foreground}" ItemTemplate="{TemplateBinding ItemTemplate}"/>
<telerik:RadSplitButton x:Name="historySplitButton" Grid.ColumnSpan="2" Grid.Column="1" InnerCornerRadius="0">
<telerik:RadSplitButton.DropDownContent>
<ListBox x:Name="HistoryListBox" BorderThickness="0" HorizontalContentAlignment="Stretch" Padding="2">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid>
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</telerik:RadSplitButton.DropDownContent>
<telerik:RadSplitButton.Style>
<Style TargetType="{x:Type telerik:RadSplitButton}">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="IsOpen" Value="False"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadSplitButton}">
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerik:RadToggleButton x:Name="DropDownPart" Grid.Column="1" IsTabStop="False" IsChecked="{Binding IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" InnerCornerRadius="0" Margin="0,-1,0,0" MinWidth="11" MinHeight="7" Grid.Row="2" Style="{TemplateBinding TogglePartStyle}" Visibility="{TemplateBinding DropDownIndicatorVisibility}"/>
<telerik:RadButton x:Name="ButtonPart" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" InnerCornerRadius="0" Padding="{TemplateBinding Padding}" Grid.Row="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
<telerik:RadButton.Style>
<Style TargetType="{x:Type telerik:RadButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadButton}">
<ContentPresenter x:Name="Content" Grid.ColumnSpan="2" Content="{TemplateBinding Content}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadButton.Style>
<telerik:RadButton.Visibility>
<Binding Mode="TwoWay" Path="IsButtonPartVisible" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:BooleanToVisibilityConverter/>
</Binding.Converter>
</Binding>
</telerik:RadButton.Visibility>
</telerik:RadButton>
</Grid>
<Popup x:Name="DropDownPopup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" StaysOpen="False">
<Grid>
<Border x:Name="DropDownPopupBorder" BorderBrush="#FF848484" BorderThickness="1" Background="White" CornerRadius="0" Height="{TemplateBinding DropDownHeight}" MaxWidth="{TemplateBinding DropDownMaxWidth}" MaxHeight="{TemplateBinding DropDownMaxHeight}" Margin="0" MinWidth="3" MinHeight="3" Width="{TemplateBinding DropDownWidth}">
<ContentPresenter x:Name="DropDownPopupContent" ContentTemplate="{TemplateBinding DropDownContentTemplate}" Content="{TemplateBinding DropDownContent}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Border>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False"/>
<Trigger Property="IsOpen" Value="True">
<Setter Property="Panel.ZIndex" TargetName="DropDownPart" Value="1"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True"/>
<Trigger Property="DropDownButtonPosition" Value="Right">
<Setter Property="Grid.Column" TargetName="DropDownPart" Value="2"/>
<Setter Property="Grid.Row" TargetName="DropDownPart" Value="1"/>
<Setter Property="Margin" TargetName="DropDownPart" Value="-1,0,0,0"/>
</Trigger>
<Trigger Property="IsButtonPartVisible" Value="False">
<Setter Property="Grid.Column" TargetName="DropDownPart" Value="0"/>
<Setter Property="Grid.ColumnSpan" TargetName="DropDownPart" Value="3"/>
<Setter Property="IsTabStop" TargetName="DropDownPart" Value="True"/>
</Trigger>
<Trigger Property="IsFocused" Value="True"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadSplitButton.Style>
<TextBox x:Name="pathTextBox" BorderThickness="0" Margin="1" MinHeight="20">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</TextBox>
</telerik:RadSplitButton>
<Popup x:Name="AutocompletePopup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsAutocompleteOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" StaysOpen="False">
<ListBox x:Name="AutoCompleteListBox" BorderBrush="#FF848484" BorderThickness="1" MaxWidth="650" MaxHeight="500" MinWidth="100" MinHeight="30">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid>
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Popup>
<telerik:RadToggleButton x:Name="historyToggle" BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Command="Breadcrumb:RadBreadcrumbCommands.HistoryDropDown" InnerCornerRadius="0" Width="15">
<Path x:Name="DropDownIndicator" Data="M0,0L5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0z" Fill="Black" HorizontalAlignment="Center" IsHitTestVisible="False" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
</telerik:RadToggleButton>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsTextMode" Value="True">
<Setter Property="Visibility" TargetName="historySplitButton" Value="Visible"/>
<Setter Property="Visibility" TargetName="BreadcrumbBar" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="historyToggle" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsTextMode" Value="False">
<Setter Property="Visibility" TargetName="historySplitButton" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="BreadcrumbBar" Value="Visible"/>
<Setter Property="Visibility" TargetName="historyToggle" Value="Visible"/>
<Setter Property="IsChecked" TargetName="historyToggle" Value="False"/>
</Trigger>
<Trigger Property="IsAutocompleteOpen" Value="True">
<Setter Property="Panel.ZIndex" TargetName="historySplitButton" Value="1"/>
</Trigger>
<Trigger Property="IsTextModeEnabled" Value="False">
<Setter Property="Visibility" TargetName="historyToggle" Value="Collapsed"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Is there a way to show the BreadCrumb's parent dropdown menu on selection of the child?
For example, let's the example program from the WPF Examples / BreadCrumb Theming, it shows a demo of windows explorer.
Local Disk c:\ -> Personal Folders -> Outbox as a sample breadcrumb path.
By default, if I click on the drop down for 'Personal Folders' I'll get a listing of the child elements, i.e. 'Outbox', 'Drafts', etc.
Outbox doesn't have a drop down associated with it since it is the last element.
Is it possible to setup the control so there would be a drop down on 'Outbox' and clicking it would show all of the items at that level?
Thanks!
-ben
private
void
onJobBreadcrumbCurrentItemChanged(
object
sender, Telerik.Windows.RadRoutedEventArgs e)<br> {<br>
this
._radTreeView.BringPathIntoView(
this
.jobBreadcrumb.Path);<br>
this
._radTreeView.SelectedItem =
this
.jobBreadcrumb.CurrentItem;<br> }<br><br>
private
void
onJobTreeSelectionChanged(
object
sender, SelectionChangedEventArgs e)<br> {<br>
if
(e.AddedItems.Count > 0 &&
this
._radTreeView.ContainerFromItemRecursive(e.AddedItems[0]) !=
null
)<br> {<br> var path =
this
._radTreeView.ContainerFromItemRecursive(e.AddedItems[0]).FullPath;<br>
this
.jobBreadcrumb.Path = path;<br> }<br> }
<
telerik:RadBreadcrumb
x:Name
=
"jobBreadcrumb"
<br> HorizontalAlignment="Stretch" <
br
> VerticalAlignment="Top" <
br
> Grid.Row="0"<
br
> CurrentItemChanged="onJobBreadcrumbCurrentItemChanged"<
br
> IsTextModeEnabled="False"<
br
> Header="{Binding CurrentBid.Text}"<
br
> ImagePath="ImageSource"<
br
> IsIconVisible="True"<
br
> ItemContainerStyleSelector="{StaticResource JobTreeItemStyleSelector}"<
br
> ItemsSource="{Binding CurrentBid.Scenarios}"><
br
> </
telerik:RadBreadcrumb
><
br
><
br
><
br
><
br
> <
telerik:RadTreeView
<br> x:Name="jobTreeView" <
br
> ItemsSource="{Binding CurrentBid.Scenarios}" <
br
> ItemTemplateSelector="{StaticResource JobTreeItemTemplateSelector}" <
br
> IsDragDropEnabled="True" <
br
> telerik:TextSearch.TextPath="Text"<
br
> Grid.Row="1"><
br
> </
telerik:RadTreeView
> <
br
>