views:

16

answers:

0

Hi

I am implementing a my custom class which needs to be derived from Panel.

After inheriting from Panel, the overridden method "MeasureOverride" gets the default size.

In my xaml page, I am using ListBox for which no width and height is specified and this custom panel is called from ItemsPanel Template.

When the class is derived from Panel class, the width and height received in the parameter is infinity.

But, deriving the same class, from VirtualStackPanel, I get height and width ( the size in which parent control gets displayed).

Any idea, why this behavior? I need to derive the my control from Panel class but in that case needs the parent width & height size (calculated size based on the visible area available).

Regards Rajesh