Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Force DrawBackground on range selector for WPF (Read 4217 times)
notsureusa
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Mar 5th, 2018
Force DrawBackground on range selector for WPF
Oct 24th, 2018 at 2:00pm
Print Post  
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?
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Force DrawBackground on range selector for WPF
Reply #1 - Oct 25th, 2018 at 8:57am
Print Post  
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
Select All
var bckgr = range.Template.FindName("PART_Background", range) as Control;
if (bckgr != null)
{
    bckgr.InvalidateVisual();
} 



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

Regards,
Lyubo
  
Back to top
 
IP Logged
 
notsureusa
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Mar 5th, 2018
Re: Force DrawBackground on range selector for WPF
Reply #2 - Oct 25th, 2018 at 12:33pm
Print Post  
Works great.  Thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint