Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Class based on VirtualizingPanel

 
 
Old 01-10-2006   #1 (permalink)
Mikhail


 
 

Class based on VirtualizingPanel

Can you give an example how to write my own class based on VirtualizingPanel?
I need something like VirtualizingFlowPanel.
Thanks

--
Mikhail

My System SpecsSystem Spec
Old 01-10-2006   #2 (permalink)
Drew Marsh


 
 

Re: Class based on VirtualizingPanel

Mikhail wrote:

> Can you give an example how to write my own class based on
> VirtualizingPanel?
> I need something like VirtualizingFlowPanel.


Virtualizing is all about understanding your current view port in terms of
virtual scroll space and, thus, what elements need to actually exists in
the logical/visual trees at that time. Therefore the key to virtualizing
lies in implementing IScrollInfo and invalidating yourself so that you re-arrange
your innards accordingly. During the measure/arrange phases you would destroy
the elements that are no longer within the viewport and create the elements
that are coming into the view port. You have to be smart about it though
because you want to retain a responsive UI. I suggest digging into the IL
of VirtualizingStackPanel to see how they implement some of it there.

That said, I don't think you can magically make something virtualizable.
If you look at VirtualizingStackPanel it's a total re-write of StackPanel
with all the virtualizing logic added on. So unless you're prepared to re-write
all the logic of TextFlow, I'm not sure how you can really tack virtualization
on.

Maybe someone else can shed some light on this and prove me wrong...?

Cheers,
Drew


My System SpecsSystem Spec
Old 01-10-2006   #3 (permalink)
Mikhail


 
 

Re: Class based on VirtualizingPanel

Hi,
Thanks for answer. My problem is very simple: I need to implement a photo
browser. I would like to have a virtual list view with flow layout that was
implemented in the Win32 list view control (LVS_ICON flag). Currently if I
use ListView class from WPF it uses VirtualizingStackPanel that makes
vertical layout only (ItemsHost=VirtualizingStackPanel). If I use
ItemsContent class (that is used in all MS samples) it uses WrapPanel class
that is not virtual (ItemsHost=WrapPanel). So, all images are loaded at
startup. I can replace the panel but I need to know the details of
implementation of VirtualizingStackPanel to write my own.

--
Mikhail


"Drew Marsh" wrote:

> Mikhail wrote:
>
> > Can you give an example how to write my own class based on
> > VirtualizingPanel?
> > I need something like VirtualizingFlowPanel.

>
> Virtualizing is all about understanding your current view port in terms of
> virtual scroll space and, thus, what elements need to actually exists in
> the logical/visual trees at that time. Therefore the key to virtualizing
> lies in implementing IScrollInfo and invalidating yourself so that you re-arrange
> your innards accordingly. During the measure/arrange phases you would destroy
> the elements that are no longer within the viewport and create the elements
> that are coming into the view port. You have to be smart about it though
> because you want to retain a responsive UI. I suggest digging into the IL
> of VirtualizingStackPanel to see how they implement some of it there.
>
> That said, I don't think you can magically make something virtualizable.
> If you look at VirtualizingStackPanel it's a total re-write of StackPanel
> with all the virtualizing logic added on. So unless you're prepared to re-write
> all the logic of TextFlow, I'm not sure how you can really tack virtualization
> on.
>
> Maybe someone else can shed some light on this and prove me wrong...?
>
> Cheers,
> Drew
>
>
>

My System SpecsSystem Spec
Old 02-02-2006   #4 (permalink)
MueMeister


 
 

Re: Class based on VirtualizingPanel

Hey Mikhail,

I have the same problem. Did you find some resources on how
to implement such a VirtualFlowPanel? I mean, digging in the
IL of VirtualizungStackPanel is not helpful cause they use not
documented interfaces like IItemsContainerGenerator and confusing
goto statements a.s.o. It's not that easy to rewrite a panel like this
cause it seems that especially IItemsContainerGenerator interface has
terrible side effects on invalidating the UI!

A tutorial or even a chart how to implement WPF virtualization would be
great! Don't want to rewrite my own mechanism if there is already one!

Chris :-)

Mikhail wrote:
> Hi,
> Thanks for answer. My problem is very simple: I need to implement a photo
> browser. I would like to have a virtual list view with flow layout that was
> implemented in the Win32 list view control (LVS_ICON flag). Currently if I
> use ListView class from WPF it uses VirtualizingStackPanel that makes
> vertical layout only (ItemsHost=VirtualizingStackPanel). If I use
> ItemsContent class (that is used in all MS samples) it uses WrapPanel class
> that is not virtual (ItemsHost=WrapPanel). So, all images are loaded at
> startup. I can replace the panel but I need to know the details of
> implementation of VirtualizingStackPanel to write my own.
>

