These are chat archives for AvaloniaUI/Avalonia

8th
Apr 2018
James Burnside
@JCBurnside
Apr 08 2018 01:04
image.png
hmmm...
James Burnside
@JCBurnside
Apr 08 2018 01:32
ah it was a namespace issue
Jumar Macato
@jmacato
Apr 08 2018 02:10
@wieslawsoltes awesome, so it was on CoreRT's end after all
i will try my animations render test sample to coreRT to see if theres any difference in performance
Wiesław Šoltés
@wieslawsoltes
Apr 08 2018 05:17
dotnet/corert#5661
se5a
@se5a
Apr 08 2018 07:21
ok so updating an older Avalonia project doesnt' work. had to make sure I'd updated then created a new project.
got it working on linux now anyway.
se5a
@se5a
Apr 08 2018 07:35
or not
with <TargetFramework>net461</TargetFramework> the same error pops up
No rendering subsystem found. Are you missing assembly references?
ahopper
@ahopper
Apr 08 2018 07:37
you need to use .netcore on linux
se5a
@se5a
Apr 08 2018 07:44
all the other projects are .net
which I need to reference
so I either change everything to .netcore or abandon the idea of avalonia?
lindexi
@lindexi
Apr 08 2018 08:11
Can we use telegram ?
ahopper
@ahopper
Apr 08 2018 08:41
@se5a I could be wrong,
se5a
@se5a
Apr 08 2018 09:14
is that a recent change? it worked with an older version of avalonia
Wiesław Šoltés
@wieslawsoltes
Apr 08 2018 12:40
@danwalmsley I tested default publish (release mode) and CoreRT debug publish, and I must say the CoreRT feels bit slower. https://ci.appveyor.com/project/wieslawsoltes/draw2d/build/401/artifacts
You can open the container.json in my app and select all shapes, try dragging them around.
danwalmsley
@danwalmsley
Apr 08 2018 18:09
@se5a you should change your projects to netstandard that way they are compatible. With full. Net and
Net core
Doug Swain
@pseudoramble
Apr 08 2018 18:15
have a pretty noob question. is it possible to bind to properties on the Window DataContext when using something like ItemsControl?
i'm using ItemTemplate to describe what each item in the control should look like, and it looks like it binds to each individual item. however i want it so that when you click on the item it triggers a method on the ViewModel i have set up
here's the XAML:
        <ItemsControl Items="{Binding Stories}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button 
                        Content="{Binding Title}"
                        Command="{Binding OnStoryClicked}"
                        CommandParameter="{Binding URL}" />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
all of that works except it seems like the command itself isn't being bound
DmitryZhelnin
@DmitryZhelnin
Apr 08 2018 18:21
@pseudoramble you can try
Command="{Binding $parent[ItemsControl].DataContext.OnStoryClicked}"
Doug Swain
@pseudoramble
Apr 08 2018 18:26
oh wow i didn't realize you could access properties directly in the binding
i noticed $parent earlier but i didn't think i could use it here
DmitryZhelnin
@DmitryZhelnin
Apr 08 2018 18:27
Doug Swain
@pseudoramble
Apr 08 2018 18:27
yeah, exactly. i was reading that earlier. however it didn't occur to me that ItemsControl would still have the DataBinding that i would want
but that makes more sense to me now
thanks for the tip @DmitryZhelnin
Steven Kirk
@grokys
Apr 08 2018 18:38
@pseudoramble is there anything we should make clearer in the docs?
Doug Swain
@pseudoramble
Apr 08 2018 18:40
good question. not sure exactly. i'll re-read it and let you know
i'm also brand new to just about everything i'm doing right now. there's a good chance i just don't have the mental model
Steven Kirk
@grokys
Apr 08 2018 18:41
sure! let me know though if there's something i've missed. the docs are still in a pretty early stage
Doug Swain
@pseudoramble
Apr 08 2018 18:42
actually though, there was an error that was giving me some trouble early on. i figured out what it was eventually, but i think there may be room to clarify it
the scenario was something like this:
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <TextBlock>Hi</TextBlock>
      <Button>Click</Button>
</Window>
and the error from running that i got was this:
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Portable.Xaml.XamlDuplicateMemberException: Property '{clr-namespace:Avalonia.Controls;assembly=Avalonia.Controls}ContentControl.Content' is already set to this '{clr-namespace:Avalonia.Controls;assembly=Avalonia.Controls}Window' object
if i understand it right, it's just that the Window object can only contain one child, so you need a container to do multiple ones
Steven Kirk
@grokys
Apr 08 2018 18:50
yeah... our XAML errors suck at the moment
i'm not sure if it's portable.xaml or our code that's causing it
but i'm not very familiar with our XAML stuff so i had a hard time trying to work it out last time i tried
Doug Swain
@pseudoramble
Apr 08 2018 18:51
ah gotcha. well this is the first time i've written XAML. so i'm none the wiser :)
se5a
@se5a
Apr 08 2018 18:55
@danwalmsley got a link on how to do that? I noticed the avalonia csproj file was a somewhat different format than my other csproj files, is that what you mean? I tried changing the avalonia project to .net as per the docs to 462?iirc and was getting that error.
Steven Kirk
@grokys
Apr 08 2018 18:57
@se5a i've not been following your problem closely but does this help? https://www.natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/
the changes to the csproj format are apart from avalonia, they apply to many types of projects so there's lots of info out there
but unfortunately it's kinda spread out over various places
se5a
@se5a
Apr 08 2018 19:02
Maybe. If thats what @danwalmsley was meaning. I was getting it to compile, it just crashed at run-time.
danwalmsley
@danwalmsley
Apr 08 2018 19:29
@se5a you should adopt the new project format and netstandard where possible
netstandard2.0 is largely compatible with net461 now
there is a compatiblity table here:
migrating to the new format is fairly easy, im not sure there is an automatic way to do it in visual studio though