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
1285
How to add Hoverless Style resource in C#
posted

I need to apply the Hoverless resource that is in this blog:

http://blogs.infragistics.com/blogs/kiril_matev/archive/2010/10/26/optimizing-xamdatagrid-performance.aspx

I only need to apply it if app is running via RDP. When I add it in xaml as described in the blog it works. But I can't get it to work when I add it in c#. 

I tried:

ResourceDictionary resDic = new ResourceDictionary();

resDic.Source = new Uri("/CAPPS;component/Styles/HoverlessStyles.xaml",UriKind.RelativeOrAbsolute);

xamDataGridPeriods.Resources.Add("hoverLess", resDic);

Also:

xamDataGridPeriods.Resources.Add("hoverLess", Application.LoadComponent( new Uri("/CAPPS;component/Styles/HoverlessStyles.xaml", UriKind.RelativeOrAbsolute)) as ResourceDictionary);

I tried these in the constructor of the window after InitializeComponent(); call.
Any ideas? I know this is probably more of a generic WPF question, but any help would be greatly appreciated thanks.
Rick

Parents
  • 1285
    posted

    LOL, just figured it out.

    I just did this:

    xamDataGridPeriods.Resources.Source = new Uri("/CAPPS;component/Styles/HoverlessStyles.xaml", UriKind.RelativeOrAbsolute);

Reply Children
No Data