ItemTemplateSelector with Resource Dictionary

2 posts, 1 answers
  1. IanV
    IanV avatar
    39 posts
    Member since:
    Dec 2008

    Posted 08 Jan 2019 Link to this post

    I have a nicely working ItemTemplateSelector


                   My template here

    I wish to reuse my ErrorTemplate. I have placed it in a ResourceDictionary. How can I tell my  HotlistItemSelector that the ErrorTemplate is to be found in the ResourceDictionary ?



  2. Answer
    Lance | Manager Technical Support
    Lance | Manager Technical Support avatar
    1193 posts

    Posted 08 Jan 2019 Link to this post

    Hi Ian,

    An expanded property in XAML can almost always be defined in-line, this is especially true when the object is defined as a ResourceDictionary resource.

    Let's say your DataTemplate is this:

        <DataTemplate x:Key="MyErrorTemplate">

    Then you'd do this:

      <vm:HotlistItemSelector ErrorTemplate="{StaticResource MyErrorTemplate}">

    Let me know if you have any further trouble.

    Lance | Tech Support Engineer, Sr.
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top