How to use the NoXaml binaries

16 posts, 1 answers
  1. Jason D
    Jason D avatar
    72 posts
    Member since:
    Jan 2011

    Posted 14 Jan 2014 Link to this post

    I discovered the NoXaml binaries and would like to use them because of the smaller size, but I do not really understand them since I don't use themes anyway. I dragged the noxaml map into a new WPF project for testing but nothing is showing up. Do I still have to include at least one theme dll? That would seem to defeat the purpose for me since the MapNoXAML+Theme is the same size as the normal Map dll. Thanks.
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 15 Jan 2014 Link to this post

    Hello Jason,

    The NoXaml binaries are used for applications which use Implicit Styles concept.

    I would recommend you to take a look at the following documentation topic:

    http://www.telerik.com/help/wpf/styling-apperance-implicit-styles-overview.html

    Regards,
    Andrey Muzov
    Telerik

    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.

    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jason D
    Jason D avatar
    72 posts
    Member since:
    Jan 2011

    Posted 15 Jan 2014 Link to this post

    I saw that, but I do not understand it. I did not even know there were themes. If I use a noxaml dll, do i have to include a theme dll too?
  5. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 16 Jan 2014 Link to this post

    Hello Jason,

    Let me try to first elaborate a bit more on the NoXaml dlls concept. Basically, in order to display a WPF component, you need to apply a default ControlTemplate for it. This is why all our components come with a default set of styles and ControlTemplates. The normal assemblies we provide include the implementation of the components along with these default styles. However, as our assemblies contain multiple components, they also contain all relevant default styles for these components which makes the assembly size larger. But most of our customer only use a few components in their applications and we decided to give them the option to choose which style resources they want to include in their projects. This is why we created the NoXaml dlls which do not include any xaml code - no default styles, brushes or ControlTemplates. However, as these assemblies do not specify a default ControlTemplate for the components, when you use them, the RadControls have no default visualization and you can't see anything in runtime or design-time.

    Also, please note that the themes we have are essentially different variants of all default styles for our controls and the default theme - OfficeBack, basically represents all default styles and RadControls ControlTemplates included in the normal assemblies.

    The article I suggested in my previous reply basically explains that when you use a NoXaml dll, you have to manually add a style/ControlTemplate for the RadControls you need in your application. We have provided two different options for that - you can use the theme dlls which are located in Binaries.NoXaml folder (Telerik.Windows.Themes.Expression_Dark.dll, Telerik.Windows.Themes.Windows8.dll, etc.), or you can use the resource dictionaries by assembly name from the Themes.Implicit folder:
    …/Themes.Implicit/<platform>/OfficeBlack/Themes/Telerik.Windows.Controls.xaml

    If you go with the first option, you will include all RadControls styles for a theme in your solution through a dll. As this dll basically contains ResourceDictionaries you will also have to include the ResourceDictionaries you need to use in the resources of your window or application:
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>               
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>

    If you choose the second option, you should create a Themes folder in your project and copy the corresponding XAML files from Themes.Implicit/../OfficeBlack/../Themes/ folder to your Themes folder. Then you need to merge these ResourceDictionaries in the App.xaml file:
    <Application x:Class="RadControlsNoXaml.App"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 StartupUri="MainWindow.xaml">
        <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="Themes/Telerik.Windows.Controls.xaml" />
                    <ResourceDictionary Source="Themes/Telerik.Windows.Controls.DataVisualization.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Application.Resources>
    </Application>

    The second approach also allows you to further edit the ResourceDictionaries and remove the styles and resources that you won't need in your application thus further reducing the size of your application.

    I hope this information helps.

    Regards,
    Andrey Murzov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.

    Sign up for Free application insights >>
  6. Jason D
    Jason D avatar
    72 posts
    Member since:
    Jan 2011

    Posted 16 Jan 2014 Link to this post

    Yes, that was immensely helpful. I would suggest adding that first paragraph to the documentation. The map now shows up and my install size will be smaller! Also, I now know how to modify the style (I've been wanting to increase the font sizes). Thanks again.
  7. Eli
    Eli avatar
    1 posts
    Member since:
    Oct 2014

    Posted 24 Oct 2014 in reply to Jason D Link to this post

    I agree with Jason, the explanation given here sheds a great amount of insight on the subject and would be a valuable addition to the documentation.
  8. Pierre
    Pierre avatar
    23 posts
    Member since:
    Oct 2015

    Posted 12 Nov 2015 Link to this post

    "However, as these assemblies do not specify a default ControlTemplate for the components, when you use them, the RadControls have no default visualization and you can't see anything in runtime or design-time."

    If I don't see anything in design-time (which is the case for me), how am I suppose to design the user interface?

  9. Pierre
    Pierre avatar
    23 posts
    Member since:
    Oct 2015

    Posted 12 Nov 2015 in reply to Pierre Link to this post

    Ok, answered my own question.  I'm relatively new to WPF and had to learn how a ResourceDictionary works.  I added the "Themes.Implicit\WPF40" XAML in the project and I can see the GUI now.
  10. Sia
    Admin
    Sia avatar
    667 posts

    Posted 16 Nov 2015 Link to this post

    Hello,

    I just want to remind that we recommend having the XAML files copied locally in the project only if you need a fully customized theme, because otherwise this makes upgrading and maintaining a time-consuming task. In most cases the first option that my colleague Andrey pointed - by referencing the theme binary and having all customized styles in a resource dictionary (or dictionaries) that is merged after the telerik ones - is easier for maintaining.

    Regards,
    Sia
    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
  11. Pierre
    Pierre avatar
    23 posts
    Member since:
    Oct 2015

    Posted 16 Nov 2015 in reply to Sia Link to this post

    Indeed, I've removed Telerik's XAML files from the project and the GUI is still rendered correctly.

    It is so confusing when using VS2015.  Sometimes the GUI is fine, sometimes it's not rendered.  Sometimes OK in x86 but not x64, sometimes OK in x64 but not x86.  Unfortunately, it's not possible to know who's to blame.

  12. Sia
    Admin
    Sia avatar
    667 posts

    Posted 17 Nov 2015 Link to this post

    Hello,

    Indeed there are several known issues with the VS 2015 designer. We have already submitted the following two:

    Designer error "The property Command does not have an accessible setter" for a control implementing ICommandSource in WPF application with x64 Platform target


    Designer Error "Can only base on a Style with target type that is base type CustomControl" when a style is BasedOn a style of an abstract class


    Regards,
    Sia
    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
  13. Wayne
    Wayne avatar
    10 posts
    Member since:
    Feb 2015

    Posted 21 Apr in reply to Sia Link to this post

    I've been working with Telerik (the WPF ribbon) for quite some time. I am currently trying to switch from using StyleManager to using the Implict themes, because my ultimate goal is to potentially change from the Windows8 theme to a different theme, but for now I just want to get the Windows8 theme working using the Implicit theme approach.

    I have changed from referencing the regular binaries (that we build ourselves from Telerik source) to NoXaml ones (i.e., Release.NoXaml). I have added references to the Telerik theme dll (that is also built Release.NoXaml).

    I have also added to app.xaml the following:

            <ResourceDictionary x:Key="Windows8">
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.RibbonView.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>

    I have to use a key [<ResourceDictionary x:Key="Windows8">] (unlike the sample provided by Telerik, since it won't compile without one). I'm not sure what key name to use, so I just used the theme name.

    After doing all this, the ribbon no longer renders at all. I can't get it to work at all and I'm stuck.

    I have some questions;

    1. What should the ResourceDictionary Key be named?

    2. Other than referencing the Telerik.Windows.Themes.Windows8 theme dll, and adding the ResourceDictionary, what other magic is required for this to work? (i.e., what am I doing wrong?)

    3. Which solution should I be building the theme dll with? Themes.Implicit_WPF.sln or Themes_WPF.sln? (Or one of the others).

  14. Wayne
    Wayne avatar
    10 posts
    Member since:
    Feb 2015

    Posted 22 Apr in reply to Wayne Link to this post

    Adding to the previous post, I have now purged everything in the Telerik solutions. Re-extracted source. Rebuilt everything using the provided batch files. (Build_WPF40_Xamlless.bat and Build_WPF_Themes.Implicit.bat).Everything compiles and all expected output is produced.

    Still, however, I cannot get the Ribbon to even display, let alone in the correct theme. The whole form renders completely black when using a WPF parent form, and no ribbon appears when using a WinForms parent form.

    I must be doing something wrong, but I am following (as far as I can tell) all of the steps detailed above.

    Here is my current dictionary merge.

            <ResourceDictionary x:Key="Windows8">
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Data.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.RibbonView.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>

    I think for now I have to revert to using StyleManager, because it works and it's simple and it will be hard to justify to my boss that I've burned a whole day just trying to enable a theme!!!

    Hopefully I'm just stupid and am missing something obvious. If anyone is able to suggest what I might be missing, please do.

    Thanks in advance.

  15. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 22 Apr Link to this post

    Hi Jason,

    Please note that this forum targets the RadMap for WPF product. If you have questions for different product or a common questions I would ask you to open a new thread in the corresponding forum section. In your case RadRibbonView or UI for WPF.

    About the experience issue, let me get straight to your questions:
    1. What should the ResourceDictionary Key be named?
      In this scenario you don't need to set the x:Key property. However, this depends on where you merge the dictionaries and how they are referenced in your application. If you merge them in the App.xaml file they will be applied globally in the entire application and you won't need x:Key because they are implicit styles. But, if there are other resource in the Resources dictionary where you add the resource with the merged the themes, you will probably need an x:Key or just wrap the other resources in a new dictionary in the merged resources.

      So the answer of your question is, the x:Key can be named whatever you like.

    2. Other than referencing the Telerik.Windows.Themes.Windows8 theme dll, and adding the ResourceDictionary, what other magic is required for this to work? (i.e., what am I doing wrong?)
      In order to apply an implicit theme you will need to include the NoXaml version of the UI for WPF dlls along with the theme dll (example: Telerik.Windows.Themes.Windows8). Then you will need to merge the themes resources. For example, you can do this in the App.xaml so that the theme is applied to all controls in the application. You can read the Setting a Theme (Using Implicit Styles) help article to see how this is done.

    3. Which solution should I be building the theme dll with? Themes.Implicit_WPF.sln or Themes_WPF.sln? (Or one of the others).
      I am not sure that I understand this completely but I guess the question is which project to build in order to get implicit themes dlls. If so, the project you need is Themes.Implicit_WPF.sln.

    As for your last reply, I am not sure why you are using the .bat files from the source code folder. Are you building the source code or the demos of the ribboview? Do you have any changes in the source code? 

    About the black screen, this can happen if the RadRibbonWindow (or RadWindow) is used. You can see how to resolve this in the last two code snippets of the Ribbon Window help article. If this is not you are case you can open a new support ticket and send a runnable project that isolates the issue so we can test it locally. 

    Note that the StyleManager is our old theming mechanism. We recommend our new implicit styles theming which brings few additional benefits and resolves some of the StyleManager's limitation. Also, we put our front-end efforts in the implicit styles and all our new themes (currently Office2013, VisualStudio2013, Green) support only the implicit styles mechanism. So, in a long term perspective the implicit styles is definitely the better choice.

    Regards,
    Martin
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  16. Wayne
    Wayne avatar
    10 posts
    Member since:
    Feb 2015

    Posted 22 Apr in reply to Martin Link to this post

    >> Please note that this forum targets the RadMap for WPF product. If you
    have questions for different product or a common questions I would ask
    you to open a new thread in the corresponding forum section. <<

    No worries; I just found this thread via Google and it looked like it was on topic, so I replied to it.

    >> But, if there are other resource in the Resources dictionary where you add the resource with the merged the themes, you will probably need an x:Key or just wrap the other resources in a new dictionary in the merged resources.<<

    I figured this one out; I had a System::String outside <ResourceDictionary> and from what I read, it implicitly gets layered into a new ResourceDictionary by the compiler. So adding this string inside the <ResourceDictionary> for the Telerik theme lines, fixed that problem. The System::String is something that Telerik requires us to have in the App.xaml file for assembly protection purposes, else I would not even have run into this conflict.

    >> In order to apply an implicit theme you will need to include the NoXaml version of the UI for WPF dlls along with the theme dll (example: Telerik.Windows.Themes.Windows8). Then you will need to merge the themes resources. For example, you can do this in the App.xaml so that the theme is applied to all controls in the application. You can read the Setting a Theme (Using Implicit Styles) help article to see how this is done. <<

    Doing all of that. Switched from regular dlls to NoXaml ones. Added a reference to Telerik.Windows.Themes.Windows8.dll. Added the App.xaml stuff. Read that article multiple times now and ended up searching and finding this thread.

    >> I guess the question is which project to build in order to get implicit
    themes dlls. If so, the project you need is Themes.Implicit_WPF.sln. <<

    Ok, this is what I assumed, so that's what I had tried (amongst other things).

    >> As for your last reply, I am not sure why you are using the .bat files from the source code folder <<

    Well, initially I was building every solution manually, and when that didn't work, I resorted to giving the batch files a shot out of pure desperation. They appear to work (everything builds), but when I follow the prescribed steps to reference the NoXaml dlls (the ones I built) and the Theme dll (the one I built), and include the merged resources, it doesn't work. I get the BSOD (where B = black).

    >> Are you building the source code or the demos of the ribboview? <<

    Source code.

    >> Do you have any changes in the source code? <<

    Yes, for a variety of reasons including:

    1. So the Telerik source would compile (potentially an issue with different version of C# compiler in one location).

    2. To meet Telerik licensing requirements (we are explicitly told to modify source to meet those requirements).

    3. To fix or work around issues with the RibbonView.

    4. Removing project references to files that don't exist (class diagrams). In one location.

    But since I know you will ask this question, yes, I have tried reverting all custom changes to the code, rebuilding everything, and this still did not help.

    >> Note that the StyleManager is our old theming mechanism. We recommend our new implicit styles theming which brings few additional benefits and resolves some of the StyleManager's limitation. Also, we put our front-end efforts in the implicit styles and all our new themes (currently Office2013, VisualStudio2013, Green) support only
    the implicit styles mechanism.<<

    Precisely why I am trying to switch from StyleManager, although my issue is more with the Windows8 theme (less colors/granularity) than the StyleManager itself. I want to try the VisualStudio2013 theme and realize that I need to use the Implict theme support to do this.

    >> So, in a long term perspective the implicit styles is definitely the better choice.<<

    Again, precisely why I am subjecting myself to this discomfort. :)

    I think I might grab the Telerik compiled assemblies, and start with a clean project just to make sure that I can get things to work with that, then, if that gives me any insights on to why it's not working with the actual project (when StyleManager seems to work just fine), I will post an additional question in the correct forum and/or contact support directly.

    Cheers.

     

     

     

     

  17. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 26 Apr Link to this post

    Hi Wayne,

    Thank you for the detailed answer.

    I hope starting with a clean project will help you with resolving the issue. However, if you need any further assistance you can open a new Support Ticket from your telerik account and send a runnable project which can be tested.

    Regards,
    Martin
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WPF is Visual Studio 2017 Ready