These are chat archives for AvaloniaUI/Avalonia

27th
Aug 2018
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 00:30
Docs are online for me
Steven Kirk
@grokys
Aug 27 2018 07:12
they seem to be working now at least
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 07:14
I have a question about AnimationKeyFrame and bindings within setters - is the {RelativeSource Self} referring to AnimationKeyFrame instead of the TargetControl a feature or a bug?
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 15:36
That's expected behavior but is probably a bug.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 16:21
Ok, the fix isn't complex, but would require either extracting the contents of AvaloniaObject.Bind, or creating a separate method that initiates the binding on TargetControl and applies it on AnimatorKeyFrame, what approach, in your opinion, would be best?
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 16:53
The fix would be for RelativeSource bindings to use the anchor parameter instead of the object parameter as "Self"
In the case that the object parameter isn't a StyledElement
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 16:57
True, but the binding is a much broader concept, and this would break some valid edge cases in the visual/logical tree
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 16:58
What do you mean?
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 16:58
Other situations (ElementName,FindAncestor) do require the element to be a part of the visual/logical tree
but I could imagine cases where other elements might have some use for a Self binding
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 16:59
My suggestion would actually bring RelativeSourceMode.Self in line with the rest of the RelativeSourceModes in how they resolve their target
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:00
ok, that would make it even simpler, but I'm always afraid of https://xkcd.com/1172/
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:00
See Binding.cs lines 153, 157, and 169
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:00
yeah, I considered changing that
after learning of the wonderful trick with copying the debug result to .nuget cache I do go deep before asking
by the way, that script also could use a fix, I'll include it with the PR
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:01
Everything in the Logical and Visual trees is an IStyledElement. Anything that isn't an IStyledElement wouldn't even have a Data Context member.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:01
or do you want two separate PRs?
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:02
Two please 😊 makes it easier to review and get the changes in quicker if one needs some changes.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:02
But it could have AvaloniaProperties, which is enough for Self binding to work
ok, sure - I'll have to do some branching, but I can manage
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:04
Yeah I could see that. But those objects would have to be deriving directly from either AvaloniaObject or Animatible.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:05
A random example - converters
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:05
Also changing line 153 would bring it in line with binding paths that use $self.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:05
ah, this makes it more justified then
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:06
The shorthand uses the same rules as the rest of the modes.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:06
Avalonia is multi-targeted, but there might be some edge cases where those issues apply
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:08
Yeah I saw Immos tweet. We only target netstandard right now but we should truly multitarget to avoid possible issues. I'm working on some MSBuild magic to be able to build our packages via the MSBuild Pack target right now so you don't need to worry.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:09
wouldn't project based multi-targeting be enough?
One more question about the Binding.cs fix - the same method (CreateSourceObserver) is used for both RelativeSource=Self, and a "Source" binding member, which I must admit I haven't seen previously - is it used anywhere besides tests?
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:15
It's available in WPF so we have it for compatibility. It also makes testing sometimes easier to set up.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:17
Ah, ok then - didn't delve that deep into WPF, so never saw it there
The joy of open source.
another aside - could you kick the verification for AvaloniaUI/AvaloniaEdit#61 ? it seems to be stuck
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:18
I'll take a look. Might be a bit before I have a chance though. I'm pretty busy today. Barely have time for gitter hahaha
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:19
no problem, it's not a critical issue, so I'm not anxious for it to be fixed
as for packing .nugets - I had a very good results with dotnet pack - https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 17:24
Yeah I prefer using the cli/msbuild. However, the Avalonia package is an aggregate of our core libraries. So I need to mess with how the dotnet sdk does the packing.
I've got it working pretty well so far with only one missing feature in the dotnet/sdk repo that breaks one scenario that we can work around.
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 17:28
Ah, fair enough
danwalmsley
@danwalmsley
Aug 27 2018 18:13
@WojciechKrysiak im usually the one responsible for avaloniaedit stuff, so you can ping me next time, ill get it merged in
@WojciechKrysiak with that handled fix, what was the issue you were seeing that triggered you to fix it
WojciechKrysiak
@WojciechKrysiak
Aug 27 2018 18:20
@danwalmsley My project uses AvaloniaEdit as a merge control, so I use the ContextMenu heavily in there
and without the right click working, the context menu wasn't showing
Sergey Khabibullin
@x2bool
Aug 27 2018 18:26
Hi! Any ideas how to draw circular images in Avalonia? I tried to use Ellipse and ImageBrush but always failed to get size right. I tried to tweak SourceRect and DestRect back and forth but it didn't help. Usually only top left quarter of the image gets rendered. Could someone help me?
<Ellipse Height="100" Width="100">
    <Ellipse.Fill>
        <ImageBrush ImageSource="YourImage.png"/>
    </Ellipse.Fill>
