These are chat archives for AvaloniaUI/Avalonia

2nd
Nov 2018
Nikita Tsukanov
@kekekeks
Nov 02 2018 05:13 UTC
@Gillibald layers are currently very expensive ein terms of memory
Benedikt Stebner
@Gillibald
Nov 02 2018 10:36 UTC
If you wanted to apply an effect just to the rendered content of an control you could just wrap that content inside an RenderTargetBitmap and pass that to an effect. The output of that effect is then being used as the rendereing of the control.
This would not include the drawings of child controls inside that control but still you could apply some effect. It would be better to redirect all drawing call of the control itself and ist children to that RenderTargetBitmap. Applying multible effect would involve a composite effect.
ahopper
@ahopper
Nov 02 2018 11:02 UTC
I've been looking at the :pointerover issue AvaloniaUI/Avalonia#1997 one problem is that MouseDevice can think the mouse is over a control that is no longer attached to the visual tree.
In looking to fix it I started wondering what happens if the screen content moves rather than the mouse. Is this allowed for currently?
Steven Kirk
@grokys
Nov 02 2018 11:12 UTC
@ahopper yeah i don't think we handle that currently - i seem to remember having a TODO in my head around that
ahopper
@ahopper
Nov 02 2018 11:12 UTC
Or should pointerover only happen if the pointer has been moved?
Steven Kirk
@grokys
Nov 02 2018 11:12 UTC
no, i think it should happen when the content changes
you might want to test with WPF/UWP
ahopper
@ahopper
Nov 02 2018 11:14 UTC
will do, will also think about an interim fix for the immediate problem as I suspect the full solution is quite involved
Steven Kirk
@grokys
Nov 02 2018 11:15 UTC
yeah, it might be
ahopper
@ahopper
Nov 02 2018 11:46 UTC
could create some interesting feedback like issues, say you mouseover something that triggers an animation that causes the animated thing to move from under the mouse then resets
Wiesław Šoltés
@wieslawsoltes
Nov 02 2018 11:58 UTC
dotnet_2018-11-02_12-58-10.png
working on ColorPicker control :smile:
WasntAFairFight
@wasntafairfight
Nov 02 2018 12:12 UTC
Is there a known issue with
Startup location "centerowner" for new windows? Launches to the right of parent. Not sure if I've broken something
ahopper
@ahopper
Nov 02 2018 12:14 UTC
@wieslawsoltes :+1:
Sorien
@Sorien
Nov 02 2018 13:12 UTC
guys, i'm getting build errors EVERY SECOND time i try to build avalonia net.core VS 15.8.8, anybody have same problem?
ahopper
@ahopper
Nov 02 2018 13:14 UTC
me to
vs 15.8.6
Steven Kirk
@grokys
Nov 02 2018 14:36 UTC
i thought that was just me, but yeah, i'm getting build errors too
danwalmsley
@danwalmsley
Nov 02 2018 14:40 UTC
@grokys most likely (without having looked into it) its to do with sharpgentools
Jeremy Koritzinsky
@jkoritzinsky
Nov 02 2018 16:18 UTC
What’s the errors you’re getting?
ahopper
@ahopper
Nov 02 2018 16:28 UTC
loads but the first is
9>------ Build started: Project: Avalonia, Configuration: Release Any CPU ------
9>Avalonia -> C:\Users\alan\Documents\GitHub\Avalonia\packages\Avalonia\bin\Release\netstandard2.0\Avalonia.dll
9>Avalonia.Base -> C:\Users\alan\Documents\GitHub\Avalonia\src\Avalonia.Base\bin\Release\netstandard2.0\Avalonia.Base.dll
sorry didn't copy properly
9>Avalonia.Base -> C:\Users\alan\Documents\GitHub\Avalonia\src\Avalonia.Base\bin\Release\netstandard2.0\Avalonia.Base.dll
9>ILayoutable.cs(4,16,4,26): error CS0234: The type or namespace name 'VisualTree' does not exist in the namespace 'Avalonia' (are you missing an assembly reference?)
Andrey Kunchev
@donandren
Nov 02 2018 17:14 UTC
I'm also getting lot of build errors, may be they are related to multitargeting (netcore and net461) DesktopRuntime project i'm getting errors starting from there, altough when i compie only DesktopRuntime project it builds fine
Sorien
@Sorien
Nov 02 2018 17:27 UTC
for me there is no error logged anywhere, just message dialog after build with "There were build errors..."
Jeremy Koritzinsky
@jkoritzinsky
Nov 02 2018 19:00 UTC
Weird... I’ll see if I can repro at home
ahopper
@ahopper
Nov 02 2018 19:06 UTC
I get the 2 builds issue with netcore controlCatalog and with my own project I have to cancel the first build as it goes on for longer than my patience but works on second go
jp2masa
@jp2masa
Nov 02 2018 19:37 UTC

I have an ItemTemplate for an ItemsControl which is basically a Button, like this:

<Button Command="{Binding MyCommand}"
        CommandParameter="{Binding MyModelData}" />

MyCommand is defined in the UserControl view model, while MyModelData is defined in the model, so everything works fine except binding to MyCommand as the default DataContext is the model, how should I fix this? I tried binding to $parent[UserControl].MyCommand, also tried binding to name #MyUserControl.MyCommand, but nothing seems to work...

should I just move the command to the model or is there a better option? any help would be appreciated

ahopper
@ahopper
Nov 02 2018 19:43 UTC
traditionally the datacontext is the viewmodel and often the model is a property of the viewmodel
jp2masa
@jp2masa
Nov 02 2018 19:44 UTC
in a data template, the data context is the object of the collection, in this case the model type which has the MyModelData property
but there's a command, MyCommand, which is defined in the view model, and I'm trying to bind to that command from the data template
ahopper
@ahopper
Nov 02 2018 19:51 UTC
$parent[somenumber].DataContext can work, i think there is a bug in getting the parent by name in a template
Andrey Kunchev
@donandren
Nov 02 2018 19:58 UTC
@jp2masa instead $parent[UserControl].MyCommand try $parent[UserControl].DataContext.MyCommand, same applies to #MyUserControl.MyCommand
jp2masa
@jp2masa
Nov 02 2018 19:59 UTC
oh right, that's probably the problem, I'll try it
still doesn't work...