These are chat archives for AvaloniaUI/Avalonia

11th
Aug 2017
Steven Kirk
@grokys
Aug 11 2017 10:09
in AvaloniaUI/Avalonia#1099, do the properties that it's not finding actually exist?
danwalmsley
@danwalmsley
Aug 11 2017 10:36
@grokys when we do this...
<Border Name='border2'> 
        <Button Name='button' Content='{Binding Name, RelativeSource={RelativeSource AncestorType=Border}}'/> 
      </Border>
does that mean content is bound to the Name property of the Border
or the Name property on Borders data context?
Steven Kirk
@grokys
Aug 11 2017 10:37
Name property of the Border
same as WPF there
danwalmsley
@danwalmsley
Aug 11 2017 10:38
ok cheers
and the border could be several levels higher in the tree
its just the first ancestor it finds that is a border?
Steven Kirk
@grokys
Aug 11 2017 10:41
yeah, if you want e.g. the second you'd specify AncestorLevel=2
danwalmsley
@danwalmsley
Aug 11 2017 10:43
is there a good one for just whatever the first ancestor is?
<StackPanel Orientation="Horizontal" Gap="4">
                  <local:LightingView  DataContext="{Binding LightingControllerG}" IsEnabled="{Binding DataContext.IsChecked, RelativeSource={RelativeSource AncestorType=StackPanel}}}" />
I have this,
but maybe there is RelativeSource=FirstAncestor?
or something equivalent
danwalmsley
@danwalmsley
Aug 11 2017 10:52
it works anyway
Steven Kirk
@grokys
Aug 11 2017 11:08
if you just want the visual parent, whatever it is, you could do AncestorType=Control
note that it works on the visual tree though, not the logical tree
so if you have your control in e.g. a ContentControl the parent is the ContentPresenter in the template, not the ContentControl itself
danwalmsley
@danwalmsley
Aug 11 2017 11:22
I was mainly interested because I found this didn't work...
example coming up
when visual studio gets its shit together
danwalmsley
@danwalmsley
Aug 11 2017 11:31
<CheckBox Name="Lock" IsChecked="{Binding IsLocked, Mode=TwoWay}" Content="Locked" />
            <StackPanel Orientation="Horizontal" Gap="4">
              <local:LightingView VerticalAlignment="Center" DataContext="{Binding LightingControllerH}" />
              <StackPanel Gap="4">
                <StackPanel Orientation="Horizontal" Gap="4">
                  <local:LightingView  DataContext="{Binding LightingControllerG}" IsEnabled="{Binding #Lock.IsChecked}" />
the #Binding doesn't seem to work in this case
Wiesław Šoltés
@wieslawsoltes
Aug 11 2017 12:06

in AvaloniaUI/Avalonia#1099, do the properties that it's not finding actually exist?

@grokys They exist, but on previous object that was data bound

Steven Kirk
@grokys
Aug 11 2017 12:07
so the DataContext was previously set to an object on which the properties exist and then was set to null?
@danwalmsley that's strange - it looks like Lock and LightingView should be both in the same name scope
ah, if LighingView is a UserControl it's a namescope itself, so the IsEnabled binding is probably looking for Lock there
this is a thing with XAML that i've not worked out yet
if you've got a UserControl and you set IsEnabled in the XAML for that usercontrol, then the bindings should look in the UserControl's name scope
if you set the binding on the UserControl outside its own XAML then it needs to look in the parent name scope
i have no idea how this works in WPF for example
Wiesław Šoltés
@wieslawsoltes
Aug 11 2017 12:28

so the DataContext was previously set to an object on which the properties exist and then was set to null?

@grokys No, it was changed to next item is list

