These are chat archives for AvaloniaUI/Avalonia

2nd
Feb 2017
Darnell Williams
@Seeker1437
Feb 02 2017 01:42
@kekekeks is that profile pic you?
Nikita Tsukanov
@kekekeks
Feb 02 2017 09:32
Ehm, who else it's supposed to be?
Skia# with net core support got released
Mihhail Maslakov
@ionoy
Feb 02 2017 09:47
you will have to remove lib.ammy after restoring packages
i'm differentiating upon target framework when choosing compatible lib.ammy, but in avalonia's case NuGet doesn't know if it's WPF or Avalonia
since they have same target framework (net40)
Matthijs ter Woord
@mterwoord
Feb 02 2017 09:49
@kekekeks So we'll likely see avalonia for .net core soonish?
Mihhail Maslakov
@ionoy
Feb 02 2017 09:49
i will separate lib.ammy soon, so you will be able to install-package Ammy.Lib.Avalon
danwalmsley
@danwalmsley
Feb 02 2017 09:58
@ionoy can you help me understand the term "mixin"
?
looks good will try it out today :)
excellent work
are there any tools to convert existing XAML to ammy?
@kekekeks does that mean we can actually move to .net core now that skia supports it?
Nikita Tsukanov
@kekekeks
Feb 02 2017 10:06
I'm currently unable to check, but it seems that linux native build is not included in nuget package
But we should be able to target .NET Core now
And it will even run out of the box on windows
Nikita Tsukanov
@kekekeks
Feb 02 2017 10:21
Yep, no native build for linux yet
Mihhail Maslakov
@ionoy
Feb 02 2017 10:43
@danwalmsley yeah, but a bit later. busy now.
danwalmsley
@danwalmsley
Feb 02 2017 10:48
@ionoy :D thanks
@kekekeks so we can probably use it with the dlls we built however
whats needed to produce a .net core build of avalonia, major refactoring or just a new backend?
Mihhail Maslakov
@ionoy
Feb 02 2017 11:22

@danwalmsley mixin is a set of properties and elements that can be inserted into any element

mixin Transparent() for FrameworkElement { 
  Opacity: 0.5 
}

this mixin used like this:

TextBlock {
  #Transparent
}

Will add Opacity: 0.5 to TextBlock. In fact you can now use this #Transparent in any element that is derived from FrameworkElement

what is cool about mixin is that can accept parameters
parameters can have default values
and there is named parameters syntax
so, for example:
mixin SomeStyle(width=100, height=200, background="Green") {...}

