The MindFusion Forums
MindFusion.UI controls >> WPF >> Force DrawBackground on range selector for WPF
https://mindfusion.eu/Forum/YaBB.pl?num=1540389610

Message started by notsureusa on Oct 24th, 2018 at 2:00pm

Title: Force DrawBackground on range selector for WPF
Post by notsureusa on Oct 24th, 2018 at 2:00pm
The range selector DrawBackground event only gets called on resizing of parent container.  How would one force this event to be triggered without a resize event?

Title: Re: Force DrawBackground on range selector for WPF
Post by Lyubo on Oct 25th, 2018 at 8:57am
Hi,

The event is triggered when the background is required to render (in a Control.OnRender override). To manually force it to repaint, find the element in the range selector's template and call it's InvalidateVisual method:

[code]var bckgr = range.Template.FindName("PART_Background", range) as Control;
if (bckgr != null)
{
    bckgr.InvalidateVisual();
}[/code]

You can also try replacing the background control in the template with your own, and include your customization there.

Regards,
Lyubo

Title: Re: Force DrawBackground on range selector for WPF
Post by notsureusa on Oct 25th, 2018 at 12:33pm
Works great.  Thanks!

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.