This is a migrated thread and some comments may be shown as answers.

Initial Path is duplicated

7 Answers 30 Views
BreadCrumb
This is a migrated thread and some comments may be shown as answers.
Gregor
Top achievements
Rank 1
Gregor asked on 13 Jul 2018, 07:23 AM

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

 

7 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 17 Jul 2018, 02:53 PM
Hello Gregor,

I will check your case and I will get back to you tomorrow.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Martin Ivanov
Telerik team
answered on 18 Jul 2018, 01:03 PM
Hello Gergor,

I've checked the provided information, but I am missing some parts to reproduce the issue. I would recommend you to open a new support ticket from your telerik.com account and send a runnable project showing the issue.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Gregor
Top achievements
Rank 1
answered on 24 Jul 2018, 05:18 AM

Thanks Martin,

I've extracted the key elements into  a small project and posted a ticket

 

Regards

Greg

0
Martin Ivanov
Telerik team
answered on 24 Jul 2018, 10:12 AM
Hello Gregor,

I've answered the ticket. I hope this helps.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Vladimir
Top achievements
Rank 1
answered on 24 Jan 2019, 09:33 AM
Hi all! I have same problem. Please, explain me how you resolved it problem.
0
Martin Ivanov
Telerik team
answered on 28 Jan 2019, 08:20 AM
Hello Vladimir,

The solution in this case was to set the CurrentItem property of the RadBreadCrumb control in the Loaded event handler.
<telerik:RadBreadcrumb Path="{Binding MyPath, Mode=TwoWay}"
                       <!-- some other properties here -->
                       />

private void RadBreadCrumb_Loaded(object sender, RoutedEventArgs e)
{
    var vm = (MainViewModel)this.DataContext;
    var currentItem = vm.BreadCrumbItems.Children[1].Children[18]; // select the initial item you want to show
    this.breadCrumb.CurrentItem = currentItem;
    vm.MyPath = currentItem.FullPath;
}

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vladimir
Top achievements
Rank 1
answered on 30 Jan 2019, 02:06 PM
Ok. Thank you. I'm going to try
Tags
BreadCrumb
Asked by
Gregor
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Gregor
Top achievements
Rank 1
Vladimir
Top achievements
Rank 1
Share this question
or