These are chat archives for AvaloniaUI/Avalonia

24th
May 2016
Steven Kirk
@grokys
May 24 2016 16:30 UTC
@/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 UTC
@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 UTC
(i'm still finding bugs so ignore those ;) )
danwalmsley
@danwalmsley
May 24 2016 20:01 UTC
@grokys been busy tonight will try and give it a quick go before I goto bed
Steven Kirk
@grokys
May 24 2016 20:03 UTC
No problem, still lots of bugs and problems
danwalmsley
@danwalmsley
May 24 2016 20:52 UTC
@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 UTC
yeah, that's one of the bugs ;)
danwalmsley
@danwalmsley
May 24 2016 20:53 UTC
:)
I scrolled down then up
but it failed to scroll back up
Steven Kirk
@grokys
May 24 2016 20:53 UTC
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 UTC
ah ok
sure
I'll have a look at the code a bit too
Steven Kirk
@grokys
May 24 2016 20:55 UTC
though scrolling back up should work...
danwalmsley
@danwalmsley
May 24 2016 20:55 UTC
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 UTC
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 UTC
will virtualization be enabled by default for items control
Steven Kirk
@grokys
May 24 2016 21:01 UTC
that's fixed
danwalmsley
@danwalmsley
May 24 2016 21:01 UTC
I think in wpf you had to do something like this...
Steven Kirk
@grokys
May 24 2016 21:01 UTC
like WPF: for ListBox it's enabled by default, for ItemsControl not
danwalmsley
@danwalmsley
May 24 2016 21:01 UTC
<ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
and
Steven Kirk
@grokys
May 24 2016 21:02 UTC
ItemsControl doesn't have a ScrollViewer so even that won't work in WPF
danwalmsley
@danwalmsley
May 24 2016 21:02 UTC
<ItemsControl
    VirtualizingStackPanel.IsVirtualizing="True"
Steven Kirk
@grokys
May 24 2016 21:03 UTC
and the same here
danwalmsley
@danwalmsley
May 24 2016 21:03 UTC
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 UTC
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 UTC
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 UTC
hmm yeah
something's slowing it down
danwalmsley
@danwalmsley
May 24 2016 21:13 UTC
is it because the cpus been used up generating itemcontainers?
Steven Kirk
@grokys
May 24 2016 21:13 UTC
it shouldn't be - they should be recycled
danwalmsley
@danwalmsley
May 24 2016 21:13 UTC
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 UTC
yeah i remember
tbh it will probably just crash ;) but worth a try
danwalmsley
@danwalmsley
May 24 2016 21:22 UTC
@grokys have these changes affected scrollviewer in general?
Steven Kirk
@grokys
May 24 2016 21:23 UTC
not ScrollViewer itself, no
danwalmsley
@danwalmsley
May 24 2016 21:24 UTC
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 UTC
ah you need to return IsLogicalScrollEnabled = true
danwalmsley
@danwalmsley
May 24 2016 21:28 UTC
in xaml?
Steven Kirk
@grokys
May 24 2016 21:28 UTC
from ILogicalScrollable
danwalmsley
@danwalmsley
May 24 2016 21:28 UTC
ah because of smooth scrolling?
so I should implement ILogicalScrollable instead of IScrollable?
Steven Kirk
@grokys
May 24 2016 21:29 UTC
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 UTC
ah ok cheers missed that one
Steven Kirk
@grokys
May 24 2016 21:30 UTC
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 UTC
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 UTC
@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 UTC
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 UTC
they update when you scroll ;)
danwalmsley
@danwalmsley
May 24 2016 21:43 UTC
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 UTC
oh :(
danwalmsley
@danwalmsley
May 24 2016 21:44 UTC
i'll have to see why
Steven Kirk
@grokys
May 24 2016 21:54 UTC
ok problem with items not being updated when Items changes should be fixed
danwalmsley
@danwalmsley
May 24 2016 21:54 UTC
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 UTC
you mean when contents aren't virtualized?
danwalmsley
@danwalmsley
May 24 2016 21:56 UTC
yes
and line 211 below
danwalmsley
@danwalmsley
May 24 2016 21:59 UTC
thanks