These are chat archives for AvaloniaUI/Avalonia

19th
Nov 2018
Nikita Tsukanov
@kekekeks
Nov 19 2018 06:51
@grokys I was talking about a kind of direct properties but with inheritance support
Which you are doing manually in your PR
Which leads to inheritance only working at the time of ApplyTemplate
Steven Kirk
@grokys
Nov 19 2018 08:50
yeah we could probably add that if needed
but TemplatedParent is a special case just because it's read so many times
so i think it makes sense as it is. it seems that TemplatedParent in WPF works similarly - it's not an inherited property there either
Nikita Tsukanov
@kekekeks
Nov 19 2018 09:53
What happens if control gets added dynamically after ApplyTemplate?
Steven Kirk
@grokys
Nov 19 2018 10:35
then it won't be part of the template currently. that's usually what you want, e.g. for the content of a ContentPresenter
in fact we rely on this being the case in #2085. prior to #2085 we had to explicitly set the TemplatedParent to null on controls added dynamically
so the behavior in #2085 is actually what we want in 100% of our current cases (for dynamically added controls to not have TemplatedParent set)
if you did want the TemplatedParent set you can still set it though
Benedikt Schroeder
@Gillibald
Nov 19 2018 12:32
@danwalmsley You probably need to modify DrawingContextImpl.CreatePaint and the ConfigureTileBrush method. _dpi represents the current DPI. Hope that helps.
Nikita Tsukanov
@kekekeks
Nov 19 2018 12:42
I think I've found the culprit of our rendering artifacts
Sometimes UpdateScene gets called before the previous one was consumed
WTF
Timer was started exactly once
ahopper
@ahopper
Nov 19 2018 13:41
@Gillibald just updated to use the new TabControl and wondered what is the reason for putting the scrollviewer in the default template.
Benedikt Schroeder
@Gillibald
Nov 19 2018 14:09
@ahopper Don't know what made me do that. The scrollviewer makes no sense how it is defined. At least it should hold the content. We can remove that part from the template.
ahopper
@ahopper
Nov 19 2018 14:21
I'd vote for removing it, thanks.
Benedikt Schroeder
@Gillibald
Nov 19 2018 14:32
ahopper
@ahopper
Nov 19 2018 14:36
:+1:
Benedikt Schroeder
@Gillibald
Nov 19 2018 14:41
https://github.com/windows-toolkit/WindowsCommunityToolkit might be a good source of more advanced controls that are currently missing.
Steven Kirk
@grokys
Nov 19 2018 17:21
#2118 merged
Benedikt Schroeder
@Gillibald
Nov 19 2018 17:22

Should we avoid writing code like this?

if(condition)
    body

Instead of writeing something like this?

if(condition)
{
    body
}
I prefer the second one but at some places of the current code base people use the first one
Steven Kirk
@grokys
Nov 19 2018 17:24
i use the second one, but the corefx guidelines (which is what we decided to go by) afair say that both are acceptable if the body is a single line
Benedikt Schroeder
@Gillibald
Nov 19 2018 17:26
Ahh okay. StyleCop usualy complains about the first one I wonder how to allow the single line variant.
Nikita Tsukanov
@kekekeks
Nov 19 2018 17:40
if(cond1)
     if(cond2)
        doSomething();
else
    doSomethingElse();
Pure evil
Steven Kirk
@grokys
Nov 19 2018 17:42
yeah... don't do that!
jp2masa
@jp2masa
Nov 19 2018 19:08
I introduced a bug in this project because of that, I used to always use braces, but I saw that in many places it wasn't used, so I gave it a try, and I'll surely never try it again...
danwalmsley
@danwalmsley
Nov 19 2018 19:12
Im the same, I just always use braces, not like the world is going to run out of new lines, and leaves no ambiguity
Steven Kirk
@grokys
Nov 19 2018 19:41
i understand there's no danger of an ambiguous else though
Nikita Tsukanov
@kekekeks
Nov 19 2018 19:42
Just a scoped if statement, nothing interesting here
Steven Kirk
@grokys
Nov 19 2018 19:43
just the fact that it's nested and therefore not single line
tbh i'm not too bothered by it though
ahopper
@ahopper
Nov 19 2018 20:32
AvaloniaUI/Avalonia#2063 appears fixed, would #2117 have done that?
Nikita Tsukanov
@kekekeks
Nov 19 2018 20:38
I've surrounded all accesses to _scene with explicit locks
ahopper
@ahopper
Nov 19 2018 20:39
well I've stopped seeing those exceptions so :+1:
ahopper
@ahopper
Nov 19 2018 22:39
The new tab control does not inherit its parent's background, is this intended? I get the theme idea but many apps have more than one background.