These are chat archives for AvaloniaUI/Avalonia

27th
Jan 2019
BarsikTheCaT
@BarsikTheCaT
Jan 27 06:52
Why is there so little info about binding? Is it such a common knowledge noone even bothers to write about it?
ahopper
@ahopper
Jan 27 06:53
BarsikTheCaT
@BarsikTheCaT
Jan 27 06:55
I read that, but still can't achieve what I want. I made myself a view model and set an instance of it to the main window's datacontext in MainWindow constructor
Then I have a Listbox with this attribute Items="{Binding Path=Substances}
And Substances is a property of my viewmodel
but the listbox is empty
ahopper
@ahopper
Jan 27 06:58
a good starting point is the vs mvvm template as it does the datacontext stuff for you
how is substances defined? it needs to be a public property
BarsikTheCaT
@BarsikTheCaT
Jan 27 07:00
public class WindowViewModel { /// <summary> /// Currently selected substance. /// </summary> public Substance SelectedSubstance = null; /// <summary> /// List ob substances. /// </summary> public List<Substance> Substances;
it's indeed one
Maybe I am missing comething about datacontext inheritance? Some syntax gimmick?
ahopper
@ahopper
Jan 27 07:02
when is the list constructed/populated? as it is not observable it needs to happen before any attempt to bind
BarsikTheCaT
@BarsikTheCaT
Jan 27 07:03
It's populated in the constructor
ahopper
@ahopper
Jan 27 07:04
can you post the whole code somewhere
BarsikTheCaT
@BarsikTheCaT
Jan 27 07:04
Then I just do this DataContext = new WindowViewModel(); in MainWindow constructor
ugh, idk
https://pastebin.com/E110Bw8q for XAML of main window
https://pastebin.com/D8YDU1he for main window cs
https://pastebin.com/08cTD30X for viewmodel
ahopper
@ahopper
Jan 27 07:20
Substances needs to be a property not a field
BarsikTheCaT
@BarsikTheCaT
Jan 27 07:21
wait
oh
crap
ahopper
@ahopper
Jan 27 07:21
:)
BarsikTheCaT
@BarsikTheCaT
Jan 27 07:22
Why do I keep missing these small syntax things
Anyway, thank you
BarsikTheCaT
@BarsikTheCaT
Jan 27 08:39
Probably another dumb question, but I don't see any way to bind a specific handler to an event in markup. Is that so or I'm missing something again?
Stano Turza
@Sorien
Jan 27 10:00
menu.gif
hi, there seems to be some problem with animations when you move faster up and down in list no all items are animated
roman
@maindlab_gitlab
Jan 27 12:17
Hi
i wanna start avalonia.mvvm on linux (on win works)
and have exception:
System.TypeInitializationException: The type initializer for 'Avalonia.Skia.TypefaceCache' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.
how I can solve it?
I create "dotnet avalonia.mvvm ..."
then add SkiaSharp in proj
and in win os it works, but linux(
thx
MonkAlex
@MonkAlex
Jan 27 13:22
What requirements on linux? Try to start on ubuntu 14 (netcore2 support), but get error on gtk loading
MonkAlex
@MonkAlex
Jan 27 13:29
libgtk 3.10.8-0ubuntu1.6 installed
Nikita Tsukanov
@kekekeks
Jan 27 13:30
Try using nightly builds
They are using X11 backend by default now
MonkAlex
@MonkAlex
Jan 27 13:33
Want release on week, not good idea retest all now.
Just want know, what minimal version supported.
Benedikt Schroeder
@Gillibald
Jan 27 13:49
@mattleibow_twitter Is Clang used for every platform including Windows?
ahopper
@ahopper
Jan 27 14:00
@MonkAlex i had an issue with old gtk3 versions AvaloniaUI/Avalonia#1656
MonkAlex
@MonkAlex
Jan 27 14:00
The same error on latest 14.04 lts
So, try to check 16 lts
Nikita Tsukanov
@kekekeks
Jan 27 14:01
16.04 definitely works
I've only updated to 18.04 in December last year
ahopper
@ahopper
Jan 27 14:12
updating gtk fixed it for that user
MonkAlex
@MonkAlex
Jan 27 14:13
@ahopper on ubuntu u cannot update gtk only, i think. Need update gnome etc
ahopper
@ahopper
Jan 27 14:19
I found the issue here https://groups.google.com/d/msg/sparksdr/Dzu9oegafII/Jq4uD-3dAQAJ and I believe Rick managed to update gtk3 maybe only a minor version?
Nikita Tsukanov
@kekekeks
Jan 27 14:21
I'm glad we won't depend on GTK anymore
ahopper
@ahopper
Jan 27 14:21
but that was 16.04
me too :+1:
Nikita Tsukanov
@kekekeks
Jan 27 14:22
I'll probably rewrite "native" file dialogs support to use as few GTK imports as possible
And add a fallback to GTK2
MonkAlex
@MonkAlex
Jan 27 14:31
ubuntu 16.04 from offsite run without any updates
Matthew Leibowitz
@mattleibow
Jan 27 15:56
@Gillibald not yet. iOS/Mac is clang from Xcode, Android is whatever they use, same with Tizen. Probably some form of gcc.
Linux is now switching
Windows can use clang, but I am using msvc atm
They do have support for the clang/cl, but I actually want to check with Google just to make sure that is the recommended one
MonkAlex
@MonkAlex
Jan 27 16:03
mint 18 work, 17 version failed with gtk too
ok, its done, i think
MonkAlex
@MonkAlex
Jan 27 16:12
Any idea, how test avalonia app on osx for free? =)
ahopper
@ahopper
Jan 27 17:09
@MonkAlex could you add what versions you found work and don't as a comment to #1656
James Burnside
@JCBurnside
Jan 27 17:27
is doing this.FindControl<DockPanel>("Container").DataContext = this; in the ctor of a user control ok?
Nikita Tsukanov
@kekekeks
Jan 27 17:43
@MonkAlex hackingtosh is the only "free" option, I guess
Since VMs don't support hw-acceleration
MonkAlex
@MonkAlex
Jan 27 17:44
hw-acceleration needed to run? Simple controls to show, nothing hard
Nikita Tsukanov
@kekekeks
Jan 27 17:46
Then VM
But it's not legal in most countries
MonkAlex
@MonkAlex
Jan 27 17:46
~_~
Nikita Tsukanov
@kekekeks
Jan 27 17:47
It is legal in Russia, though
These guys are even selling their computers with OSX
MonkAlex
@MonkAlex
Jan 27 17:48
I see that, thanks =)
Nikita Tsukanov
@kekekeks
Jan 27 17:52
You see, there is a collision between "use only on Apple hardware" from the license agreement and "legally obtained software can be run on any hardware and even modified to run on said hardware" from the law
So that part of the agreement is void here
Nikita Tsukanov
@kekekeks
Jan 27 18:10
Also legal in Germany
ahopper
@ahopper
Jan 27 19:21
@JCBurnside if you can provide a complete buildable project that repros your problem it is much simpler to spot problems.