Steven Kirk
@grokys
Aug 11 2017 12:29
ok so the properties that are reported as not found always exist?
Wiesław Šoltés
@wieslawsoltes
Aug 11 2017 12:29
yes
seems like binding errors come from dematerialized view from previous data template
Steven Kirk
@grokys
Aug 11 2017 12:31
hmm ok. it's strange because it looks like it has the object: Could not find CLR property 'SelectionStyle' on 'Core2D.Editor.Tools.GuideToolSettings'
so it's not like it's trying to bind to null and not finding the object
I have changed selected item from SelectionToolSettings to GuideToolSettings
Steven Kirk
@grokys
Aug 11 2017 12:37
ok, so SelectionStyle doesn't exist on GuideToolSettings ?
Wiesław Šoltés
@wieslawsoltes
Aug 11 2017 12:37
yes
Steven Kirk
@grokys
Aug 11 2017 12:37
but it's setting the DataContext of the previous view to the new selection when it shouldn't be
Wiesław Šoltés
@wieslawsoltes
Aug 11 2017 12:38
not sure if this is the case, as new data template is used
Steven Kirk
@grokys
Aug 11 2017 12:38
hmm, i'm going to need to try to create a unit test i think
Wiesław Šoltés
@wieslawsoltes
Aug 11 2017 12:39
just create two types and two data templates and binding to content template, than change content from first type to second
the type should have different properties
danwalmsley
@danwalmsley
Aug 11 2017 12:45

if you set the binding on the UserControl outside its own XAML then it needs to look in the parent name scope

should I add an issue about that?

