These are chat archives for AvaloniaUI/Avalonia

2nd
Aug 2017
EinApfelBaum
@EinApfelBaum
Aug 02 2017 05:31
@chegeras thanks, this works. =) Then the one answer on Stackoverflow was okay.
danwalmsley
@danwalmsley
Aug 02 2017 12:57
@grokys you around, I may have noticed a fault in scenegraph
if I call InvalidateVisual on a control
it seems that it doesn't mark child visuals as dirty
Steven Kirk
@grokys
Aug 02 2017 13:00
yeah, it shouldn't
hey
that seems to be a change of behaviour from before?
Steven Kirk
@grokys
Aug 02 2017 13:00
i'm in a meeting, but around
i don't think so
danwalmsley
@danwalmsley
Aug 02 2017 13:01
ok, I will try without scenegraph and see if my issue goes away or not :)
danwalmsley
@danwalmsley
Aug 02 2017 13:16
there is definitely a change in behaviour, if its exactly as I describe I couldn't be sure
here is what I am seeing...
[master]
invalidate-master.gif
[scenegraph]
invalidate-scenegraph.gif
the difference is the breakpoint isn't being redrawn
InvalidateVisual();

                /*foreach(var margin in LeftMargins)
                {
                    margin.InvalidateVisual();
                }*/
I can fix it by uncommenting the code above( all the margin controls are visual children)
danwalmsley
@danwalmsley
Aug 02 2017 13:21
of the main editor
and this code would be called when ILogicalSrollable.Offset is set
I think the answer is that its correct on scenegraph, and that master redraw the whole scene on any invalidation?
would you agree with that?
Nikita Tsukanov
@kekekeks
Aug 02 2017 13:23
Check how WPF handles that
I don't think that it invalidates all child visuals
danwalmsley
@danwalmsley
Aug 02 2017 13:24
however with immediate renderer, if you invalidate any visual in the scene
it will redraw everything anyway correct?
so looks like this was a bug in my code, but was hidden because of immediate renderer
Nikita Tsukanov
@kekekeks
Aug 02 2017 13:29
Immediate renderer always renders the whole window
Steven Kirk
@grokys
Aug 02 2017 13:59
yep, i think it was a bug masked by the immediate renderer redrawing everything
Nikita Tsukanov
@kekekeks
Aug 02 2017 14:00
I'm not sure that invalidating all children is the correct behavior
aesebu55
@aesebu55
Aug 02 2017 14:53
Hi, sorry if I'm in the wrong place. If this room strictly for devs or can I ask questions isn here?
Avalonia devs*
danwalmsley
@danwalmsley
Aug 02 2017 15:01
fire away :)
aesebu55
@aesebu55
Aug 02 2017 15:23
Ok, I apologize if this is documented already and I missed it, but should LinearGradientBrush be working? I don't get any errors when I try to use it but I don't get any sort of representation of a brush on the screen
Nikita Tsukanov
@kekekeks
Aug 02 2017 15:24
It worked last time we've checked
danwalmsley
@danwalmsley
Aug 02 2017 15:25
can you post the code you have used?
Nikita Tsukanov
@kekekeks
Aug 02 2017 15:27
There were some issues with inconsistency between Skia and Direct2D
That should work
aesebu55
@aesebu55
Aug 02 2017 15:27
sure, i'm playing around with the CanvasPage xaml. All I'm doing is trying to change the fill for the Rectangle to LinearGradientBrush
  <Rectangle Width="63" Height="41" Canvas.Left="40" Canvas.Top="31">
    <Rectangle.Fill>
      <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
        <LinearGradientBrush.GradientStops>
          <GradientStop Offset="0" Color="Black"/>
          <GradientStop Offset="1" Color="Grey"/>
        </LinearGradientBrush.GradientStops>
      </LinearGradientBrush>
    </Rectangle.Fill>
      </Rectangle>