TextBlock {
  #SomeStyle(background: "Red")
}
TextBlock will have Width: 100, Height: 200, Background: "Red" in this case
danwalmsley
@danwalmsley
Feb 02 2017 11:26
wow that is powerful
is this unique to ammy?
or its already part of wpf?
Mihhail Maslakov
@ionoy
Feb 02 2017 11:26
it's unique to ammy
danwalmsley
@danwalmsley
Feb 02 2017 11:26
wow this is amazing
so ammy uses mixin and generates new xaml
Mihhail Maslakov
@ionoy
Feb 02 2017 11:27
i think the same :)
yep
danwalmsley
@danwalmsley
Feb 02 2017 11:27
ok
you are a genius mate
ok so if I have a project with lots of xaml
Mihhail Maslakov
@ionoy
Feb 02 2017 11:27
i'm not, but thank you :)
danwalmsley
@danwalmsley
Feb 02 2017 11:27
is there an easy upgrade path to ammy
Mihhail Maslakov
@ionoy
Feb 02 2017 11:28
as for converter, there is one, but it's too primitive. it doesn't take some stuff into account
danwalmsley
@danwalmsley
Feb 02 2017 11:28
or manual port?
Mihhail Maslakov
@ionoy
Feb 02 2017 11:28
i'm planning to upgrade it soon
danwalmsley
@danwalmsley
Feb 02 2017 11:28
ok well I wont rush, but I can start adding new stuff in ammy
Mihhail Maslakov
@ionoy
Feb 02 2017 11:28
so, in few days you could convert your project almost automatically
danwalmsley
@danwalmsley
Feb 02 2017 11:28
so glad I found your project
its a perfect match for avalonia
Mihhail Maslakov
@ionoy
Feb 02 2017 11:28
agreed
danwalmsley
@danwalmsley
Feb 02 2017 11:28
my brother I was trying to teach him some XAML last night
hes just getting into it
he had to do
<Grid>
Mihhail Maslakov
@ionoy
Feb 02 2017 11:29
you always can contact me via github issues or email if you have any questions
danwalmsley
@danwalmsley
Feb 02 2017 11:29
Grid.RowDefinitions
RowDefinition />
all that nonsense
ammy really smooths it all out :)
Mihhail Maslakov
@ionoy
Feb 02 2017 11:29
yeah, grid stuff is really awkward in xaml
danwalmsley
@danwalmsley
Feb 02 2017 11:29
ok well I will keep in touch
and thanks for taking time to explain mixins
Mihhail Maslakov
@ionoy
Feb 02 2017 11:30
you're welcome
danwalmsley
@danwalmsley
Feb 02 2017 11:30
once I port Avalon studio to ammy, and have it running on .net core, maybe you might like to feature it as an example of project that uses it?
and avalonia too
Mihhail Maslakov
@ionoy
Feb 02 2017 11:30
yeah, it would be cool
danwalmsley
@danwalmsley
Feb 02 2017 11:30
I will have to bring an ammy compatible editor to Avalon studio
so people on mac / Linux could us it to fully develop avalonia applications
ok better get back to work, thanks for help :)
oh 1 more thing
Mihhail Maslakov
@ionoy
Feb 02 2017 11:31
i don't know how easy it would be to port visual studio extension, but we could do simplified version
danwalmsley
@danwalmsley
Feb 02 2017 11:31
your website looks really nice
what did you use for that?
Mihhail Maslakov
@ionoy
Feb 02 2017 11:32
wp + impreza
danwalmsley
@danwalmsley
Feb 02 2017 11:32
;) I need a site for Avalon studio soon
good to know
Mihhail Maslakov
@ionoy
Feb 02 2017 11:33
i found it really easy to use and it has lots of options
can recommend :)
danwalmsley
@danwalmsley
Feb 02 2017 11:33
how much does it cost the theme?
Mihhail Maslakov
@ionoy
Feb 02 2017 11:33
~50
danwalmsley
@danwalmsley
Feb 02 2017 11:33
not bad
Gutemberg Ribeiro
@galvesribeiro
Feb 02 2017 11:47
so, now SkiaSharp on .net core :)
Nikita Tsukanov
@kekekeks
Feb 02 2017 14:07
@SuperJMN I wonder if we could get something like mixins in OmniXAML
@danwalmsley For .NET Core support we need to make our Skia backend target .NETStandard. Win32 backend already does so. Progress is tracked in #875
Then GTK# backend needs to be packaged and merged to master
I'll integrate everything in a separate branch and upload packages to some feed, I think
danwalmsley
@danwalmsley
Feb 02 2017 15:52
popup is a total nightmare
danwalmsley
@danwalmsley
Feb 02 2017 16:43
wow I thought it would have been a lot more work!
Nikita Tsukanov
@kekekeks
Feb 02 2017 16:47
Most of it was already done
#875 has quite a lot of commits, you know
Wiesław Šoltés
@wieslawsoltes
Feb 02 2017 16:49
@kekekeks Is this stand-alone .net core app ?
Nikita Tsukanov
@kekekeks
Feb 02 2017 16:52
Yep
danwalmsley
@danwalmsley
Feb 02 2017 16:53
so will this work on Linux too?
Nikita Tsukanov
@kekekeks
Feb 02 2017 16:54
Nope, gtk3 backend not integrated there yet
For now I'm trying to figure out what to do with nuget deps
You see, RX3.1 doesn't have Profile7 version anymore
and RX 3.0 doesn't have netstandard/netcoreapp build
Oh, wait
It does
Nikita Tsukanov
@kekekeks
Feb 02 2017 16:59
So the actual issue is with Splat + Avalonia.ReactiveUI
danwalmsley
@danwalmsley
Feb 02 2017 18:28
Any solution
danwalmsley
@danwalmsley
Feb 02 2017 19:16
@kekekeks what do I need to do to bring this to Avalon studio?
Nikita Tsukanov
@kekekeks
Feb 02 2017 19:17
You will lose XAML previewer
danwalmsley
@danwalmsley
Feb 02 2017 19:18
I lost that long ago
I don't need it anymore
I think me using mef will be a problem
Nikita Tsukanov
@kekekeks
Feb 02 2017 19:19
NuGet.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <packageSources>
    <add key="NuGet 3 (plain)" value="http://api.nuget.org/v3/index.json" />
    <add key="Avalonia-Test" value="C:\Users\keks\Projects\GitHub\Perspex\artifacts\nuget" />
  </packageSources>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
