These are chat archives for AvaloniaUI/Avalonia

17th
Dec 2018
Jonathan
@vanillajonathan
Dec 17 2018 12:36
Can Avalonia be used for UWP-like apps? Can it be used for Fluent Design System? Or Avalonia just for WPF-like applications?
Can Avalonia be used for mobile-first, touch-friendly, scalable UI ranging from 5" to 65" ?
Nikita Tsukanov
@kekekeks
Dec 17 2018 12:56
Right now we are focusing on desktop
Mobile support is currently experimental
We'll port some controls from UWP when it's fully released
Jonathan
@vanillajonathan
Dec 17 2018 13:25
What about Fluent Design System?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:29
Are you referring to acrylic visual effects or something?
"Fluent Design System" is just a marketing term
Like most Names With Lots of Capitalized Words
Jonathan
@vanillajonathan
Dec 17 2018 13:31
I am referring to how UWP apps have a different look-and-feel to WPF applications.
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:32
It's possible to implement the same look and feel for WPF
Jonathan
@vanillajonathan
Dec 17 2018 13:32
WPF have menu bars and status bars and a UI for mouse cursor. While UWP have hamburger menu and a UI for touch.
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:32
except for acrylic brush
It requires interaction with the window system
See?
Jonathan
@vanillajonathan
Dec 17 2018 13:33
I see, but it doesn't convincingly look like a UWP app.
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:34
If you are talking about built-in controls, then, yes, our are more WPF-like
Jonathan
@vanillajonathan
Dec 17 2018 13:34
There is no way to get the dropdown and input boxes that look more UWP than WPF?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:35
Our controls are lookless, it should be possible to implement whatever look and feel you need
Benedikt Schroeder
@Gillibald
Dec 17 2018 13:35
Everything is possible that is the strength of lookless controls.
Jonathan
@vanillajonathan
Dec 17 2018 13:35
That means I have to implement the look myself, and if I don't , everything looks blank?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:35
The only problem is that we don't have touch gesture support yet, haven't quite figured out how to implement them in cross-platform manner
Our built-in theme has "desktop" look and feel, yes
As I have said, we are currently focusing on desktop
Jonathan
@vanillajonathan
Dec 17 2018 13:36
I see
Another question, does Avalonia adhere to the XAML standard?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:37
There is no such thing as "xaml standard", unfortunately
Jonathan
@vanillajonathan
Dec 17 2018 13:37
The one in the Microsoft repository - https://github.com/Microsoft/xaml-standard
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:37
The initiative was looking promising, but nothing has come out of it
Benedikt Schroeder
@Gillibald
Dec 17 2018 13:38
There is currently some discussion about whether there should be some new standard that exclude xamarin.
That's the only document in "xaml standard"
Jonathan
@vanillajonathan
Dec 17 2018 13:39
But my understanding that Microsoft have a preview version out of Xamarin with support for the standard? https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/standard/?tabs=windows
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:40
That was a set of aliases for existing Xamarin.Forms controls
Jonathan
@vanillajonathan
Dec 17 2018 13:41
Yeah, isn't that implementing the XAML standard? Isn't that adherence to the XAML standard?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:42
We have some controls named like this, yes
Jonathan
@vanillajonathan
Dec 17 2018 13:42
So will Avalonia create aliases for XAML Standard as Xamarin have done?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:42
StackPanel, TextBox and friends are definitely here
XAML standard effort has ended in nothing really useful
And no real spec was published
Jonathan
@vanillajonathan
Dec 17 2018 13:43
Well, a draft of the spec is released, and Microsoft released a preview version of Xamarin with aliases that adheres to that draft
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:44
The problem is that you won't be able to share markup across different xaml platforms, because the platforms are way to different
Jonathan
@vanillajonathan
Dec 17 2018 13:44
Then what is the point of the standard then?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:44

draft of the spec is released

That was in November 2017