</Ellipse>
Benedikt Schroeder
@Gillibald
Aug 27 2018 18:37
 <Ellipse Height="100" Width="100">
    <Ellipse.Fill>
        <ImageBrush Stretch="UniformToFill" Source="YourImage.png"/>
    </Ellipse.Fill>
</Ellipse>
Steven Kirk
@grokys
Aug 27 2018 21:04
hey @stanleygoldman
Stanley Goldman
@StanleyGoldman
Aug 27 2018 21:04
yo
are you able to produce the .binlog file in your build process?
Steven Kirk
@grokys
Aug 27 2018 21:05
so yeah @jkoritzinsky just suggested using your MSBuildLogOctokitChecker
oops
too late
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 21:05
Yeah we can. We aren't at the moment but we could add that.
Stanley Goldman
@StanleyGoldman
Aug 27 2018 21:06
cool, that would be the only thing that you need to do, are you build on AppVeyor?
Steven Kirk
@grokys
Aug 27 2018 21:06
@StanleyGoldman what state is the tool in? is there still the limit on the # of annotations?
Stanley Goldman
@StanleyGoldman
Aug 27 2018 21:06
there might be some upperbound limit on annotations in GitHub
but I don't have an upperbound
Steven Kirk
@grokys
Aug 27 2018 21:06
i just thought i remember you saying there was a limit
Stanley Goldman
@StanleyGoldman
Aug 27 2018 21:06
we got that bug fixed
Steven Kirk
@grokys
Aug 27 2018 21:06
ahh ok
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 21:07
Yeah we build on Appveyor
Stanley Goldman
@StanleyGoldman
Aug 27 2018 21:07
okay, cool, would you mind letting me know if my setup instructions make sense?
  1. Add the GitHub App to your repository
  2. Create a token for the repository
  3. Add the powershell script to your repository
  4. Use the script in your AppVeyor script
but if you don't mind going through the steps, i'm here to help when you get stuck
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 21:12
Yeah those instructions make sense.
I think I'll add this in when I do our next build system cleanup (hopefully coming soonish)
Steven Kirk
@grokys
Aug 27 2018 21:13
i would try but i'm not really that familiar with our build system (embarrassing I know)
maybe i should learn
Stanley Goldman
@StanleyGoldman
Aug 27 2018 21:14
if it's appveyor i can handle it, i just need someone to encrypt the token for me
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 21:14
I'm a little busy right now (packing to move for my new job with MSFT actually)
Steven Kirk
@grokys
Aug 27 2018 21:14
ooh congrats! what will you be working on?
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 21:15
.NET Runtime!
Steven Kirk
@grokys
Aug 27 2018 21:16
super cool!
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 21:16
I'll be focusing on interop and enabling 3rd party interop tools (like SharpGenTools).
I'm really looking forward to it!
Steven Kirk
@grokys
Aug 27 2018 21:17
oh, and maybe x-plat WPF resource generation? ;)
anyway, i'll submit a PR adding the tool tomorrow
with @StanleyGoldman's help ;)
Jeremy Koritzinsky
@jkoritzinsky
Aug 27 2018 21:17
You never know 😉
Steven Kirk
@grokys
Aug 27 2018 21:18
that would be awesome for avalonia ;)
anyway, the tool will be a good test for GHfVS's checks API support so win-win i think
we're a pretty big repository so it might be a good stress test