These are chat archives for AvaloniaUI/Avalonia

30th
May 2018
Nelson Carrillo
@nc4rrillo
May 30 2018 02:29
@grokys @danwalmsley @MarchingCube @kekekeks @jkoritzinsky see: #1630
Adam Frisby
@AdamFrisby
May 30 2018 07:54
Hey there - I seem to be running an issue where Invalidate Visual is not thread safe
is that correct?
Exception + details: https://pastebin.com/RU1MYD6L
Jumar Macato
@jmacato
May 30 2018 07:57
@AdamFrisby why are you invalidating the mainwindow?
Adam Frisby
@AdamFrisby
May 30 2018 07:57
Actually on that particular line, I can remove it now - was trying to invalidate the controls; they weren't repainting on their own.
(just some status TextBlocks, but when changing the property, the renderer was not invalidating them, so been doing it by hand)
The offending line is the ones below though
Jumar Macato
@jmacato
May 30 2018 07:58
Okay
Adam Frisby
@AdamFrisby
May 30 2018 07:58
the error and status are the two throwing the exception
Intermittently throwing - not always, so I'm guessing it's a threading issue
OK, nope that line is infact required too
Doesn't update at all without. Don't suppose there's a bool or something I can set to 'always repaint'?
Jumar Macato
@jmacato
May 30 2018 08:00
Hmm, i think you should learn about INotifyPropertyChanged and the MVVM pattern
you will never have to invalidate controls
Adam Frisby
@AdamFrisby
May 30 2018 08:02
That probably sounds smarter, but in the case of me being dodgy, is there a quick/easy hack?
Jumar Macato
@jmacato
May 30 2018 08:03
for a quick hack (this i really don't recommend) you should use Dispatcher.Invoke() to call the invalidation controls
Rayyan Tahir
@RayyanTahir
May 30 2018 08:04
It would be Dispatcher.UIThread.Post() in Avalonia :smile:
Jumar Macato
@jmacato
May 30 2018 08:05
@RayyanTahir thanks, i was so used to wpf's dispatcher lol
Adam Frisby
@AdamFrisby
May 30 2018 08:06
Thankyou! Yeah I'll see about editing it properly
Rayyan Tahir
@RayyanTahir
May 30 2018 08:06
@AdamFrisby as per @jmacato answer, you would do it like:
Dispatcher.UIThread.Post(()=>{
//Your invalidation code here

});
Jumar Macato
@jmacato
May 30 2018 08:06
@AdamFrisby but we reaaaallly recommend you to learn MVVM :)
Adam Frisby
@AdamFrisby
May 30 2018 08:07
Yeah I'm just seeing the basics now, looks like it's not terribly hard
I've managed to skip most of the WPF generation (been working with WinForms for a ... very long time.)
Jumar Macato
@jmacato
May 30 2018 08:07
and when you get the hang of it, it'll be like magic :smile:
Adam Frisby
@AdamFrisby
May 30 2018 08:08
Thank you everyone. I'll be back when my dodgy hack inevitably causes more problems. ;)
Jumar Macato
@jmacato
May 30 2018 08:08
Goodluck :smile:
danwalmsley
@danwalmsley
May 30 2018 08:36
@AdamFrisby your problem isn't that the ui fails to invalidate its that the UI has no idea when your property has changed.
take a look at this example here which shows the correct way to update a property and ui
the really relevant portions of that code are:
Rayyan Tahir
@RayyanTahir
May 30 2018 08:55
@danwalmsley Can you please give this a look (I think there is an issue in style selectors):
The Checkmark doesn't show when checkbox is in checked state
danwalmsley
@danwalmsley
May 30 2018 09:12
just taking a look
@RayyanTahir btw you know that <Style x:Key="NewCheckBoxStyle
the x:Key isn't required
only for resources
danwalmsley
@danwalmsley
May 30 2018 09:21
I cant see any issue with the code
Rayyan Tahir
@RayyanTahir
May 30 2018 09:22
Yes I know that, it was written before you guided me about using UserControl.Styles instead of UserControl.Resources for styles, so before when I had it in Resources section the compiler was making me add a key. But now that its in the style tag its not necessary to add a key
Exactly, the code seemed alright to me too, but the problem is that the check mark won't show, the other path that is the square with top right corner cut shows well
danwalmsley
@danwalmsley
May 30 2018 09:23
yeah I think its probably a bug
I tried with latest nightly and changes something with rendering but doesn't work either
Rayyan Tahir
@RayyanTahir
May 30 2018 09:24
Can you add an issue for this?
danwalmsley
@danwalmsley
May 30 2018 09:24
I think we need an issue,
probably one for @grokys good that you have a simple repro
could you add one explaining what we discussed here and post the zip file you sent me
I think the issue is something like
"Style selectors not working in some cases"
Rayyan Tahir
@RayyanTahir
May 30 2018 09:27
Right, I'll add this now
Thank you
Manuel
@CommonGuy
May 30 2018 10:56
The contributors picture in the readme.md leads to a 404. Should it just link to the svg (so the avatars are clickable) or just fix the link?
Felipe
@ffquintella
May 30 2018 14:57
Hi guys
do any one know if avalonia has a daily build package somewhere ?
Wiesław Šoltés
@wieslawsoltes
May 30 2018 14:59
yes
Felipe
@ffquintella
May 30 2018 15:01
cool I was looking for that
need to test a new feature
thanks
:-)
CodeMyst
@CodeMyst
May 30 2018 15:12
Running an Avalonia app from windows using dotnet run works perfectly fine. But doing dotnet publish -c Release -r win-x64 and running it gives an error: libskiasharp.dll is missing
Wiesław Šoltés
@wieslawsoltes
May 30 2018 15:22
this is using CoreRT ?
this will probably not work as there are know issues with CoreRT
you can publish to win7-x64 for now
dotnet/corert#5776
as for error you are seeing you need to copy libskiasharp.dll manually when using CoreRT (at least for now)
CodeMyst
@CodeMyst
May 30 2018 15:26
Ah
Publishing to win7-x64 worked, but is there any way to hide the console window?
Wiesław Šoltés
@wieslawsoltes
May 30 2018 15:26
yes
CodeMyst
@CodeMyst
May 30 2018 15:30
Hmmm... I don't have the editbin.exe
in the 14.xxx.xxx folder I have just the lib folder
Wiesław Šoltés
@wieslawsoltes
May 30 2018 15:31
it comes with Visual Studio
CodeMyst
@CodeMyst
May 30 2018 15:33
Ah, looks like I need to install the C++ module
danwalmsley
@danwalmsley
May 30 2018 15:34
@CodeMyst you have to install the visual c++ development stuff from the visual studio installer
CodeMyst
@CodeMyst
May 30 2018 15:34
the timing... lol :P
danwalmsley
@danwalmsley
May 30 2018 15:34
lol :)
CodeMyst
@CodeMyst
May 30 2018 15:42
Thanks @wieslawsoltes @danwalmsley ! It works now :D
Jumar Macato
@jmacato
May 30 2018 16:24
@danwalmsley @wieslawsoltes i have a mini tool that modifies PE subsystem flag to hide cmd win without
editbin
Wiesław Šoltés
@wieslawsoltes
May 30 2018 16:24
do you have NuGet for it ?
so I can install it using Cake script
Jumar Macato
@jmacato
May 30 2018 16:25
@wieslawsoltes that's the problem, i was trying to make a msbuild task of it but i am not that well-versed with it
can you help me fix that?
Wiesław Šoltés
@wieslawsoltes
May 30 2018 16:25
with msbuild ?
Jumar Macato
@jmacato
May 30 2018 16:25
yes
Wiesław Šoltés
@wieslawsoltes
May 30 2018 16:25
no, not my expertise
Jumar Macato
@jmacato
May 30 2018 16:26
wait, i just got home, i'll upload the tool to a repo
jp2masa
@jp2masa
May 30 2018 16:26
maybe I can help
I have some experience with msbuild
Jumar Macato
@jmacato
May 30 2018 16:26
@jp2masa alright, brb
danwalmsley
@danwalmsley
May 30 2018 16:36
@jmacato @jkoritzinsky has done something similar with his SharpGenTools project
Jumar Macato
@jmacato
May 30 2018 16:41
@danwalmsley i'll take a look at that proj :D
@jp2masa please wait, i'm just digging up my old hdd for that tool
Jumar Macato
@jmacato
May 30 2018 17:08
@danwalmsley @jp2masa @wieslawsoltes please take a look https://github.com/jmacato/NSubsys
I wonder if that can be converted into a nuget package that you can just add and automatically does it post-build?
jp2masa
@jp2masa
May 30 2018 17:09
yes, it's possible
if you can target netstandard1.3 it's easier
Jumar Macato
@jmacato
May 30 2018 17:09
Neat!, i stopped development of it because i dont know how to do that part
alright
Marcin Golonka
@meron1122
May 30 2018 19:56
Hi! I want dynamic generate tic-tac toe grid - nothing special, NxN grid with border 1-2 pixels width fixed cell size(for example 50x50). How to achive in avalonia this?
I fight with this for two days and i dont have properly idea
danwalmsley
@danwalmsley
May 30 2018 19:59
@meron1122 there is a kind of demo app that does produce a kind of grid... like the one in this screen shot
source code is
Marcin Golonka
@meron1122
May 30 2018 20:01
@danwalmsley Thanks, i look tommorow on sources, but looks very fancy ;)
danwalmsley
@danwalmsley
May 30 2018 20:01
its a bit out of date so you may have to update things before it runs, but might give a good idea on how to make a dynamic grid
Steven Kirk
@grokys
May 30 2018 21:20
@meron1122 won't a simple <Grid> work for you?