The rectangle disappears
Nikita Tsukanov
@kekekeks
Aug 02 2017 15:29
Check the actual brush parameters in debugger
I suspect that something is wrong with Start/EndPoint
aesebu55
@aesebu55
Aug 02 2017 15:36
working on it, haha. shouldn't be hard but I named it in the xaml, set a break point on code behind and set a watch for it and didn't work, trying to figure out what I'm doing wrong. is the a load event I can listen to find the instance of the Rectangle?
sorry, loaded event*
Nikita Tsukanov
@kekekeks
Aug 02 2017 15:40
try to use FindControl after loading xaml
this.FindControl<Rectangle>("Name");
danwalmsley
@danwalmsley
Aug 02 2017 15:42
@aesebu55 override OnTemplateApplied
and put @kekekeks code in there
aesebu55
@aesebu55
Aug 02 2017 15:42
oh, nice, thanks
danwalmsley
@danwalmsley
Aug 02 2017 15:42
also change XAML to <Rectangle Name="MyRectangle"
and obviously FindControl<Rectangle>("MyRectangle")
aesebu55
@aesebu55
Aug 02 2017 15:44
can you tell me the namespace for rectangle?
it's complaining in the code behind
danwalmsley
@danwalmsley
Aug 02 2017 15:44
avalonia.controls.shapes
to find that you can go here:
press T on keyboard
and type "Rectangle"
then click Rectangle.cs
usually quickest way to find namespace
aesebu55
@aesebu55
Aug 02 2017 15:45
ok, looking a the rectangle in the debugger, also, thanks for that tip!!
danwalmsley
@danwalmsley
Aug 02 2017 15:45
or if your using visual studio press Control + .
no problem
aesebu55
@aesebu55
Aug 02 2017 15:46
hmm, the gradients stops count is 0
startpoint and endpoint look right
danwalmsley
@danwalmsley
Aug 02 2017 15:47
@kekekeks gradient stops count 0?
Nikita Tsukanov
@kekekeks
Aug 02 2017 15:48
@aesebu55 are you using version from nuget or from myget?
danwalmsley
@danwalmsley
Aug 02 2017 15:48
@aesebu55 if not use this
to upgrade to latest builds
Nikita Tsukanov
@kekekeks
Aug 02 2017 15:49
There was a major change in xaml loading infrastructure recently
aesebu55
@aesebu55
Aug 02 2017 15:49
nuget
danwalmsley
@danwalmsley
Aug 02 2017 15:50
switch to the nightly feed until the next release!
aesebu55
@aesebu55
Aug 02 2017 15:50
ok, i'll upgrade and let you know
thanks
will do
danwalmsley
@danwalmsley
Aug 02 2017 15:50
(its much faster anyway)
aesebu55
@aesebu55
Aug 02 2017 15:50
oh, nice
btw, great job on this
it's been a nightmare trying to use InterfaceBuilder on Mac. I'm probably doing it wrong, but it just seems like an insane amount of work to make a decent GUI
danwalmsley
@danwalmsley
Aug 02 2017 15:55

it's been a nightmare trying to use InterfaceBuilder on Mac. I'm probably doing it wrong, but it just seems like an insane amount of work to make a decent GUI

So glad you said that!

Nikita Tsukanov
@kekekeks
Aug 02 2017 15:56
While cocoa widgets themselves and rendering system have quite decent quality
Cocoa as a framework is stuck somewhere on WinForms level
aesebu55
@aesebu55
Aug 02 2017 15:58
Exactly.
It's hard to go back after using WPF
danwalmsley
@danwalmsley
Aug 02 2017 22:34
image.png
@grokys can now fully open all avalonia projects!
Steven Kirk
@grokys
Aug 02 2017 22:35
wow!
looking forward to using avalonstudio for avalonia development then ;)
'cos VS2017 is still slow as shit
danwalmsley
@danwalmsley
Aug 02 2017 22:52
I'm sure its missing lots of features
but I'm hoping to integrate @kekekeks Avalonia.IDE work soon
so might be nice to have a basic template and previewer with XAML highlighting and intellisense
for people on Linux and mac
Steven Kirk
@grokys
Aug 02 2017 22:54
would be amazing
danwalmsley
@danwalmsley
Aug 02 2017 22:54
I got a lot of help from the omnisharp guys
helping me understand how Roslyn works
but now they are asking me why I don't just use omnisharp, instead of integrating directly with Roslyn, not sure what to tell them
main reason is to not have the limitations that vscode has
and to have tight project system integration
kind of feel bad not using it, all the advice they gave me
Steven Kirk
@grokys
Aug 02 2017 22:56
well omnisharp just exposes roslyn doesn't it?
if you can go direct to roslyn, why go via omnisharp?
danwalmsley
@danwalmsley
Aug 02 2017 22:58
its great, and I did integrate with it originally, but came across difficulties, like showing project load progress, and getting project meta data, your stuck to just the bits they exposed, and I'm sure there is a bit of a delay incurred in talking to an out of process server
getting scenegraph ready?
Steven Kirk
@grokys
Aug 02 2017 23:48
yeah i think it's just about there