These are chat archives for AvaloniaUI/Avalonia

12th
Feb 2017
Jeremy Koritzinsky
@jkoritzinsky
Feb 12 2017 07:05
Hey guys I sent in a few PRs. Any chance someone and review them?
Nikita Tsukanov
@kekekeks
Feb 12 2017 10:35
@jkoritzinsky Module system feels to be duplicating AppBuilder infrastructure
Why do we need that reflection magic instead of UseSomething with AppBuilder?
Especially if regarding the fact that Assembly.Load doesn't work on iOS
Matthijs ter Woord
@mterwoord
Feb 12 2017 10:36
@kekekeks I'd say it wont work on any aot-ed platform?
(.net core native, in the future?)
Nikita Tsukanov
@kekekeks
Feb 12 2017 10:37
So we need to specify dependencies at compile-time
iOS was even unable to load DefaultTheme properly
Until I've referenced one of the types from assembly in AppDelegate
Even UsePlatformDetect is wonky
Nikita Tsukanov
@kekekeks
Feb 12 2017 10:50
UWP uses AOT too
We need to investigate if it has the same issues with dynamic assembly loading
Because if it does
Then we can't use reflection magic at all
Because once corert is ready
Desktop platforms will have proper AOT support too
Matthijs ter Woord
@mterwoord
Feb 12 2017 10:55
@kekekeks most likely it does. in uwp you have to use manifests to include extra metadata for some reflectoin uses.
(i'm in the process of inding that out)
that process is slow though..
Jeremy Koritzinsky
@jkoritzinsky
Feb 12 2017 16:42
Module system allows you to not have to specify UseX for every third party library you're using. It will auto load them.
My goal with both UsePlatformDetect and UseAvaloniaModules is to make the startup code for the separate platforms just a simple Main method that doesn't ever need to be changed no matter what the portable code does.
Nikita Tsukanov
@kekekeks
Feb 12 2017 16:46

It will auto load them.

It won't be able to, that's the problem

BTW, I don't see any issues with Use*, ASP.NET Core uses this approach and has skyrocketing user base without any complaints
Mark Junker
@fubar-coder
Feb 12 2017 16:48
I personally like that I have to manually specify what I use. This gives me the illusion of control :grinning:
Jeremy Koritzinsky
@jkoritzinsky
Feb 12 2017 17:03
It will because you'll still have to reference the assemblies anyway with a hard reference for their controls. The module system is for any services they use that at platform specific and for any initialization they need to do at application startup.
Im curious why this conversation didn't come up when I added the modules features the first time.
Nikita Tsukanov
@kekekeks
Feb 12 2017 17:31

It will because you'll still have to reference the assemblies anyway

Referencing doesn't help

It still won't be included to the final binary

Im curious why this conversation didn't come up when I added the modules features the first time.

I didn't know about Assembly.LoadAssembly being functional

Jeremy Koritzinsky
@jkoritzinsky
Feb 12 2017 17:34
What about the Preserve attribute? Wouldn't that help?
Nikita Tsukanov
@kekekeks
Feb 12 2017 17:34
It preserves types during linkage
But you still need to somehow load assembly in the first place
And you can't do that with Assembly.LoadAssembly
We still need configuration and negotiation between modules and subsystems
But we can't use reflection for that
Even current XAML implementation is wonky
Basically everything that relies on GetLoadedAssemblies can't be trusted to work
May be I'm blind and don't see the obvious solution of making this work properly
Nikita Tsukanov
@kekekeks
Feb 12 2017 17:49
@jkoritzinsky it seems that we can share surfaces with Direct* even with skia
You can create OpenGL pbuffer from D3D texture
Would that be enough for AvaloniaAV?
Jeremy Koritzinsky
@jkoritzinsky
Feb 12 2017 17:58
Nice! I was planning on bringing the surface data back into the CPU and into an IPlatformFramebuffeeSurface implementation. That's actually even better!
Nikita Tsukanov
@kekekeks
Feb 12 2017 18:13
You still need to do that for SW rendering mode
I'm not sure that HW will be used all the time
Win8 emulates some kind of DirectX "acceleration" (which is pretty good BTW)
But Win7 doesn't have support for that
BTW, Direct2D is broken on Win7 for some reason
#869
Ivan Kochurkin
@KvanTTT
Feb 12 2017 18:21
Can we use Skia for Win7?
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 12 2017 19:46
Hi! Can I display avalonia UserControl inside wpf window?
Jeremy Koritzinsky
@jkoritzinsky
Feb 12 2017 21:09
Yeah. Take a look at the Windows Interop sample! There's a bug with interop and high dpi screens tho so watch out for that.
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 12 2017 21:49
thanks
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 12 2017 21:59
another stupid question:) In the samples I didn't find way to assign event handler for click on button from xaml...
Nikita Tsukanov
@kekekeks
Feb 12 2017 21:59
We are waiting for OmniXAML2 integration for that feature
So for now just add x:Name="blablabla" and then find that control from codebehind
this.FindControl<Border>("blablabla")
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 12 2017 22:00
just in classic way? blablabla.Click += (s,e) => {}?
Nikita Tsukanov
@kekekeks
Feb 12 2017 22:00
After loading XAML
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 12 2017 22:00
ah ok
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 12 2017 23:32
is there any plans to precompile xaml's in future to increase loading speed in runtime?
Nikita Tsukanov
@kekekeks
Feb 12 2017 23:45
There is ongoing xaml compiler effort in Portable.Xaml library
We are considering to switch to Portable.Xaml in the future
I was also thinking about proper xaml parser/compiler using Nitra
Which will also provide rich IDE support
Igor Gritsenko
@Igor_Gritsenko_twitter
Feb 12 2017 23:46
sounds promising :-)