Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF repaint issue

I am having an issue with repaint of my WPF control.

The WPF control is added as an ElementHost.Child for a Windows form.

When Windows 7 goes into powersave mode and is brought back to normal (by moving the mouse or key press on keyboard), the rest of Windows form controls are repainted, however the WPF part is not repainted(and the Win 7 background is visible in that area).

On Minimize and maximise of the application, the WPF part is repainted.

Anyone has any idea about this problem?

like image 486
Student_sjce Avatar asked May 11 '11 10:05

Student_sjce


1 Answers

The solution for this issue was provided in MSDN magazine a while back. It shows how you can make your WPF applications "power-aware" i.e. respond to power notifications. It's an amazing article and a "must-read".

Check this link: Make Your WPF Apps Power-Aware

You can browse the source code online or download it from here: Code for PowerAware

Technologies used:

  • WPF
  • .Net Framework 3.0
  • Windows Vista / Windows XP
like image 168
Hasan Fahim Avatar answered Oct 02 '22 05:10

Hasan Fahim