Steven Kirk
@grokys
Aug 11 2017 12:52
@danwalmsley just added: AvaloniaUI/Avalonia#1100
danwalmsley
@danwalmsley
Aug 11 2017 13:07
thanks
how to I disable scenegraph rendering again
just want to see if it has effected something
@grokys
Steven Kirk
@grokys
Aug 11 2017 13:08
.UseWin32(deferredRendering : false)
danwalmsley
@danwalmsley
Aug 11 2017 13:10
thanks
yeah I think iv found a bug
doing a gif recorder now
scenegraph-bug.gif
can see some of the radio buttons get checked
danwalmsley
@danwalmsley
Aug 11 2017 13:15
but other dont
If I look in the dev tools ischecked is true for the ones that are not
showing as checked
Steven Kirk
@grokys
Aug 11 2017 13:16
sounds like AvaloniaUI/Avalonia#1096 ?
danwalmsley
@danwalmsley
Aug 11 2017 13:16
its not to do with deffered rendering, this happens on both renderers
Steven Kirk
@grokys
Aug 11 2017 13:16
is there a difference between netfx and netcore?
danwalmsley
@danwalmsley
Aug 11 2017 13:17
both the same
Steven Kirk
@grokys
Aug 11 2017 13:17
hmm ok
danwalmsley
@danwalmsley
Aug 11 2017 13:18
could be that it is the same bug, but that it isn't a framework issue
just gets masked for some other reason on full framework for @wieslawsoltes
Steven Kirk
@grokys
Aug 11 2017 13:19
yeah, that would probably make it easier to fix
danwalmsley
@danwalmsley
Aug 11 2017 13:19
definitely same behaviour on both
I don't have time now
but that application in screenshot
I will make a cut down version and send you it
to repro the issue
Steven Kirk
@grokys
Aug 11 2017 13:20
cool, could you add the as a comment to #1096 as sounds like they're at least related
Steven Kirk
@grokys
Aug 11 2017 16:47
man i would love to do some work on avalonia right now and try to fix your bugs but VS2017 really doesn't want me to
i think i'm going to have to halt development until 2017.3 is out: hopefully things might be fixed at that point
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 16:58
@grokys Any chance you've tried with the NCrunch extension turned off?
That might be interfacing badly with something and causing a perf issue.
Steven Kirk
@grokys
Aug 11 2017 16:59
yeah, it doesn't seem to be ncrunch
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 16:59
Weird...
Steven Kirk
@grokys
Aug 11 2017 16:59
after the last hang i killed the process and when i restarted VS told me it was xamarin that hung it that time
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:00
Odd. I don't know why your VS instance always seems to have problems. I haven't been able to replicate any issues quite as bad as yours on my VS installs.
Steven Kirk
@grokys
Aug 11 2017 17:00
but if you for example, add a nuget package, remove it, then switch to a different branch, does it hang for you?
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:00
I don't believe so, but give me a minute and I'll try it out.
Steven Kirk
@grokys
Aug 11 2017 17:01
just starting VS2017 again, let me see how long it takes for it to hang
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:02
I don't have Xamarin tooling installed on my work machine so I can't really check.
Steven Kirk
@grokys
Aug 11 2017 17:03
ah
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:03
I'll check it out after work on my personal machine next time I have time.
Steven Kirk
@grokys
Aug 11 2017 17:04
ok, started up and switched branches
it's now hung like this:
image.png
so i'd say it took me <1 min to make it hang
that's with ncrunch turned off
Steven Kirk
@grokys
Aug 11 2017 17:09
process explorer shows this:
image.png
WerFault.exe seems to be the only thing using CPU
event viewer shows this:
Faulting application name: devenv.exe, version: 15.0.26730.0, time stamp: 0x597e93b1
Faulting module name: mscorlib.ni.dll, version: 4.7.2102.0, time stamp: 0x59370fdb
Exception code: 0xc00000fd
Fault offset: 0x00b0ac23
Faulting process ID: 0x40e4
Faulting application start time: 0x01d312c36faf718b
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\Common7\IDE\devenv.exe
Faulting module path: C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\mscorlib\f12799647dc4f4abd2f0f17790337f04\mscorlib.ni.dll
Report ID: b06850d7-1cbd-4a25-b405-26414d028525
Faulting package full name: 
Faulting package-relative application ID:
maybe i need to wipe my windows installation
Steven Kirk
@grokys
Aug 11 2017 17:18
ok, it finally showed the "Visual Studio has crashed" or whatever message and restarted
and showed:
image.png
danwalmsley
@danwalmsley
Aug 11 2017 17:19
I thought you were using the 15.3 preview?
Steven Kirk
@grokys
Aug 11 2017 17:20
i am yeah
image.png
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:20
Did you report the crashes to MSFT?
danwalmsley
@danwalmsley
Aug 11 2017 17:21
In the log you posted it says devenv 15.0
Probably just vs printing wrong version number
Steven Kirk
@grokys
Aug 11 2017 17:21
hmm yeah interesting
@jkoritzinsky well the windows crash reporting tool ran so MS should have a dump of the crash
i've disabled xamarin so that might help, but i think there are other things causing hangs too, because that message has only just started to show
Steven Kirk
@grokys
Aug 11 2017 17:27
yeah that's a lot better actually
grr but now when i build i get:
image.png
why is it telling me that? i mean project.json is deprecated
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:36
The warning message is outdated. Just run NuGet restore and it should go away
Also when we move to netstandard2.0 we should combine our runtime platform assemblies into one assembly and integrate it into the rest of Avalonia.
Steven Kirk
@grokys
Aug 11 2017 17:40
i tried running dotnet restore and the problem remains
whenever i've hit this before i have to close VS, do a git clean -xdf to reset everything to its newly checked-out state and then it will compile again
but you see what i mean? it's just one thing after another, and i never manage to get any actual work done on avalonia
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:43
Yeah for some reason the restore files for NuGet aren't cleaned when you run a clean build or rebuild.
I don't know what it is with Avalonia, but we have so many issues with VS like all the time.
Steven Kirk
@grokys
Aug 11 2017 17:43
constantly
Steven Kirk
@grokys
Aug 11 2017 17:48
another example: on master my ncrunch looks like this:
image.png
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:48
Yeah.
Steven Kirk
@grokys
Aug 11 2017 17:49
and i rely on ncrunch, i can't really work without it, so i'm trying to fix it on the fixes/ncrunch-references branch
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:50
One thing we could do to simplify our load on VS would be to use SDK-style projects for all of our projects except for our iOS and Android sample applications. Using the MSBuildSdkExtras package we can do that easily.
Steven Kirk
@grokys
Aug 11 2017 17:50
i'm nearly there, after merging in @kekekeks's work on #1077 , but i have the problem that libskiasharp.dll isn't being copied to the output directory
yeah, i had to convert the render tests to SDK-style projects as part of this work, because for some reason old-style projects weren't working
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:51
SDK projects just in general are much nicer imo
Steven Kirk
@grokys
Aug 11 2017 17:51
so, there's an option in skiasharp to copy the dll
but to do that i have to include the skia sharp package in my project which i try to do here: https://github.com/AvaloniaUI/Avalonia/blob/fixes/ncrunch-references/tests/Avalonia.RenderTests/Avalonia.Skia.RenderTests.csproj#L11
but it just doesn't work!
i just get this:
image.png
what does that mean? why isn't it working?
how do i find that info out?
do you know?
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 17:56
I'm checking the targets file in SkiaSharp. I'll shoot you the link so you can also take a look
Have you tried having the render tests run on .NET Core instead of .NET Framework?
Also have you tried updating SkiaSharp to 1.59.1? That might fix whatever is going on
Steven Kirk
@grokys
Aug 11 2017 18:01
yeah tried both of those, neither worked, let me try again
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 18:01
.NET Core shouldn't require the dll to be copied.
Try moving the build dirs for the render tests to their own dirs so they aren't interfering with each other since we've disabled code coverage
Steven Kirk
@grokys
Aug 11 2017 18:02
here's what i get when i change the targetframework to netcoreapp1.1
image.png
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 18:03
So net core breaks nuget restore...
I have no idea what's going on and causing all of these issues
Did you restore after changing the target framework? Also if that doesn't work, try deleting the bin and obj directories and then rerun restore
Steven Kirk
@grokys
Aug 11 2017 18:05
well I'm relying on VS to restore, which i know it is doing as it hangs VS while it's doing it
if i run dotnet restore i get the project.json errors
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 18:06
The first error in the list is saying that restore wasn't run.
Steven Kirk
@grokys
Aug 11 2017 18:06
can you repro all this on that branch on your machine?
when i change the target framework, nuget restore definitely runs
Jeremy Koritzinsky
@jkoritzinsky
Aug 11 2017 18:14
Restore from Direct2D1 and from Cairo are overwriting the one from Skia and its freaking out.
There's an SDK property that we can use to put them in different folders. I'm trying to find it now
Add this as a property

    <RestoreOutputPath>obj-Skia</RestoreOutputPath>
