- Welcome, Guest. Please Login or Register
MindFusion  
  We are soon releasing MindFusion.JavaScript pack. Initial version includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are the beta version and live demo for anyone interested.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Force DrawBackground on range selector for WPF
Read 1210 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
Senior Member
****
Posts: 285
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