My System SpecsSystem Spec
Old 02-04-2006   #5 (permalink)
Erno


 
 

Re: Class based on VirtualizingPanel

A better way could be to write a custom datasource and make that
asynchronous.

Take a look at:
http://www.sellsbrothers.com/writing...hangeNotes.htm

Scroll to ObjectDataProvider and Custom Data Source Providers

Cheers,

Erno
----
WPF tutorials: http://blogs.infosupport.com/ernow/articles/1878.aspx



"Mikhail" <Mikhail@discussions.microsoft.com> wrote in message
news:E472A4E3-D285-45E8-9D67-642D49BA4ACC@microsoft.com...
> Hi,
> Thanks for answer. My problem is very simple: I need to implement a photo
> browser. I would like to have a virtual list view with flow layout that
> was
> implemented in the Win32 list view control (LVS_ICON flag). Currently if I
> use ListView class from WPF it uses VirtualizingStackPanel that makes
> vertical layout only (ItemsHost=VirtualizingStackPanel). If I use
> ItemsContent class (that is used in all MS samples) it uses WrapPanel
> class
> that is not virtual (ItemsHost=WrapPanel). So, all images are loaded at
> startup. I can replace the panel but I need to know the details of
> implementation of VirtualizingStackPanel to write my own.
>
> --
> Mikhail
>
>
> "Drew Marsh" wrote:
>
>> Mikhail wrote:
>>
>> > Can you give an example how to write my own class based on
>> > VirtualizingPanel?
>> > I need something like VirtualizingFlowPanel.

>>
>> Virtualizing is all about understanding your current view port in terms
>> of
>> virtual scroll space and, thus, what elements need to actually exists in
>> the logical/visual trees at that time. Therefore the key to virtualizing
>> lies in implementing IScrollInfo and invalidating yourself so that you
>> re-arrange
>> your innards accordingly. During the measure/arrange phases you would
>> destroy
>> the elements that are no longer within the viewport and create the
>> elements
>> that are coming into the view port. You have to be smart about it though
>> because you want to retain a responsive UI. I suggest digging into the IL
>> of VirtualizingStackPanel to see how they implement some of it there.
>>
>> That said, I don't think you can magically make something virtualizable.
>> If you look at VirtualizingStackPanel it's a total re-write of StackPanel
>> with all the virtualizing logic added on. So unless you're prepared to
>> re-write
>> all the logic of TextFlow, I'm not sure how you can really tack
>> virtualization
>> on.
>>
>> Maybe someone else can shed some light on this and prove me wrong...?
>>
>> Cheers,
>> Drew
>>
>>
>>



My System SpecsSystem Spec
Old 03-03-2006   #6 (permalink)
Marcus


 
 

Re: Class based on VirtualizingPanel

Maybe you guys already solved all your problems, but there is an
interesting blog from Dan Crevier about implementing a custom
VirtualizingPanel...

There is a total of 4 posts, the 4th post providing complete code of
the sample project...

Basically, re-using the VirtualizingPanel, you simply have to provide
Layout logic...

See the posts at:

http://blogs.msdn.com/dancre/archive...06/526310.aspx
http://blogs.msdn.com/dancre/archive...13/531550.aspx
http://blogs.msdn.com/dancre/archive...14/532333.aspx
http://blogs.msdn.com/dancre/archive...16/533870.aspx

The complete project in post 4 is enough so you could complete your
"Flow" Panel!!! in fact, the example is 95% of what you need!

My System SpecsSystem Spec
Old 03-03-2006   #7 (permalink)
Marcus


 
 

Re: Class based on VirtualizingPanel

Maybe you guys already solved all your problems, but there is an
interesting blog from Dan Crevier about implementing a custom
VirtualizingPanel...

There is a total of 4 posts, the 4th post providing complete code of
the sample project...

Basically, re-using the VirtualizingPanel, you simply have to provide
Layout logic...

See the posts at:

http://blogs.msdn.com/dancre/archive...06/526310.aspx
http://blogs.msdn.com/dancre/archive...13/531550.aspx
http://blogs.msdn.com/dancre/archive...14/532333.aspx
http://blogs.msdn.com/dancre/archive...16/533870.aspx

The complete project in post 4 is enough so you could complete your
"Flow" Panel!!! in fact, the example is 95% of what you need!

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
When a class is both an inherited class of another, and alsoimplements an interface method .NET General
Creating a class in a HTA VB Script
win32_pingstatus class / dns class PowerShell
Re: using xp based drive as slave on new vista based computer?? Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46