Jonathan
@vanillajonathan
Dec 17 2018 13:44
My understanding is that you can share some markup that the platforms have in common
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:44
Nothing happened since then
Jonathan
@vanillajonathan
Dec 17 2018 13:45
Is that due to failure of Avalonia and Uno, etc to adopt the draft?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:45
The problem with any such standard would be that it would be even more limited than Xamarin forms
For example Xamarin forms don't provide controls themselves
Jonathan
@vanillajonathan
Dec 17 2018 13:46
No, because you can extend it using Avalonia-specific functionality, and Xamarin-specific functionality, the standard is just to share a common ground
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:46
They just wrap existing platform control
Jonathan
@vanillajonathan
Dec 17 2018 13:46
That's fine. That's an implementation detail. The standard just defines a common subset.
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:47
Unfortunately, it doesn't
Open-sourcing System.Xaml was a step in the right direction though
Microsoft/xaml-standard#216 - I've sent them this proposal
Got some :+1: from community, but no real answer from MSFT
Jonathan
@vanillajonathan
Dec 17 2018 13:50
Now that System.Xaml is open source, will Avalonia switch from Portable.Xaml to System.Xaml?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:52
We are planning to
That won't solve the problem, though
Jonathan
@vanillajonathan
Dec 17 2018 13:52
Oh, cool
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:53
WPF, UWP, Xamarin.Forms, eto.Forms and Avalonia are using different "DependencyObject" implementations
Binding systems are also different
Jonathan
@vanillajonathan
Dec 17 2018 13:53
What does Microsoft open sourcing WPF and UWP mean to Avalonia? Does it affect it in anyway? Does it matter?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:53
I'm planning to try to run WPF code on top of Avalonia
Jonathan
@vanillajonathan
Dec 17 2018 13:53
Oh, cool
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:54
Most of the stuff there should be cross-platform
Jonathan
@vanillajonathan
Dec 17 2018 13:54
Do Avalonia benefit from WPF being open source?
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:54
I will probably need to replace HwndSource and Window classes with different implementations

Do Avalonia benefit from WPF being open source?

We are planning to port some controls from there

