views:

50

answers:

2

Im using WritableBitMap to Create a Thumb Image From a UserContol but its not renderer correctly my image. The Problem is Width and Height of UserControl is set to NAN.(I Think So)

Scenario:

  • I Have a "Window" (UserControl) Navigator and need to create a list of opened Windows (UserControl) white a Thumb Image from each one, to show on a panel.
  • Only current window is rendered correctly on thumb, other "windows" (UserControl) show all components in a "0,0" position because the current width and height of UserControl is not Defined (NaN).(I Think So)

Help, Thanks!

A: 

Use the ActualWidth and ActualHeight of the UserControl.

Michael S. Scherotter
A: 

"Use the ActualWidth and ActualHeight of the UserControl."

commentator above is right, but you need to get this values by using Dispatcher, because it's always is zero, here is the sample:
Dispatcher.BeginInvoke(() =>
{
//[your_control].ActualWidth;
//[your_control].ActualHeight;
});

Alexander Bykin
thank's , but don't work , result is the same ActualWith =0 for a non rendered control.
CrazyJoe