These are chat archives for AvaloniaUI/Avalonia

15th
Apr 2018
Jeremy Koritzinsky
@jkoritzinsky
Apr 15 2018 01:01
@grokys re ADL: they use Reflection.Emit to generate the interop shims at runtime as far as I can tell from their codebase. So if we use ADL we will most definitely not be able to support AOT scenarios with CoreRT for a long time.
Steven Kirk
@grokys
Apr 15 2018 08:37
@jkoritzinsky Firwood-Software/AdvanceDLSupport#24
Mark Junker
@fubar-coder
Apr 15 2018 09:05
@grokys License of ADL is GPL v3.
Steven Kirk
@grokys
Apr 15 2018 09:05
ah, well that's a no-go then! tbh i wasn't suggesting we move to it, but it looked interesting
Mark Junker
@fubar-coder
Apr 15 2018 09:06
Maybe they're willing to grant Avalonia a different license?
Steven Kirk
@grokys
Apr 15 2018 09:07
perhaps. if there's a real need for it we could look into it, but there's not a huge need right now
Mark Junker
@fubar-coder
Apr 15 2018 09:07
A different library with a similar approach is https://github.com/GeirGrusom/PlatformInvoker , but I don't know how well they work in an AOT scenario.
Steven Kirk
@grokys
Apr 15 2018 09:07
GPL3 for a library like that seems a really strange choice to me
it's really going to limit adoption
Mark Junker
@fubar-coder
Apr 15 2018 09:08
That's why we're using PlatformInvoker in our product, which doesn't require AOT support.
Even though LGPL isn't that much better.
se5a
@se5a
Apr 15 2018 09:09
eh?
Mark Junker
@fubar-coder
Apr 15 2018 09:16
LGPL is fine for me/us, but "GPL" in its name often means that its "tainted" in the eyes of the managers. Not my view. It requires argumentation and (investigative) work, sometimes even contact to lawyers to make even LGPL look acceptable...
danwalmsley
@danwalmsley
Apr 15 2018 09:19
It does say open source projects should contact them for special licensing
Roman Vladimirov
@trueromanus
Apr 15 2018 11:48
Hi all! You will be interested control for navigation with history (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.frame) for AvaloniaUI?
Benedikt Schroeder
@Gillibald
Apr 15 2018 11:52
I am working on some helper methods for Measure and Arrange to improve code share. In the process i realised that TemplatedControl has many properties it doesnt directly use. For excample all the border related properties or TextBox related stuff. How are these values handed to the ContentPresenter? Is the ContentPresenter even used to display the content? In my opinion ContentPresenter should do all the template stuff that is happening in TemplatedControl. There is a lot duplicate code.
In WPF all text related properties are AttachedProperties and are defined in the TextElement class. You can attach these to a Panel and childs inherit these values. Is this the same with Avalonia?
Jeremy Koritzinsky
@jkoritzinsky
Apr 15 2018 14:46
@grokys if you really like the interface style for native function calls, can you file an issue on SharpGenTools? I'd be interested in adding support in the future.
Benedikt Schroeder
@Gillibald
Apr 15 2018 15:19
I wonder why you gave ContentPresenter Padding, VerticalContentAlignment and HorizontalContentAlignment. A ContentPresenters's Margin should come from a parent's Padding. Same goes for alignments. Or do i miss something? Where are alignments evaluated? You could simply define these Properties like HorizontalAlignment={TemplateBinding HorizontalContentAlignment} in the controls's template or do i miss something? This would reduce complexity for ContentPresenter.
danwalmsley
@danwalmsley
Apr 15 2018 15:36
I can tell you how it works for button
Button contains a content presenter
If you set padding on a button
It actually sets the property on the content presenter
There are 2controls that have these properties border and content presenter
And probably their logic could be merged to a base class
Benedikt Schroeder
@Gillibald
Apr 15 2018 15:38
I think its because ContentPresenter reders ist own border so it makes sense but it is not easy to understand and to make right
Sometimes the padding is ment for the border of the ContentPresenter and sometimes ist for the child of the ContentPresenter
Very confusing
Benedikt Schroeder
@Gillibald
Apr 15 2018 15:46
In the end you just reduce the visualtree by one element but still have the same amount of calculations but introduce confusion about how to use it properly. ContentPresenter acts like a visual but should only be a logical element. I have to except that strange design but atleast i kinda understand it now. Have to play around with all the controls to get better insides.
I have tried to create a base for Border and ContentPresenter but thats not possible in a clean way. It always shifts stuff to other places. So in the end we dont achieve much. Using helper classes instead is the better choice in my opinion.
Steven Kirk
@grokys
Apr 15 2018 18:56
@Gillibald yeah i do agree it's slightly confusing sometimes, but I think the designers of UWP had good reason to do it. if you look at the visual tree of a large WPF application, there are a lot of border/contentpresenter combinations, literally in the thousands in some cases
ContentPresenter acts like a visual but should only be a logical element
what do you mean by this?
Benedikt Schroeder
@Gillibald
Apr 15 2018 19:50
Will make a PR with some helper methods to slidly reduce duplicate code when it comes to arrange and measure childs.
In addition to that I will check default templates for all controls that use a ContentPresenter. Looks like some are missing content alignments. For example ListboxItem is missing them.
Shimmy
@weitzhandler
Apr 15 2018 21:25
Hi there!
We're considering using AvaloniaUI for our next LoB app project. We have been using Xamarin.Forms for a couple of years and we're a bit tired of the strict native approach it takes with providing only controls that are native to all platforms, besides we don't care about native look and feel; we rather want the opposite. We thought Avalonia might be a good alternative, but we still have a few question as to what the limitations of Avalonia might be from a XF perspective.
  • Is there a public comparison chart of Avalonia vs XF?
  • Are there any plans on a date for when Avalonia will go RTM?
  • Any plans to port Avalonia to run on the web (preferably via WebAsm (XF does), but anything at all will be considered).
danwalmsley
@danwalmsley
Apr 15 2018 22:02
@weitzhandler welcome
1) there is no comparison chart AFAIK, if there is a comparison chart of WPF to XF it would come pretty close
2) I don't believe there is a date, but iv been working with avalonia for a few years now and I'd say its getting to a point where I wouldn't be scared to use it in a commercial project.
3) see issue AvaloniaUI/Avalonia#1387 for conversation on webassembly, I know one of the main contributors is currently researching it right now so it might not be too far off.
Shimmy
@weitzhandler
Apr 15 2018 23:09

Thank you very much @danwalmsley.
As to your first answer, that would already be convincing.
If it's true, I have no clue what we've invested so much effort in XF in first place.

But I still have some questions, does Av offer mobile oriented functionality, such as:

  • How does Avalonia support Android and iOS?
  • Touch/Tap/Pan etc. events/commands
  • Battery/Network/Compass and other mobile features
  • Will System.IO functionality work properly in the various platforms? How about accessing local storage in Android or iOS?

Would be great if there was a bit more specs and comparison charts in the main repo readme or homepage. But thanks a ton!