These are chat archives for AvaloniaUI/Avalonia

18th
Dec 2018
Nikita Tsukanov
@kekekeks
Dec 18 2018 05:34
@ReedCopsey I'm talking about the structure of the program that should be preserved on MSIL level
Without separate BuildAvaloniaApp you won't be able to get previewer to work
Without separate AppMain you might accidentally touch something that tries to use avalonia API before it's properly initialized
Matthew Moloney
@moloneymb
Dec 18 2018 05:54
Hey @ReedCopsey and @cloudRoutine, looking forward to seeing what you guys produce. Having programmed with WPF in F# for more than 10 years I might have a few things to add ;) I understand that you'll be pushing the MVU which is an improvement to MVVM but.... with higher order functions you can do better. Specifically there is no need to do the UI in Xaml. You can use normal F# to build it. Tsunami didn't use Xaml and non of my comercial WPF F# applications use it. I had to use some undocumented APIs but now that WPF will be open sourced building such wrappers will be even easier. I've been meaning to open source my wrappers but there didn't seem to be much interest.
Jared Hester
@cloudRoutine
Dec 18 2018 05:59
@moloneymb as far as a higher level abstraction is concerned, the way they've pushed MVU even further at janestreet interests me the most
https://www.youtube.com/watch?v=R3xX37RGJKE
i wrote a bit about it here + lots of references - fsprojects/Fabulous#258
i happen to like xaml since i can make stuff in illustrator and drop into to blend and hook everything up easy, i mostly use it because of the WYSIWYG visual design aspects
Matthew Moloney
@moloneymb
Dec 18 2018 06:05
I get the idea, but I worry about going too functional. I invested heavily in reactive only to have to expensivly rip it out later. So I sit on the more pragmatic side of things, with global state, mutable objects, polling. The now defunct Beyond Games built their game engine around reactive. I was at Microsoft for the whole Project Oslo where they created the worlds slowest and most useless text editor using reactive ideas.
Matthew Moloney
@moloneymb
Dec 18 2018 06:11
Anyway, I'd love to have a play with what you build. I'll keep an eye out.
Nikita Tsukanov
@kekekeks
Dec 18 2018 06:49

@moloneymb

Specifically there is no need to do the UI in Xaml. You can use normal F# to build it.

Any idea how that could work with previewer? We could probably run F# compiler in previewer context

That would require the "markup" to be in a separate file and everything it needs has to be public
Matthew Moloney
@moloneymb
Dec 18 2018 06:55
@kekekeks It could be possible to use compiler attributes, I've had a good experience using F# with Unity where you could see the results after compiling.
If it needs to attach to a file, there could just be a placeholder XAML which hosts the controls for viewing and feedback but is not used in the app.
Nikita Tsukanov
@kekekeks
Dec 18 2018 06:59
Our current previewer parses XAML without touching the actual codebehind class
Matthew Moloney
@moloneymb
Dec 18 2018 06:59
Sometimes I'll live code UI in F# using the FSI (fsharp interactive). Where I'll change the app on the fly. The link I sent Reed was my attempt at doing this with Avalonia, it works in Windows but not in linux yet, but that's due to some issues with .Net core and Mono not playing nice. That'll be fixed with a new .net core fsi
Nikita Tsukanov
@kekekeks
Dec 18 2018 06:59
But it has access to private/protected/internal stuff via reflection
Matthew Moloney
@moloneymb
Dec 18 2018 07:00
I see, F# doesn't have partial classes anyway
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:00
Is FSI capable of accessing assembly-internal classes?

I see, F# doesn't have partial classes anyway

we aren't using codegen

