- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.Scheduling library for HTML5 & JavaScript.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Force DrawBackground on range selector for WPF
Read 674 times

notsureusa   Offline
YaBB Newbies
*
Posts: 3
I Love MindFusion!


   
     
 
Force DrawBackground on range selector for WPF
Oct 24th, 2018 at 3: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?
 
 
 
IP Logged    
 
     

Lyubo   Offline
Full Member
***
Posts: 226
Gender: male
MindFusion team


   
     
 
Re: Force DrawBackground on range selector for WPF
Reply #1 - Oct 25th, 2018 at 9: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();
} 



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

Regards,
Lyubo
 
 
 
IP Logged    
 
     

notsureusa   Offline
YaBB Newbies
*
Posts: 3
I Love MindFusion!


   
     
 
Re: Force DrawBackground on range selector for WPF
Reply #2 - Oct 25th, 2018 at 1:33pm
 
Works great.  Thanks!
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print