Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Class based on VirtualizingPanel

Closed Thread
 
Thread Tools Display Modes
Old 01-10-2006   #1 (permalink)
Mikhail
Guest


 

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
Old 01-10-2006   #2 (permalink)
Drew Marsh
Guest


 

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


Old 01-10-2006   #3 (permalink)
Mikhail
Guest


 

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
>
>
>

Old 02-02-2006   #4 (permalink)
MueMeister
Guest


 

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.
>

Old 02-04-2006   #5 (permalink)
Erno
Guest


 

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
>>
>>
>>



Old 03-03-2006   #6 (permalink)
Marcus
Guest


 

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!

Old 03-03-2006   #7 (permalink)
Marcus
Guest


 

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!

Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class not registered Scott Vista General 1 01-31-2008 05:01 PM
Creating a WMI class urkec PowerShell 5 01-29-2008 04:16 PM
Re: using xp based drive as slave on new vista based computer?? wallster Vista installation & setup 1 02-17-2007 11:02 AM
wmi win32_scheduledjob class Karl-Ernst.Prankel PowerShell 5 11-03-2006 08:44 AM
PowerShell Class Hayato Iriumi PowerShell 4 11-02-2006 11:18 PM








Vistax64.com 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 2005-2008

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 47 48 49 50