So partial classes aren't needed
Matthew Moloney
@moloneymb
Dec 18 2018 07:02
is assembly internal classes a limtation?
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:02
If we try to run F# compiler from previewer
The generated code wouldn't be a part of the assembly
Matthew Moloney
@moloneymb
Dec 18 2018 07:02
My use case is to create pyplot or ggplot but for .Net in F# on .Net Core.
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:02
So it won't have access to internal classes, internal members, etc
Matthew Moloney
@moloneymb
Dec 18 2018 07:03
The code you generate or the F# compiler code? Could you not generate it without internal classes?
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:03
I think there is some misunderstanding
Matthew Moloney
@moloneymb
Dec 18 2018 07:04
I'm pretty sure I'm not getting something
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:04
You've said that UI could be defined in plain F# instead of XAML
Matthew Moloney
@moloneymb
Dec 18 2018 07:04
Yes
I don't preview it though, I'll code then run, or interactively code in F# scripting
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:06
We have some infrastructure for defining UI from C# code that was used before we had XAML support
The problem with this approach is that previewer isn't available
I was talking about a way to run "UI-from-code" with previewer
You see, our previewer infrastructure is quite simple
We are using this code to load the code that comes from IDE process
I think it could be extended to preview something other than XAML
Without touching other bits
If F# had a good DSL for defining controls, we could host F# compiler inside our previewer process
And make it recompile the file with DSL each time it changes
That's not practical for C# since it has no proper way of defining DSL, so for C# XAML is objectively better
Matthew Moloney
@moloneymb
Dec 18 2018 07:11
That would be cool, I'm interested, I have a 'decent' dsl that works for my purposes, but WPF/F# ppl are pretty rare.
Certainly, I've made the case that F# DSLs should be used over XAML
It doesn't have implicit conversions which hurts but that's often wrapped away.
I'll put asside a weekend and I'll see what I can do. Gtg to bed now though, it's been nice chatting.
Matthew Moloney
@moloneymb
Dec 18 2018 07:20
I have a huge example of the F# DSL being used for one of my complex controls. It's a complete control template with inline UI, it's a little crazy. It was my first major attempt and it was the only control template I needed, so I haven't refined it.
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:22
access denied
Matthew Moloney
@moloneymb
Dec 18 2018 07:23
ah, fair enough, I'll make a gist out of it, just a sec.
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:34
Mkay, we'll need a way to specify what previewer should instantiate from the compiled code
I think it should be easy to add extensions to previewer
Matthew Moloney
@moloneymb
Dec 18 2018 07:35
I was thinking a compiler attribute
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:35
Since it calls BuildAvaloniaApp
so they could be registered from there
We also need a way to tell VS extension that file is supposed to be previewed
Matthew Moloney
@moloneymb
Dec 18 2018 07:37
Ah yeah, could have a xx.preview with the class name, though that could look a little hackey
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:37
I was thinking about some comment at the beginning of the file
Matthew Moloney
@moloneymb
Dec 18 2018 07:37
was just about to say that :)
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:38
Extension needs to be able to detect "extended" file type without consulting the language service
Matthew Moloney
@moloneymb
Dec 18 2018 07:38
There is already precident with comment directives in F# with literate programming
I do have to go to bed though :( it's close to 3am
and I get up in 5 hours
later
Jared Hester
@cloudRoutine
Dec 18 2018 07:56
@kekekeks when you say consulting the language service to you mean the one that's already built into VS or any language service? because I think FCS (FSharp.Compiler.Service) could be used for the hotloading
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:56
Previewer runs in a separate process
Previewer process has to have no dependencies on VS
Since it's used in other IDEs
Jared Hester
@cloudRoutine
Dec 18 2018 07:57
then FCS will work
Nikita Tsukanov
@kekekeks
Dec 18 2018 07:58
The question about "consulting the language service" was about VS extension itself
We need a way to detect if particular source file wants to have previewer displayed
Since previewer infrastructure is quite expensive
Separate process per opened file that can consume 100MB+
Jared Hester
@cloudRoutine
Dec 18 2018 08:01
couldn't the previewer have an input for the path to the file and checkbox to indicate it should keep watching?
i haven't used it for a while, the last time i tried it wouldn't play nice with F# projects in the solution along with C# and kept exploding, but that must have been at least 7 months ago
Nikita Tsukanov
@kekekeks
Dec 18 2018 08:13

couldn't the previewer have an input for the path to the file and checkbox to indicate it should keep watching?

That would be a standalone previewer

I'd like to have one in Visual Studio itself
Like we do for our XAML files

kept exploding

It probably couldn't traverse project references properly

Nikita Tsukanov
@kekekeks
Dec 18 2018 09:04
@Gillibald Do I understand correctly that the current FormattedTextImpl can't be created from non-UI thread?
Benedikt Schroeder
@Gillibald
Dec 18 2018 09:55
I think @grokys mentioned something that the FormattedTextImpl has to bring created on the renderer thread for some reason. The TextLayout should be immutable. If brushes have this limitation counts for brushes it does count for the text layout too.
Nikita Tsukanov
@kekekeks
Dec 18 2018 10:25
I was concerned about typeface caches, but they seem to be using ConcurrentDictionary
so it should be OK
Benedikt Schroeder
@Gillibald
Dec 18 2018 10:29
Y I was concerned about access from different threads so I used ConcurrentDictionary. Not sure if that was needed.
Nikita Tsukanov
@kekekeks
Dec 18 2018 10:32
@jmacato
I think that should be enough for smooth GIF animations
Steven Kirk
@grokys
Dec 18 2018 10:34
Hmm I don't think there's any reason they need to be created on the UI thread, other than a platform requirement
Jumar Macato
@jmacato
Dec 18 2018 10:35
@kekekeks looks great!
Jonathan
@vanillajonathan
Dec 18 2018 10:56
OpenGL: Unable to initialize EGL-based rendering: "Avalonia.Platform.Interop.DynamicLibraryLoaderException: Error loading libegl.dll error 126
Nikita Tsukanov
@kekekeks
Dec 18 2018 11:05
You need EGL libraries if you want to use Skia+OpenGL on Windows
Jonathan
@vanillajonathan
Dec 18 2018 11:05
I see, and if I don't want that. What do I do?
Nikita Tsukanov
@kekekeks
Dec 18 2018 11:06
We have switched to opt-in for that feature in our nightly builds
Second argument for UseWin32
Jonathan
@vanillajonathan
Dec 18 2018 11:08
I see. I only have the NuGet package, not the nightly build.
Nikita Tsukanov
@kekekeks
Dec 18 2018 11:10
You can safely ignore this warning
I think it's only printed to console
Jonathan
@vanillajonathan
Dec 18 2018 11:11
I see. But my application is black only. And <Window Title="Foo"> seems do to do nothing. Just a big black window with empty title bar.
Nikita Tsukanov
@kekekeks
Dec 18 2018 11:12
Try adding .UseDirect2D1()
To BuildAvaloniaApp()
Black window shouldn't happen though
What Windows version are you using?
Luis von der Eltz
@toytonics
Dec 18 2018 11:12
Where can I get a list of all the binding identifiers like $parent or $self? http://avaloniaui.net/docs/binding/binding-to-controls only lists $parent. Is there some $tparent for TemplateParent?
Nikita Tsukanov
@kekekeks
Dec 18 2018 11:13
Only $self and $parent so far
Jonathan
@vanillajonathan
Dec 18 2018 11:14
@kekekeks Windows 10 with Intel Skylake
Adding UseDirect2D1() got rid of the console warning, but still black screen.
Jonathan
@vanillajonathan
Dec 18 2018 11:25
Oh, maybe I need to override Initialize in my App.cs file?
Jonathan
@vanillajonathan
Dec 18 2018 11:31
System.IO.FileNotFoundException: 'Unable to find view for Foo.UI.App'
Nikita Tsukanov
@kekekeks
Dec 18 2018 11:32
Please, check if our controlcatalog works on your machine
Jonathan
@vanillajonathan
Dec 18 2018 11:51
I ran the ControlCatalog.Desktop.exe file and nothing happened.
Jonathan
@vanillajonathan
Dec 18 2018 12:11
Oh great, I installed the Avalonia for Visual Studio extension and managed to get the Hello World running
Jonathan
@vanillajonathan
Dec 18 2018 12:50
VS extension creates project with Avalonia 0.6.1 not 0.7.0 also uses EmbeddedResource instead of AvaloniaResource
Luis von der Eltz
@toytonics
Dec 18 2018 13:16
are there any best practices for dealing with circular dependencies (i.e. a property A setting B and vice versa) in StyledProperties?
Jonathan
@vanillajonathan
Dec 18 2018 13:25
When I had <EmbeddedResource> in my .csproj then it worked. When I had <AvaloniaResource> then I got FileLoadException that it could not find the view.
Jonathan
@vanillajonathan
Dec 18 2018 13:47
Having to call AvaloniaXamlLoader.Load(this); in every user control, page, window and application is boilerplate code.
Benedikt Schroeder
@Gillibald
Dec 18 2018 13:52
Wpf kind of has the same
Jonathan
@vanillajonathan
Dec 18 2018 13:53
Ah, I see
Benedikt Schroeder
@Gillibald
Dec 18 2018 13:56
InitializeComponent is called when you have a partial definition of the class in xaml. Maybe there is some way in the future to inject that part on build.
Jonathan
@vanillajonathan
Dec 18 2018 14:05
Bindings doesn't seem to be checked at compile time.
Benedikt Schroeder
@Gillibald
Dec 18 2018 14:11
Xaml isn't compiled at all currently.
Jonathan
@vanillajonathan
Dec 18 2018 14:12
I see
Jonathan
@vanillajonathan
Dec 18 2018 14:21
If anything under <local:*> is pointing wrong it does not red underline the error in Visual Studio.
Jonathan
@vanillajonathan
Dec 18 2018 14:41
Toolbox in Visual Studio is not populated with controls.
Nikita Tsukanov
@kekekeks
Dec 18 2018 14:44
We don't provide a visual designer, only previewer
grkom
@grkom
Dec 18 2018 15:06
Hi guys, do you plan to merge any of the perf improvements PRs (AvaloniaUI/Avalonia#2088 for instance) ? Some parts of my application could benefit from faster execution, and I would rather not use my own build of Avalonia (with improvements merged in).
Jonathan
@vanillajonathan
Dec 18 2018 15:13
The visual previewer tends to crash all the time
Why does WPF use partial classes, and Avalonia don't?
Jonathan
@vanillajonathan
Dec 18 2018 15:20
Why does WPF window reach a InitializeComponentmethod by inheritance, while in Avalonia you have to implement your own private method?
Jumar Macato
@jmacato
Dec 18 2018 15:26
@vanillajonathan because it's pregenerated by VS whenever you make a xaml file
Jonathan
@vanillajonathan
Dec 18 2018 15:26
Avalonia doesn't like that approach?
Jumar Macato
@jmacato
Dec 18 2018 15:26
We dont have any codegen for xaml just yet
Jonathan
@vanillajonathan
Dec 18 2018 15:27
Is it coming?
Jumar Macato
@jmacato
Dec 18 2018 15:27
hard to say, it's not a trivial thing to do :(
Nikita Tsukanov
@kekekeks
Dec 18 2018 15:27
The problem with XAML codegen is that it makes the framework C#-centric
Jonathan
@vanillajonathan
Dec 18 2018 15:27
I see. If my MainWindow have a TextBlock, how do I access it from within the MainWindow.cs file?
Nikita Tsukanov
@kekekeks
Dec 18 2018 15:28
It's not that hard to implement codegen
Jonathan
@vanillajonathan
Dec 18 2018 15:28
Ah, I see. True. And you want it to be ALL of .NET, also F#
Nikita Tsukanov
@kekekeks
Dec 18 2018 15:28
Especially since we already have MSBuild task
We currently have AvaloniaXamlLoader.Load(this) instead of InitializeComponent
It should still be called from constructor
Jonathan
@vanillajonathan
Dec 18 2018 15:29
Yeah, that's not as pretty. Not as easy to remember.
Also in the future Avalonia might want to do other things on the init, so I think it would be better to create an InitializeComponent method that people can use. It would also make it easier for WPF devs.
I don't think it should have to be explicitly called, it is boilerplate code. The framework should do that by convention.
I forgot to call AvaloniaXamlLoader.Load(this) in one of my UserControls, and it gave me a headache.
Jumar Macato
@jmacato
Dec 18 2018 15:36
@vanillajonathan iirc i think the templates on VS should have those built in but in any case those boilerplates issues will be solved once we get our codegen running
Jonathan
@vanillajonathan
Dec 18 2018 15:37
Oh, cool
Jumar Macato
@jmacato
Dec 18 2018 15:37
and speaking of accessing a textblock, you can do this.FindControl<(control type)>("nameofcontrol");
Jonathan
@vanillajonathan
Dec 18 2018 15:37
How do I from MainWindow.xaml.cs access the elements defined in MainWindow.xaml?
Thanks!
Nikita Tsukanov
@kekekeks
Dec 18 2018 15:38
Finding named controls is one of the things CodeGen should be doing
But it also needs to somehow extract control types in build time
Jonathan
@vanillajonathan
Dec 18 2018 15:40
I see
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:07
@kekekeks To be honest, for the F# devs long term, I wouldn't worry too much about the previewer
most of the F# work is going more and more towards MVU
previewing would be nice for Gjallarhorn (since it still uses xaml/binding), but things like Fabulous don't really play nice with previewing anyways, since the logic builds the view directly
but I do think it's important to consider !C# when designing how the views are loaded - the current approach is fairly easy to handle from F#, which is nice
(though, hot reloading would be awesome [for everybody] - but that's not trivial - fabulous had to do some interesting things to enable it, and even then, it's imperfect)
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:09

since the logic builds the view directly

We could compile the logic in previewer process

BTW, does MVU mean that you are recreating controls on state tree change?
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:10
have you looked at MVU architectures? that's essentially running the entire program
well, in better versions, it doesn't recreate as much as diff/patch
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:10
I'm familiar with Redux, not sure if it's the same thing
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:10
similar idea
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:11
The problem with Redux-like frameworks is that UI controls usually actually have some state
With said state being quite expensive to recreate from scratch
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:11
Check out Fabulous at some point - it's pretty slick. The biggest problem is that building the wrappers for each control is a bit of a pain
the state isn't recreated from scratch (unless the model changes dramatically, in which case, you'd be doing that anyways) - it's just "patched" as needed, which is what would typically happen anyways
it tends to work fairly well in practice
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:14
Does it have the same concept of "controlled" components as React does?
When control parameters are derived from state
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:15
similar - was designed around Xamarin Forms, so the mechanisms aren't the same, but yes - same idea - you basically "build" the UI every state frame, and the framework does the UI diff/patch operation on the fly, so it acts like a react virtual DOM
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:15
So when, for example, user types a letter to textbox, event gets sent to the state management library, state changes, textbox gets the new Text value derived from the state
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:16
depends on how you wire it up - text boxes typically don't pump the message until you lose focus (unless you want them to), so it'd be more when you tab out or click out unless you explicitly asked otherwise, but yeah, that's the idea
I do the same in Gjallarhorn - but it doesn't touch the UI as much as the "view model" layer (that's dynamic/hidden)
Gjallarhorn is one step back - I effectively use XAML still, but I MVU with the "view" being similar to an MVVM view model
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:16
I had a lot of frustration with React when it wasn't able to reuse old textbox control for some reason
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:16
so the binding updates
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:17
So caret position was getting reset to the beginning of the textbox
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:17
yeah - react is far from perfect :D have had much better luck with things that wrap it or use their own vdom
Fable.Elmish is pretty slick, and doesn't seem to have any of those issues, for example
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:18
How do you check if some "reducer" actually has changed it's state?
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:18
that's easy in F# - since data is immutable by default and has structural equality implemetned by default
stuff like that really sucks from C#, but is pretty easy in FP langs
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:19
So you compare the whole state tree on each command, right?
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:19
in Gjallarhorn.Bindable, Gjallarhorn handles that for me
because it's effectively a reactive library that automatically stops propogating that changes happen if the state is unchanged
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:20
The good thing about XAML is that it support fine-grained updates out of the box
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:20
so the tree is broken up and updates don't "push down" from the top if things aren't changed... tends to perform very well
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:20
In JS world folks had to create MobX because of that
Reed Copsey, Jr.
@ReedCopsey
Dec 18 2018 16:51
@kekekeks in case you're interested - https://twitter.com/ReedCopsey/status/1075071050126409728
Samuel Diogo
@samudiogo
Dec 18 2018 16:53
Hi guys, I'm tryng to cath the keydown event of a special keyboard (supermarket), but some keyboard's keys doesn't fire an event.. how can I work around this?
KeyDown += (sender, e) => WriteLine($"KeyDown: {e.Key} G: {e.Key:G} F: {e.Key:F} D:{e.Key:D}");
Nikita Tsukanov
@kekekeks
Dec 18 2018 16:58
@ReedCopsey :+1:
@samudiogo what OS are you using?
Samuel Diogo
@samudiogo
Dec 18 2018 16:58
Windows and Ubuntu
Place a breakpoint there
Check what virtual key is sent
We really need a way to handle "unknown" keys
ahopper
@ahopper
Dec 18 2018 17:11
@kekekeks very excited about #2185 (could be my favourite xmas present). Will the two methods always be called on the same thread or can it change?
Nikita Tsukanov
@kekekeks
Dec 18 2018 17:12
They are called from different threads if ImmediateRenderer is used
Since the check for NeedsUpdate is performed on render loop thread
While actual rendering happens on UI thread
In case of DeferredRenderer the check for HasNewFrames is performed twice
both times on render thread
ahopper
@ahopper
Dec 18 2018 17:13
will ThreadSafeRender always be on the same thread
Nikita Tsukanov
@kekekeks
Dec 18 2018 17:13
Can't guarantee that
Why do you need such thread guarantees?
ahopper
@ahopper
Dec 18 2018 17:16
I don't need them, I'm just planning how to interface to my native backend which uses a number of lock free queues to talk to the front end and just wondered if I could use a fast single producer single consumer queue or not
Nikita Tsukanov
@kekekeks
Dec 18 2018 17:17
It's guaranteed that ThreadSafeRender won't be called from multiple threads simultaneously
Unless you decide to do something weird like calling ImmediateRenderer.Render on your visual
ahopper
@ahopper
Dec 18 2018 17:18
That's useful, thanks.
Is that still true with multiple windows open (from the same app)?
Nikita Tsukanov
@kekekeks
Dec 18 2018 17:23
That's on per-visual basis
We might want to have separate render loops for each window in the future
It should be fine to have the entire code of these methods in a lock block
ahopper
@ahopper
Dec 18 2018 17:29
ok thanks.
Jonathan
@vanillajonathan
Dec 18 2018 18:53
For property binding, can you use INotifyPropertyChanged or do you have to use AvaloniaPropertyand GetValue()/SetValue()?
Nikita Tsukanov
@kekekeks
Dec 18 2018 19:03
INPC works
for source properties
Jonathan
@vanillajonathan
Dec 18 2018 19:05
Oh good, because INotifyPropertyChanged is simple, I already know how to use it. Its not some weird framework-specific thing.
So when I set a value to source property in the class, then the UI gets updated?
Nikita Tsukanov
@kekekeks
Dec 18 2018 19:05
It should work just like in WPF/UWP/Xamarin.Forms
Jonathan
@vanillajonathan
Dec 18 2018 19:06
I've never used those. Because those were firmly proprietary. I only got an interest in UI on .NET Core since I read about Microsoft making those open source. Also making them available for .NET Core, since I don't use .NET Framework 4.*
I have no interest in proprietary technology or .NET Framework 4
Nikita Tsukanov
@kekekeks
Dec 18 2018 19:08
FYI Xamarin.Forms, Xamarin.iOS, Xamarin.Android, Xamarin.Mac and Mono are all open-source
Jonathan
@vanillajonathan
Dec 18 2018 19:08
Yeah, but I have no interest in Mono, its .NET Framework 4. I only like .NET Core.
Do I need to care about GetValue()and SetValue() if I just want to use INotifyPropertyChanged?
Nikita Tsukanov
@kekekeks
Dec 18 2018 19:17
No
Jonathan
@vanillajonathan
Dec 18 2018 19:18
Oh, great! :)
I did <TextBlock Text="{Binding Foo}" /> and then it complained something about the value being null?
ahopper
@ahopper
Dec 18 2018 19:43
@vanillajonathan there are some useful simple binding examples here https://github.com/VitalElement/Avalonia.Examples
Jonathan
@vanillajonathan
Dec 18 2018 19:44
@ahopper Thanks!
ahopper
@ahopper
Dec 18 2018 19:50
and whilst you may not like wpf there are a lot of good wpf tutorials/examples that map very closely to avalonia, especially the mvvm stuff
Jonathan
@vanillajonathan
Dec 18 2018 20:40
I don't dislike WPF because I don't know much about it to dislike it. I just haven't paid any attention to it since it was for .NET Framework only and proprietary. Now that its for .NET Core and open source, I've been peeking a bit at it. Which lead me to Avalonia since its cross-platform and WPF and Windows UI XAML / UWP is not.
ahopper
@ahopper
Dec 18 2018 21:01
:) yep I undersatnd, I probably didn't word that perfectly, much of the Avalonia documentation http://avaloniaui.net/docs/ assumes a background in wpf/uwp, so if something isn't clear falling back to wpf docs can help.
Jonathan
@vanillajonathan
Dec 18 2018 22:49
After reading a bit about WPF and UWP it seems that WPF is the old thing, and UWP is the new thing, and Microsoft wants people to use UWP but that everyone hates UWP and thinks WPF was better