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
90
Setting the theme on a Derrived Control
posted

I have created a control derived from the xamComboEditor, however when i set the Theme Property it is not applied. I believe this is because in the background the Theme is applying a style, which has a TargetType of xamComboEditor. Is there any way i can use the infragistics supplied themes on a class that is derived from the infragistics control?

A simple example of what i am trying to achieve is shown below.

<Window x:Class="wpfInfragisticsLookupTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" xmlns:igEditors="http://infragistics.com/Editors" xmlns:my="clr-namespace:wpfInfragisticsLookupTest">
    <StackPanel>
        <igEditors:XamComboEditor Name="xamComboEditor1" Theme="Office2010Blue"/>
        <my:xamLookup x:Name="xamLookup1" Theme="Office2010Blue"/>
    </StackPanel>
</Window>

 

namespace wpfInfragisticsLookupTest
{
    public class xamLookup:Infragistics.Windows.Editors.XamComboEditor
    {
        public xamLookup()
            : base() {}
    }
}

Parents
No Data
Reply
  • 54937
    Offline posted

    I have a blog post which talks about common styling issues like this one. In your case you can probably set the style property to a dynamic resource in code. I.e. in your ctor do something like:

    this.SetResourceReference(StyleProperty, typeof(XamComboEditor));

Children
No Data