These are chat archives for AvaloniaUI/Avalonia

20th
Dec 2015
Geoffrey Huntley
@ghuntley
Dec 20 2015 01:44
hey @grokys reactiveui/ReactiveUI#925 and ReactiveUI support with perspex. What do you need? Custom .NET 4.5 nuget package that doesn't ref wpf?
I'd be keen in seeing perspex+rxui btw.
Darnell Williams
@Seeker1437
Dec 20 2015 02:21
Oh hey cool!
For the time being there is a Perspex Integrated fork of rxui but if it came from the source that would rock on!
@ghuntley from previous discussions if you are willing and able to support it @grokys would gladly discuss it XD whever he gets back
@ghuntley currently we are providing dummies of the classes specifically needed from PresentationFramework as a workaround. You might find all that is happening with it in Perspex.ReactiveUI
Kevin
@KeKl
Dec 20 2015 13:27
can someone please upload an example app with android and ios?
Thanks
Steven Kirk
@grokys
Dec 20 2015 14:49
hi @ghuntley we've currently forked ReactiveUI and are including it in the Perspex repos as a submodule
yes, we either need a nuget package that doesn't reference WPF, or some sort of hook into the initialization process to override the WPF registrations
Nikita Tsukanov
@kekekeks
Dec 20 2015 14:50

@ghuntley

Custom .NET 4.5 nuget package that doesn't ref wpf

We need a custom NuGet package that is a pure PCL

Without any platform-specific stuff
Steven Kirk
@grokys
Dec 20 2015 14:50
the main problem is that WPF isn't available on mono
Darnell Williams
@Seeker1437
Dec 20 2015 14:50
:(
Nikita Tsukanov
@kekekeks
Dec 20 2015 14:50
Preferably Profile7
Steven Kirk
@grokys
Dec 20 2015 22:10
@danwalmsley - implemented culling controls that are not within clip bounds. seems to fix your perf problems with the large TreeView
danwalmsley
@danwalmsley
Dec 20 2015 22:11
@grokys thanks for that
will give it a go
if anyone who's better at maths could take a look at those 2 functions and let me know if i've done it wrong
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:12

implemented culling controls that are not within clip bounds

wow

Steven Kirk
@grokys
Dec 20 2015 22:13
:) it wasn't that hard. please take a look though, because i've probably got something wrong in there
as it involves maths
it seems to work with AvalonStudio though, and speeds it up massively when there are lots of tree view items
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:18
Well, that's poor man's virtualizing panel
in terms of performance
Steven Kirk
@grokys
Dec 20 2015 22:18
yeah, i guess!
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:18
The problem is that controls can have something outside declared bounds
Steven Kirk
@grokys
Dec 20 2015 22:18
yep, the clip rect is only updated when ClipToBounds == true
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:18
Margin can be negative, for example
So we can only use that if child control also has ClipToBounds
Steven Kirk
@grokys
Dec 20 2015 22:19
yeah, but Panels have ClipToBounds by default
so @danwalmsley you didn't need to add ClipToBounds to the TreeView
We can't guarantee that we aren't skipping content that should be rendered
Steven Kirk
@grokys
Dec 20 2015 22:21
hmm, i don't think so
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:21
child can have child controls that are outside of it's bounds
Steven Kirk
@grokys
Dec 20 2015 22:22
yeah, but that child will update the clip rect on line 112
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:22
Ehm
no
You are checking for current widget's ClipToBounds there
Steven Kirk
@grokys
Dec 20 2015 22:23
yep, so you have the clip rect for the current control, and if the child's bounds don't intersect then the child isn't drawn
if the child is drawn, and is ClipToBounds, then the new clip rect becomes the intersection of the old clip rect and the child's bounds
though if you think i'm wrong and want to create a unit test that demonstrates it, that would be welcome!
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:25
Consider that child is something like this:
<Border Width = "200" Height="200" ClipToBounds="False">
     <Border Margin = "-50" Fill="Red" Width = "300" Height="300>

</Border>
It has content that should be rendered outside of its bounds
And if you only check that its bounds intersect with current clip region
You will skip the content that should be visible
So before optimizing its rendering out you need to check that child doesn't have such content
And you can only do that by checking its ClipToBounds property
With ClipToBounds set to False you can't reason about content visibility
Steven Kirk
@grokys
Dec 20 2015 22:28
but assuming that Border's parent is the window, then the clipRect parameter at the point will be the clip rect for the whole window
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:28
yep, and that content won't be rendered
which is completely fine
since it's the window after all
Steven Kirk
@grokys
Dec 20 2015 22:29
could you create a test that demonstrates it? i don't follow
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:29
Argh
Darnell Williams
@Seeker1437
Dec 20 2015 22:32
Like a pirate haha
(Arrrgh)
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:38
I also don't like the fact that you are passing clipRect which can be affected by rotate tranformations
kekekeks/Perspex@89c13aa
here is your demo
Go to Lists tab and scroll the first list slowly
That effect doesn't happen without your optimization
Steven Kirk
@grokys
Dec 20 2015 22:40
ah yes, i see
ok, thanks, will fix that
what do you suggest for the clipRect and rotate transform stuff?
Nikita Tsukanov
@kekekeks
Dec 20 2015 22:46
currently no idea
Why do you even need to pass it?
It can be extracted from current widget's bounds
Oh
now I get it
We might need to track current clip region instead of clip rect
that will be a lot of math, but might be worth it
Steven Kirk
@grokys
Dec 20 2015 22:50
you mean rather than a simple aabb rect the clip will be a rectangle and a transform?
not sure how common rotated containers with lots of children will be
Johan Larsson
@JohanLarsson
Dec 20 2015 22:54
Is there an event that fires when someone binds to a dp?
Or some other way to detect it. (WPF)
Steven Kirk
@grokys
Dec 20 2015 22:55
not that i know of
Johan Larsson
@JohanLarsson
Dec 20 2015 22:55
guess I could use interactivity but don't love the ref and the syntax
I want the onattached
Darnell Williams
@Seeker1437
Dec 20 2015 22:59
Technically it should happen before onloaded
Johan Larsson
@JohanLarsson
Dec 20 2015 23:10
usually I set new object() as defaultvalue to trigger a change
not sure it works for onewaytosource
that could perhaps be something for perspex
An OnRegistered callback
Steven Kirk
@grokys
Dec 20 2015 23:15
what do you need it for?
Johan Larsson
@JohanLarsson
Dec 20 2015 23:16
I'm playing with an attached property for datagrid for index of the selected cell (row & column)
ah, nice, looks like what I want
why do you do public class PerspexProperty : IEquatable<PerspexProperty>
though IEquatable only made sense for structs as they box
Steven Kirk
@grokys
Dec 20 2015 23:20
because when you call AddOwner on a direct PerspexProperty, it creates a new instance that is functionally equivalent to the original property
i.e. it refers to the same property
only it has a different getter/setter
Johan Larsson
@JohanLarsson
Dec 20 2015 23:21
ok
Steven Kirk
@grokys
Dec 20 2015 23:25
i could've just implemented object.Equals i guess
but IEquatable gives a typed Equals method