</configuration>
Eric Mellino
@mellinoe
Feb 02 2017 19:32
@kekekeks I'm super excited to see the progress on .NET Core support! If you hit any blockers or need assistance with anything, I'd be happy to help. I'd love to finally use it myself in some projects.
Nikita Tsukanov
@kekekeks
Feb 02 2017 19:36
For now there are 2 issues:
1) No proper native Skia# binaries for Linux. There is a recently created build script, but it's not ready. I think that having a build environment based on HBB will allow Skia# to have one binary for most distros
2) We need either proper Quartz-based backend for OS X or somehow obtain portable set of GTK3 dylibs. For now we are stuck with GTK3 from brew
Eric Mellino
@mellinoe
Feb 02 2017 19:52
Can the Skia backend not be used on OSX as well?
Nikita Tsukanov
@kekekeks
Feb 02 2017 19:53
Yep, Skia# nuget package has prebuilt libSkiaSharp.dylib included
Eric Mellino
@mellinoe
Feb 02 2017 19:54
I see, so you're referring to the windowing/input handling for OSX, then?
Nikita Tsukanov
@kekekeks
Feb 02 2017 19:54
Yes. GTK3 backend should handle that for now
But GTK3 is a 30MB+ blob that's a bit complicated to distribute
Eric Mellino
@mellinoe
Feb 02 2017 19:57
Might be a dumb suggestion since I'm not sure what all GTK3 is used for here, but is something like SDL2 an option?
Nikita Tsukanov
@kekekeks
Feb 02 2017 19:58
SDL2 is also a blob that's a bit complicated to distribute
The optimal solution is to use libobjc.A.dylib and somehow talk to Quartz
So we'll have a small managed library instead of tons of native binaries
Eric Mellino
@mellinoe
Feb 02 2017 20:01
Indeed. Have you checked out what OpenTK does? They have Quartz and Cocoa backends, as well as an SDL2 backend (for all platforms). I did find that the SDL2 backend was much less buggy than the native OSX backends, though
Nikita Tsukanov
@kekekeks
Feb 02 2017 20:01

They have Quartz and Cocoa backend

Which are based on Xamarin.Mac

Eric Mellino
@mellinoe
Feb 02 2017 20:02
No, I don't think that's right
Nikita Tsukanov
@kekekeks
Feb 02 2017 20:02
They have Carbon-based backend
But Carbon is deprecated
And not available for 64-bit apps
Eric Mellino
@mellinoe
Feb 02 2017 20:03
I don't think the other backends have anything to do with Xamarin
It looks like they are just PInvoking to some mac libraries, like "/usr/lib/libobjc.dylib", or CoreFoundation, etc.
Nikita Tsukanov
@kekekeks
Feb 02 2017 20:04
Hm
They are using libobjc.dylib
Neat
@jkoritzinsky @galvesribeiro
Should be a good starting point
Code is MIT-licensed
Gutemberg Ribeiro
@galvesribeiro
Feb 02 2017 20:08
interesting
at least for OSX
iOS still need their compiler like you said
Eric Mellino
@mellinoe
Feb 02 2017 20:09
By the way, I ended up using the SDL2 backend in my game because those "default" backends for OSX were a bit buggy in my experience. Actually, they worked very well for most things but I was hitting a lot of problems with mouse positions being bogus. That might be a problem for Avalonia :smile: . I didn't try to figure out the problem too deeply, though, so it might have been my fault in the first place. It was easier to just use SDL2, so I didn't bother investigating.
Nikita Tsukanov
@kekekeks
Feb 02 2017 20:11
The problem with using SDL2 will be native open/save file dialogs, native message boxes, etc