These are chat archives for AvaloniaUI/Avalonia

2nd
Jun 2018
Jeremy Koritzinsky
@jkoritzinsky
Jun 02 2018 03:25
@danwalmsley I took a stab at investigating #1641 and it won't be as easy to fix as I hoped...
danwalmsley
@danwalmsley
Jun 02 2018 08:50
If we change the key to ctrl +f12?
Maybe it will work again
Marcin Golonka
@meron1122
Jun 02 2018 11:32
Hi i want a define custom define data template using condition if(myClassInstance.Field == Enum.FieldType) In examples is only something like that(if(myClassInstace is MyClassType)) How to cover my scenario?
Benedikt Schroeder
@Gillibald
Jun 02 2018 12:06
@meron1122 Please have a look a this http://avaloniaui.net/docs/styles/selectors
Marcin Golonka
@meron1122
Jun 02 2018 12:33
@Gillibald Thanks, i look at this
Avalonia gives me a lot of hope to write GUI apps on Linux in C# but docs at this moment is terrible :<
Marcin Golonka
@meron1122
Jun 02 2018 13:07
@Gillibald i still confused how to define data template depends of child property enum :(
Can you provide sample?
Jumar Macato
@jmacato
Jun 02 2018 13:09
@meron1122 can you give us a clearer picture of the idea you're trying to do? :)
Marcin Golonka
@meron1122
Jun 02 2018 13:09
Okay, give me a second
Jumar Macato
@jmacato
Jun 02 2018 13:10
if there's an equivalent on WPF of the idea you're planning to do then please tell us :)
I want make a another template to field depends of enum property value
Jumar Macato
@jmacato
Jun 02 2018 13:16
okay thanks,
so basically for each values/fields in Players enum, you want to display a different picture in the ItemsControl
Marcin Golonka
@meron1122
Jun 02 2018 13:17
Exacly ;)
Jumar Macato
@jmacato
Jun 02 2018 13:19
Is this even possible with WPF?
It seems to be a bit of a roundabout way of doing it.. though i can't think of any alternatives to that at the moment
Marcin Golonka
@meron1122
Jun 02 2018 13:20
So the simplest way is remove Enum and make derritive classes depends of type of player?
Jumar Macato
@jmacato
Jun 02 2018 13:22
Yeah i think that's a simpler approach
Nelson Carrillo
@nc4rrillo
Jun 02 2018 13:22
you can use a value converter probably
to go from Enum -> Image
Jumar Macato
@jmacato
Jun 02 2018 13:22
or value converters, as @nc4rrillo said
Marcin Golonka
@meron1122
Jun 02 2018 13:42
I solved using derivative classes, thanks for support guys ;)
Jumar Macato
@jmacato
Jun 02 2018 13:44
Great! :D but for more flexibility, do try to make an value converter
but i guess Derived classes would be good enough for your use case :)
ahopper
@ahopper
Jun 02 2018 13:45
Another alternative is to make the image a property of the view model
Marcin Golonka
@meron1122
Jun 02 2018 13:47
In DataTemplate can i access to collection element Index?(Still example above)
Nelson Carrillo
@nc4rrillo
Jun 02 2018 16:32
@grokys if I'm understanding #1624 correctly, brushes must be turned into their immutable variants before hitting the render backend right? Shape.cs doesn't do this currently. Seems like a bug?
Jeremy Koritzinsky
@jkoritzinsky
Jun 02 2018 22:01
@nc4rrillo Looks like a bug to me too.
Jeremy Koritzinsky
@jkoritzinsky
Jun 02 2018 22:43
Hey I just took a look at our iPhone builds and the fonts look pretty bad. Not sure when that started happening, but we should probably take a look at that eventually.
On the bright side it doesn't look like we've broken anything recently. Control catalog still runs well on it
Nelson Carrillo
@nc4rrillo
Jun 02 2018 23:33
GeometryDrawing has the same bug
Maybe we can put an assertion in drawing context
Nelson Carrillo
@nc4rrillo
Jun 02 2018 23:44
Though it’d be nice to have a compile time type error instead.. since third party controls also use DrawingContext