WPF's Grid has shared size groups that we are currently lacking
There are also controls like ListView that can be ported
Same goes for UWP
Once controls are released (they currently aren't), we'll be porting some of them
dfkeenan
@dfkeenan
Dec 17 2018 13:55
Trying to run WPF on top of Avalonia would be an enormous effort. WPF is pretty big.
Nikita Tsukanov
@kekekeks
Dec 17 2018 13:55
Yes
The thing is that I don't have to touch that enormous code base
I only need to figure toplevel stuff and input handling
Rendering infrastructure can be replaced with ours
DrawingContext API is almost exactly the same
The rest (DependencyObject, bindings, styling, controls, control themes, resources, etc, etc)
should be able to run as is
I haven't actually tried it yet since MS-Rsl doesn't allow actually touching the code
dfkeenan
@dfkeenan
Dec 17 2018 13:58
I was just looking at how RoutedCommand was implemented. SO MUCH CODE. And I still can't find how SystemCommands.CloseWindowCommand etc. work. But maybe not everything is on the reference source site.
Jonathan
@vanillajonathan
Dec 17 2018 13:58
It would be nice of the Avalonia website or on GitHub or some blog there were information with what Avalonia's stance is on various announcements such as .NET Core 3.0, open sourcing of System.Xaml, WinForms, WPF and UWP, and the XAML Standard (draft). How it affects the Avalonia project. What the impact is. If it benefits Avalonia in any way. If Avalonia will ignore XAML Standard.
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:00

SO MUCH CODE

Look at all the code we don't have to even touch!

And once we get something to work
Even some simple hello world app
I expect a lot of interest in getting that compatibility layer into a working shape
@vanillajonathan the impact so far is non-existent since neither WPF or UWP were actually open-sourced yet
Jonathan
@vanillajonathan
Dec 17 2018 14:05
https://github.com/dotnet/wpf/ Isn't this the source code for WPF?
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:05
It's the source code of System.Xaml
It's planned to release the rest of WPF
But only System.Xaml is actually here
Same goes for XAML standard
We haven't seen anything but some list of controls more than a year ago
Jonathan
@vanillajonathan
Dec 17 2018 14:12
Then at least the list of controls could be implemented. Then that's at least some common ground.
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:13
Styling systems are different
I guess we could have TargetType for compatibility purposes
Not sure about style inheritance
Our styling system is more css-like
Jonathan
@vanillajonathan
Dec 17 2018 14:13
Even so, it would still be easier to understand and learn if controls were named the same.
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:15
I think we are currently missing ListView, ProgressRing, ToggleSwitch, TimePicker and WebView
And InputScopeNameValue
Jonathan
@vanillajonathan
Dec 17 2018 14:16
I think that should be documented somewhere. Along with if there are any plans to implement those.
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:16
WebView is tricky
We could ship CEF, I guess, but that's only for desktop platforms and the size of the thing is horrific
Jonathan
@vanillajonathan
Dec 17 2018 14:18
I think Gecko should have a CEF-compatible interface. Not sure. Maybe that's Servo.
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:21
There are two main issues with WebView:
1) tons of incompatible "native" browser engines
2) "native" control embedding
Qt solves this by shipping their custom patched build of Chromium
Jonathan
@vanillajonathan
Dec 17 2018 14:22
It would nice of the Avalonia website had a roadmap
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:22
We have one in github wiki, but it's outdated
Yep, horribly outdated
I think the current plan for the immediate future is:
  • Global menu support for OSX/Linux
  • X11 backend
  • New text layout engine with proper RTL and surrogate pairs support and Flow Document model (i. e. <Run> element inside <TextBlock>
  • Support for CJK input methods
Also, Wayland backend for Linux
After that, I think we need proper touch gesture support
These particular subsystems are chosen because they will most likely introduce breaking changes to the API
So we need to finish them before releasing 1.0
Which would be our "Stable API" release
Jonathan
@vanillajonathan
Dec 17 2018 14:27
OSX is nowadays macOS
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:28
net core runtime identifier was osx-x64 last time I've checked, so I'm referring to it this way
Jonathan
@vanillajonathan
Dec 17 2018 14:41
Yeah, that is likely to stay that way. But its just an internal identifier. The official product name is currently "macOS"
Can we get an updated roadmap?
Can we get a blog post or page on the website on the stance of Avalonia on the recent announcements by Microsoft, and how they will affect Avalonia?
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:43
Regarding fluent design and WPF
Jumar Macato
@jmacato
Dec 17 2018 14:44
I have a demo back in april regarding blurred background for Avalonia on Win10
though idk if the rendering artifacts are already fixed
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:46
I guess we should get the roadmap updated, yes
For recent announcements we should wait for actual source code to be released, I think
We have almost nothing to work with right now
Jonathan
@vanillajonathan
Dec 17 2018 14:48
Well, would be nice to see a statement on the release of System.Xaml
Nikita Tsukanov
@kekekeks
Dec 17 2018 14:59
System.Xaml implementation raises the question of further Mono support
Basically, the problem is that we shouldn't be shipping our own System.Xaml.dll if we are targeting "full" .NET Framework
Because there is existing code that links to System.Xaml from GAC
So for net4x profile we have to rely on System.Xaml from system
The problem is that Mono doesn't ship with a working System.Xaml implementation
So we either have to use our own build of System.Xaml with renamed namespaces
Or drop Mono support
Jonathan
@vanillajonathan
Dec 17 2018 15:04
This is all very interesting. It would be nice with a blog post with all your thoughts.
Nikita Tsukanov
@kekekeks
Dec 17 2018 15:10
We are currently using Portable.Xaml which is based on a code import from Mono implementation several years ago
There were tons of improvements in Portable.Xaml to match System.Xaml's behavior since then
Might be solved by this
Jonathan
@vanillajonathan
Dec 17 2018 15:13
Oh, that looks nice!
Reed Copsey, Jr.
@ReedCopsey
Dec 17 2018 18:07
Anybody around who knows startup details in Avalonia? Hitting "Unable to find view for [my main window type]", but not seeing anything obvious which could cause that
danwalmsley
@danwalmsley
Dec 17 2018 18:30
Is you mainwindow. Xaml an embedded resource? Post your startup code
Reed Copsey, Jr.
@ReedCopsey
Dec 17 2018 18:57
Sorry - I got that part - now I'm stuck on a rendering issue
(I'm attempting to get https://github.com/ReedCopsey/Gjallarhorn.Bindable to work with Avalonia like it does with WPF and Xam Forms :) )
will AppBuilder.Configure<App>().UsePlatformDetect().LogToDebug().SetupWithoutStarting().Instance cause issues there? It seems like something's not initializing properly (on Windows desktop atm) with the rendering system - Getting OpenGL: Unable to initialize EGL-based rendering: "Avalonia.Platform.Interop.DynamicLibraryLoaderException: Error loading libegl.dll (which doesn't happen with a sample)
Reed Copsey, Jr.
@ReedCopsey
Dec 17 2018 19:14
not sure what I'm missing from the init calls to get that to show up :(
Reed Copsey, Jr.
@ReedCopsey
Dec 17 2018 19:21
but it starts up with a black window
Benedikt Schroeder
@Gillibald
Dec 17 2018 19:25
Is the libegl.dll present in your output directory? If not you have to borrow one from a Google Chrome installation.
Reed Copsey, Jr.
@ReedCopsey
Dec 17 2018 19:31
okay
Anybody know the mechanism Avalonia uses to bind CLR props? Seems like IReflectableType isn't honored
Matthew Moloney
@moloneymb
Dec 17 2018 19:33
Hi Reed, I don't know the answer to your question, just thought I'd say hi
Not sure if you're after something specific, but I open a window in F# as per https://github.com/moloneymb/TF_examples/blob/avaloniaui/src/AvaloniaControls/Avalonia.fs
Reed Copsey, Jr.
@ReedCopsey
Dec 17 2018 20:17
I think I got past that part. Was missing default styles (didn't realize that was required)
Now just need to duf
Figure out what reflection mechanism is used
Thanks @moloneymb for the help
Nikita Tsukanov
@kekekeks
Dec 17 2018 20:26

will AppBuilder.Configure<App>().UsePlatformDetect().LogToDebug().SetupWithoutStarting().Instance cause issues there

The current preferred way of initializing stuff is

        [STAThread]
        static void Main(string[] args)
        {
                BuildAvaloniaApp().Start(AppMain, args);
        }

        public static AppBuilder BuildAvaloniaApp()
                => AppBuilder.Configure<App>().UsePlatformDetect().UseSkia().UseReactiveUI();

        static void AppMain(Application app, string[] args)
        {
            app.Run(new MainWindow());
        }
The needed overload for Start is only available in nightly builds though
@ReedCopsey
Reed Copsey, Jr.
@ReedCopsey
Dec 17 2018 22:13
wouldn't exactly work as intended for me - not using ReactiveUI (this is alternative approach vs MVVM - MVU more like Elm), and not using C# ;)
but I do appreciate the insight
Jose Antonio
@santanor
Dec 17 2018 22:58

Hello guys, I've got a question about layout. To me what I've got makes sense so I don't know if I'm hitting a bug or what.

I've got a Horizontal panel with 3 lists. And each element on that list is an array in itself. Each element of the array should be placed horizontally but that isn't what it's happening. Here have a look at this gist

https://gist.github.com/santanor/1ade59360e9d6a1891e888fb1c08f7de

image.png
As you can see here, the items are placed vertically where they should be horizontally. Am I hitting a bug? Or just blind?
dfkeenan
@dfkeenan
Dec 17 2018 23:18
Do you want the "WordCodes" horizontal?
Jose Antonio
@santanor
Dec 17 2018 23:37
Yeah
You know... each box should have those items horizontally, not vertically like it's there
ahopper
@ahopper
Dec 17 2018 23:40
I think you need to set the listbox.itemspanel
Jose Antonio
@santanor
Dec 17 2018 23:41
Ah!
instead of having each list inside a panel?
ahopper
@ahopper
Dec 17 2018 23:43
yep, you might want to do it for both the inner and outer listbox
Jose Antonio
@santanor
Dec 17 2018 23:44
Brilliant. Thanks a lot! I'll give it a try