These are chat archives for AvaloniaUI/Avalonia

24th
May 2016
Steven Kirk
@grokys
May 24 2016 16:30
@/all i've added #545 as a WIP PR for virtualization. you can try out a simple demo in the XamlTestApplication - feedback/review welcome. it all seems too simple; what have i missed? ;)
Steven Kirk
@grokys
May 24 2016 16:54
@jkoritzinsky would be particularly interested for you to do a review as you probably understand the internals more than anybody at this point
Steven Kirk
@grokys
May 24 2016 18:36
(i'm still finding bugs so ignore those ;) )
danwalmsley
@danwalmsley
May 24 2016 20:01
@grokys been busy tonight will try and give it a quick go before I goto bed
Steven Kirk
@grokys
May 24 2016 20:03
No problem, still lots of bugs and problems
danwalmsley
@danwalmsley
May 24 2016 20:52
@grokys when you load the xamltestapp
then click to another tab other than virtualization
then go back to virtualization tab
the list disappears?
Steven Kirk
@grokys
May 24 2016 20:53
yeah, that's one of the bugs ;)
danwalmsley
@danwalmsley
May 24 2016 20:53
:)
I scrolled down then up
but it failed to scroll back up
Steven Kirk
@grokys
May 24 2016 20:53
it's at a very early stage atm - i was hoping to get feedback more on the architecture than expecting it to work right now
danwalmsley
@danwalmsley
May 24 2016 20:54
ah ok
sure
I'll have a look at the code a bit too
Steven Kirk
@grokys
May 24 2016 20:55
though scrolling back up should work...
danwalmsley
@danwalmsley
May 24 2016 20:55
if you scroll to the very end by dragging thumb with mouse
and reasonably quickly
it stops scrolling back up on the return after a few rows
Steven Kirk
@grokys
May 24 2016 20:55
ah there's an exception getting thrown
there's a test for scrolling down fast but not up ;)
need a Math.Abs in there
well spotted :)
danwalmsley
@danwalmsley
May 24 2016 21:01
will virtualization be enabled by default for items control
Steven Kirk
@grokys
May 24 2016 21:01
that's fixed
danwalmsley
@danwalmsley
May 24 2016 21:01
I think in wpf you had to do something like this...
Steven Kirk
@grokys
May 24 2016 21:01
like WPF: for ListBox it's enabled by default, for ItemsControl not
danwalmsley
@danwalmsley
May 24 2016 21:01
<ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
and
Steven Kirk
@grokys
May 24 2016 21:02
ItemsControl doesn't have a ScrollViewer so even that won't work in WPF
danwalmsley
@danwalmsley
May 24 2016 21:02
<ItemsControl
    VirtualizingStackPanel.IsVirtualizing="True"
Steven Kirk
@grokys
May 24 2016 21:03
and the same here
danwalmsley
@danwalmsley
May 24 2016 21:03
ah ok that's true
you have to override the template in wpf to add a scrollviewer
ok cool
Steven Kirk
@grokys
May 24 2016 21:04
yeah, i think i'm going to keep that the same to avoid confusion
though i can be persuaded otherwise
danwalmsley
@danwalmsley
May 24 2016 21:09
I don't mind keeping the same
@grokys what is happening during scrolling? If I change to 20000 items then the scrollbar isn't smooth
it kind of freezes and then suddenly jumps to where I have scrolled to
Steven Kirk
@grokys
May 24 2016 21:12
hmm yeah
something's slowing it down
danwalmsley
@danwalmsley
May 24 2016 21:13
is it because the cpus been used up generating itemcontainers?
Steven Kirk
@grokys
May 24 2016 21:13
it shouldn't be - they should be recycled
danwalmsley
@danwalmsley
May 24 2016 21:13
ok
I'll give it go with my intellisense now, see how that looks
id had to limit it to just 50 results otherwise it was crazy slow
so might be pretty snappy now
Steven Kirk
@grokys
May 24 2016 21:14
yeah i remember
tbh it will probably just crash ;) but worth a try
danwalmsley
@danwalmsley
May 24 2016 21:22
@grokys have these changes affected scrollviewer in general?
Steven Kirk
@grokys
May 24 2016 21:23
not ScrollViewer itself, no
danwalmsley
@danwalmsley
May 24 2016 21:24
ok I was seeing some issue with scrolling on my text editor.. will dive in deeper
for some reason the InvalidateScroll Action property on IScrollable is not getting set anymore
could that have been broken?
Steven Kirk
@grokys
May 24 2016 21:27
ah you need to return IsLogicalScrollEnabled = true
danwalmsley
@danwalmsley
May 24 2016 21:28
in xaml?
Steven Kirk
@grokys
May 24 2016 21:28
from ILogicalScrollable
danwalmsley
@danwalmsley
May 24 2016 21:28
ah because of smooth scrolling?
so I should implement ILogicalScrollable instead of IScrollable?
Steven Kirk
@grokys
May 24 2016 21:29
because you can turn off logical scrolling by setting VirtualizationMode = null
yes: it's listed as a breaking change in the PR: AvaloniaUI/Avalonia#545
danwalmsley
@danwalmsley
May 24 2016 21:29
ah ok cheers missed that one
Steven Kirk
@grokys
May 24 2016 21:30
i thought i'd try to avoid that question - didn't work ;)
ok, i think i know why scrolling is slow with lots of items. i cut corners ;)
danwalmsley
@danwalmsley
May 24 2016 21:31
ok so another change is that I have to implement bring into view, which I didn't before, not sure what I have to do, to make it the same?
danwalmsley
@danwalmsley
May 24 2016 21:37
@grokys ok maybe you already know about this
but if the ItemsSource is updated
the ItemsContainers are not regenerated
so it shows the old values, even though the model is actually updated
Steven Kirk
@grokys
May 24 2016 21:37
bring into view needs to implemented for virtualized lists too
ah ok - no i didn't know that! hmm, strange
Steven Kirk
@grokys
May 24 2016 21:43
they update when you scroll ;)
danwalmsley
@danwalmsley
May 24 2016 21:43
ah,
ok yeh I'm not getting a scrollbar for some reason on my intellisense
since updating,
Steven Kirk
@grokys
May 24 2016 21:44
oh :(
danwalmsley
@danwalmsley
May 24 2016 21:44
i'll have to see why
Steven Kirk
@grokys
May 24 2016 21:54
ok problem with items not being updated when Items changes should be fixed
danwalmsley
@danwalmsley
May 24 2016 21:54
ok will give that another test
@grokys I'm struggling to see where the standard scrollviewer actually moves its content, how does it do it? is it really controlling a margin something like that?
Steven Kirk
@grokys
May 24 2016 21:55
you mean when contents aren't virtualized?
danwalmsley
@danwalmsley
May 24 2016 21:56
yes
and line 211 below
danwalmsley
@danwalmsley
May 24 2016 21:59
thanks