Build works for me if I do that
And then add corresponding ones to the other render tests.
That with .NET Core successfully builds and restores
Steven Kirk
@grokys
Aug 11 2017 18:23
ah ok!
need to eat now, will try that shortly, thanks!
Nikita Tsukanov
@kekekeks
Aug 11 2017 20:24

i'm nearly there, after merging in @kekekeks's work on #1077 , but i have the problem that libskiasharp.dll isn't being copied to the output directory

that one would be the easiest to fix

<RestoreOutputPath>obj-Skia</RestoreOutputPath>

Wow

Well, interference between projects in the same dir should be expected
Steven Kirk
@grokys
Aug 11 2017 20:27
what do you think of https://github.com/AvaloniaUI/Avalonia/tree/fixes/ncrunch-references @kekekeks ? is it useful to you for getting #1077 working?
if you could get ShouldIncludeNativeSkiaSharp working it would be super useful to me
Nikita Tsukanov
@kekekeks
Aug 11 2017 20:34
I'd suggest to ignore targets from skiasharp package completely
And just copy manually using afterbuild task
I'll take a look tomorrow
  <Target Name="FixSkiaSharp" AfterTargets="Build">
    <Copy SourceFiles="$(NuGetPackageRoot)\skiasharp\$(SkiaSharpVersion)\runtimes\win7-x86\win7-x86\native\libSkiaSharp.dll" DestinationFolder="$(OutputPath)" />
  </Target>
Something like that
Steven Kirk
@grokys
Aug 11 2017 20:38
yeah i was thinking about that but i didn't want to duplicate the logic for detecting the platform
even after setting <RestoreOutputPath> i can't change the targetframework to netcoreapp1.1
i really wish there was a way of finding out what the error icons in the dependencies tree mean
Steven Kirk
@grokys
Aug 11 2017 20:43
looks like the errors should display in the error list dotnet/project-system#2653
but i can't see anything for that project in there
Nikita Tsukanov
@kekekeks
Aug 11 2017 21:17

yeah i was thinking about that but i didn't want to duplicate the logic for detecting the platform

that's the trick, we don't need to detect it

Just copy dll, dylib and so
Steven Kirk
@grokys
Aug 11 2017 21:32
ah.. ok
yeah that would make sense.
Steven Kirk
@grokys
Aug 11 2017 21:43
how do i get the paths to the dll, dylib and so?