Initial Path is duplicated

8 posts, 0 answers
  1. Gregor
    Gregor avatar
    2 posts
    Member since:
    Jun 2015

    Posted 13 Jul 2018 Link to this post

    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

     

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2134 posts

    Posted 17 Jul 2018 Link to this post

    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.
  3. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2134 posts

    Posted 18 Jul 2018 Link to this post

    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.
  4. Gregor
    Gregor avatar
    2 posts
    Member since:
    Jun 2015

    Posted 24 Jul 2018 in reply to Martin Ivanov Link to this post

    Thanks Martin,

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

     

    Regards

    Greg

  5. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2134 posts

    Posted 24 Jul 2018 Link to this post

    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.
  6. Vladimir
    Vladimir avatar
    5 posts
    Member since:
    Aug 2012

    Posted 24 Jan Link to this post

    Hi all! I have same problem. Please, explain me how you resolved it problem.
  7. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2134 posts

    Posted 28 Jan Link to this post

    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.
  8. Vladimir
    Vladimir avatar
    5 posts
    Member since:
    Aug 2012

    Posted 30 Jan in reply to Martin Ivanov Link to this post

    Ok. Thank you. I'm going to try
Back to Top