Unable to use App resources to define styles

4 posts, 0 answers
  1. Cornelius
    Cornelius avatar
    1 posts
    Member since:
    May 2017

    Posted 08 May Link to this post

    Good day,

     

    I am trying to centralize all the styling information in my apps resource dictionary, but I am not able to use the resources to define the styles for the RadListView.

    This works:

    <telerikDataControls:RadListView.PressedItemStyle>
                    <telerikListView:ListViewItemStyle BackgroundColor="#F2F2F2" BorderColor="#e9e9e9" BorderWidth="1" BorderLocation="Bottom"/>
                </telerikDataControls:RadListView.PressedItemStyle>

     

    This does not work:

    <telerikDataControls:RadListView.PressedItemStyle>
                   <telerikListView:ListViewItemStyle BackgroundColor="{DynamicResource MedLightGrey}" BorderColor="{DynamicResource LightGrey}" BorderWidth="1" BorderLocation="Bottom"/>
               </telerikDataControls:RadListView.PressedItemStyle>

     

    It gives me an error: "No property, bindable property, or event found for 'BackgroundColor' "

    I also get the same issue when trying to define ListViewItemStyle in my Resource Dictionary.

    Thanks & Regards
    Cornelius Kruger

     

     

  2. Nikolay Demirev
    Admin
    Nikolay Demirev avatar
    134 posts

    Posted 11 May Link to this post

    Hi Cornelius,

    The ListViewItemStyle properties are not BindableProperties. That is why you can not set them using DynamicResources. I have logged this as a feature request in our backlog. Here is a public item in our Feedback Portal where you can upvote and follow it in order to receive updates about the progress on the matter.

    Meanwhile, you could move the entire ListViewItemStyle instance in your application's styles. And set the RadListView.PressedItemStyle property using the DynamicReource from the styles.

    Regards,
    Nikolay Demirev
    Telerik by Progress
    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
  3. Bradley
    Bradley avatar
    9 posts
    Member since:
    Dec 2013

    Posted 15 May in reply to Nikolay Demirev Link to this post

    Can you provide an example of this for those of us new to Xamarin.  Not sure if I know how to properly let the structure for this object :).
  4. Nikolay Demirev
    Admin
    Nikolay Demirev avatar
    134 posts

    Posted 18 May Link to this post

    Hello Bradley,

    I have created a sample project which shows how you can define ListViewItemStyle in a ResourceDictionary and use it for the ListView.PressedItemStyle property value. You can find it attached. 

    I hope this helps.

    Regards,
    Nikolay Demirev
    Telerik by Progress
    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