Telerik ThemeResources

7 posts, 0 answers
  1. Leszek
    Leszek avatar
    16 posts
    Member since:
    Jul 2012

    Posted 13 Mar Link to this post

    Hi,

    In my app, I'm using the Telerik RadDataGrid as well as standard built-in controls such as ListView. I like the styles and colors provided by Telerik and I'd like to use them in my other ListViews. For example, I'd like to use the TelerikGridAlternateRowBackgroundBrush brush.

    I have defined my brush as follows:

    <SolidColorBrush x:Key="GridRowAltBrush" Color="{ThemeResource TelerikGridAlternateRowBackgroundBrush}"/>

    ... and I also included the Telerik's theme resources in App.xaml as described here: http://docs.telerik.com/devtools/universal-windows-platform/common/teleriknamedbrushes

        <Application.Resources>
            <ResourceDictionary>
                <telerik:UserThemeResources x:Key="themeResourceInitializer"/>
                <ResourceDictionary.ThemeDictionaries>
                    <ResourceDictionary x:Key="Default">
                        <ResourceDictionary.MergedDictionaries>
                            <ResourceDictionary Source="ms-appx:///Telerik.UI.Xaml.Grid.UWP/Themes/ThemeResourcesDark.xaml"/>
                        </ResourceDictionary.MergedDictionaries>
                    </ResourceDictionary>
                    <ResourceDictionary x:Key="Light">
                        <ResourceDictionary.MergedDictionaries>
                            <ResourceDictionary Source="ms-appx:///Telerik.UI.Xaml.Grid.UWP/Themes/ThemeResourcesLight.xaml"/>
                        </ResourceDictionary.MergedDictionaries>
                    </ResourceDictionary>
                </ResourceDictionary.ThemeDictionaries>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="Common/CustomStyles.xaml"/>
                    <ResourceDictionary Source="Common/ControlTemplates.xaml"/>
                    <ResourceDictionary Source="Common/ThemeDictionaries.xaml"/>
                </ResourceDictionary.MergedDictionaries>           
            </ResourceDictionary>
        </Application.Resources>

     

    I have two problems with the above code:

    1. Visual Studio complains: "An error occurred while finding the resource dictionary ms-appx:///Telerik.UI.Xaml.Grid.UWP/Themes/ThemeResourcesDark.xaml" and "An error occurred while finding the resource dictionary ms-appx:///Telerik.UI.Xaml.Grid.UWP/Themes/ThemeResourcesLight.xaml"

    2. My GridRowAltBrush brush is always #00000001 no matter what Telerik's key I use.

     

    What am I doing wrong? How could I use the Telerik's styles?

    Thanks,

    Leszek

     

  2. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    691 posts

    Posted 16 Mar Link to this post

    Hi Leszek,

    I have prepared a sample app to demonstrate how to use our Telerik Named Brushes. Please, see the attached file and let me know should you have any questions.

    Regards,
    Ivaylo Gergov
    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. Leszek
    Leszek avatar
    16 posts
    Member since:
    Jul 2012

    Posted 16 Mar Link to this post

    Thanks Ivaylo for your response.

    I have tried to launch your project but I got an error and two warnings:

    Error: Could not find SDK "Telerik UI For Universal Windows Platform, Version=2017.1.118.45". TelerikNamedBrushesExample   
    Warning: Failed to resolve all project references for 'TelerikNamedBrushesExample'. The package restore result
    Warning: The referenced component 'Telerik UI For Universal Windows Platform' could not be found. TelerikNamedBrushesExample   

    I removed the reference to Telerik UI For Universal Windows Platform and installed the package 'Telerik.for.UniversalWindowsPlatform' from NuGet. The application launched. I'm not sure if it has any impact on the output.

     

    It looks I was not precise enough with my question: I don't want to define my own styles and override the Telerik's brushes. I'd like to use the Telerik's brushes in my app. I like them.

    In your example you override TelerikGridBackgroundBrush to Green and to Red. This is not what I'm looking for. I'd like to use the TelerikGridBackgroundBrush as it is in my own ListViews. I don't want to override it.

    I know I could use your approach and redefine Telerik's brushes to be exactly the same as they already are in the Telerik's package but this would be double work: why to re-define brushes to the ones that already come with Telerik?

    I'm not sure if I'm clear enough. Let me know.

    Thanks,

    Leszek

     

     

     

     

  4. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    415 posts

    Posted 16 Mar Link to this post

    Hello Leszek,

    The reason you had a reference issue is because you're not using the Commercially License version of UI for UWP. We do not provide support for the open source version, see the support policy for UI for UWP here.

    For your convenience, I have pasted in that section below:

    -----------------------------------------------------------------------------------

    Getting Help

    As a fully-open source project, UI for UWP is a primarily community-supported project, as such, you are encouraged to use forums like Stack Overflow to post questions, and the issues list of this repo to report bugs.

    The UI for UWP team does not provide formal support, except to those customers who have purchased a commercial license for UI for UWP. Please do not create support requests for this project in the issues list for this repo, as these will be immediately closed. You'll be directed to post your question on a community forum.

    -----------------------------------------------------------------------------------

    Since you do not currently have a license (trial or paid), you fall under the open source qualification. If you'd like to get a license, you can do so here.

    Otherwise, you can use the following StackOverflow tag: https://stackoverflow.com/search?q=ui-for-uwp 

    Thank you for your understanding in this matter. 

    Regards,
    Lance | Tech Support Engineer, Sr.
    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
  5. Leszek
    Leszek avatar
    16 posts
    Member since:
    Jul 2012

    Posted 16 Mar in reply to Lance | Tech Support Engineer, Sr. Link to this post

    Hi Lance,

    I was not aware that users who do not have a licence for UWP UI should not use this forum. I have a licence for ASP.NET UI. I thought this forum was open to everybody who wanted to extend their knowledge about Telerik controls and help Telerik to find bugs in their products.

    I will ask my questions somewhere else then.

    Thanks for your help.

    Leszek

     

  6. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    415 posts

    Posted 16 Mar Link to this post

    Hi Leszek,

    The confusion is completely understandable! 

    The UI for UWP is a new and unique case where we have defined a different approach for support regarding an open source product type. There will be a period of time where the support options will overlap.

    Normally, as you're familiar with UI for ASP.NET AJAX, these forums would be ideal for the main community support channel. However with UI for UWP, we chose a different approach that will empower the community and make UI for UWP stronger.

    Additionally, by submitting issues to the GitHub repo and where relevant tying the issue to a StackOverflow post, we'll be able to implement fixes directly to the product and include those in a future release.

    Please let me know if you have any further questions or concerns and thank you for choosing UI for UWP for your project!

    Regards,
    Lance | Tech Support Engineer, Sr.
    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
  7. Maks
    Maks avatar
    4 posts
    Member since:
    Aug 2017

    Posted 16 Aug Link to this post

    Thanks for the info!
Back to Top