Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
Problems with custom styles
posted

Hello,

 I want to customize the look and feel of the Ribbon Bar. So I followed the recommendations of the docs and copied the Default Styles that are shipped with the library. I added the styles as resource dictionaries to my window. The app compiles fine, but the Visual Studio Designer throws error after error at me. Let me say this: This doesn't work out of the box at all. Even if I follow the documentations. I can't get this to work.

The current error I'm getting is  

"Value 'igRibbon:ButtonTool.SizingMode' cannot be assigned to property 'Property'. Invalid PropertyDescriptor value."

 This error occurs within a multitrigger of the RibbonButtonToolTemplate.

Parents Reply
  • 1215
    posted in reply to Jens
    Thanks for this extra info. Definitely helps. Will work towards creating XAML that both VS and Blend are happy with.
    Hi Grant,

    I did some testing today, in order to find a way to replicate the behavior. Here's what I have so far.

    I created a new WPF application and added all the necessary references. I added a XamRibbon in the Window1.xaml file. It showed up just fine.
    Next I created a folder "Styles" within the project and copied the the following files from the Infragistics DefaultStyles folder:

    * RibbonGeneric.xaml
    * RibbonOffice2k7Blue.xaml
    * RibbonOffice2k7Brushes__Shared.xaml
    * RibbonOffice2k7Brushes_Blue.xaml

    I added the following snippet to Window1.xaml:

        <Window.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="Styles/RibbonOffice2k7Blue.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Window.Resources>
       
    Now the Designer (Visual Studio) can't open the design view of Window1. Instead I get a bunch of error messages. All saying:

    No constructor for type 'RelativeSource' has 3 parameters.

    Surprisingly (at least for me) Expression Bleand can handle that, as it opens Window1 just fine. (Thanks for the hint, Grant)
    But I want to open the design view within Visual Studio.

    Here is an example line, the compiler complains about:

    Binding="{Binding Path=IsBelowRibbon, RelativeSource={RelativeSource FindAncestor, {x:Type igRibbon:QuickAccessToolbar}, 1}}"

    So I fixed all the lines to something like this:

    Binding="{Binding Path=IsBelowRibbon, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igRibbon:QuickAccessToolbar}, AncestorLevel=1}}"

    Now I have to fix the reference to the ApplicationMenu image.

    And the next error I get is in line 768 of RibbonGeneric.xaml:
    Value 'igRibbon:ButtonTool.SizingMode' cannot be assigned to property 'Property'. Invalid PropertyDescriptor value.

    I hope this helps.

    Ciao


    http://forums.infragistics.com/forums/p/3915/20358.aspx#20358

Children