Inherit custom class from Panel and VirtualStackPanel
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 param开发者_运维问答eter 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
Found the solution for same,
Implementing IScrollInfo interface solves the problem. By using IScrollInfo one can implement his/her own scroll containers.
精彩评论