These are chat archives for AvaloniaUI/Avalonia

26th
Aug 2016
Darnell Williams
@Seeker1437
Aug 26 2016 00:27
@kekekeks I couldn't find where rider lets people ad packages sources so I manually added them
Is there a way from rider?
Andrew
@zezba9000
Aug 26 2016 00:56
How do I set the "Image.Source" value programmatically?
Andrew
@zezba9000
Aug 26 2016 01:01
What is the filename syntax to load an embedded image just like I can do in xaml
In WPF I would do: "image = new Image(new Uri("pack://application:,,,/Image.png"));"
Andrew
@zezba9000
Aug 26 2016 01:20
So I have the Bitmap loading via "assembly.GetManifestResourceStream" but the image is not showing up.
public class FileItem
    {
        public Image icon;
        public Image Icon {get {return icon;}}

        public string filename;
        public string Filename {get {return filename;}}

        public FileItem()
        {
            filename = "ERROR";
        }

        public FileItem(string iconFilename, string filename)
        {
            icon = new Image();
            var assembly = System.Reflection.Assembly.GetExecutingAssembly();
            using (var stream = assembly.GetManifestResourceStream(iconFilename))
            {
                icon.Source = new Bitmap(stream);
            }

            this.filename = filename;
        }
    }
Then the DataTemplate:
<UserControl.DataTemplates>
        <DataTemplate DataType="self:FileItem">
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding Icon}" Width="24" Height="24"/>
                <TextBlock Text="{Binding Filename}" VerticalAlignment="Center">
                    <TextBlock.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Open file"/>
                            <MenuItem Header="Open file location"/>
                            <MenuItem Header="Revert file"/>
                        </ContextMenu>
                    </TextBlock.ContextMenu>
                </TextBlock>
            </StackPanel>
        </DataTemplate>
    </UserControl.DataTemplates>
And bound as such:
<ListBox Name="unstagedChangesListView" Margin="10,40,10,0" SelectionMode="Single" Background="White" ItemTemplate="{Binding FileItem}">
the file name is binding just fine
Weston
@ronnyek
Aug 26 2016 02:42
is there any chance of a netcore avalonia
or is it just too far different
Jeremy Koritzinsky
@jkoritzinsky
Aug 26 2016 06:22
@grokys I found a possible large memory perf improvement. Since the most common usage of bindings only has a single binding, we can have a lower-memory path that optimizes that scenario. Instead of always creating a dicitionary of PriorityLevels in a PriorityValue, we can lazily create the dictionary only when we have more than one PriorityLevel in a PriorityValue. It will add 4 bytes to each PriorityValue, but it will also remove (at least in my situation) around 1MB of memory in (just under 8,000 in the test that I found this in) dictionaries that only store one value.
If you want, I can prototype this and send in a PR for it.
Nikita Tsukanov
@kekekeks
Aug 26 2016 07:27
@ronnyek We are currently waiting for dependencies to be ported
@Seeker1437 Rider uses ~/.config/NuGet/NuGet.config
danwalmsley
@danwalmsley
Aug 26 2016 08:05
@jkoritzinsky wow, I bet that will help on AvalonStudio....
@jkoritzinsky yeah, that sounds like a good idea!
Nikita Tsukanov
@kekekeks
Aug 26 2016 08:45

@wieslawsoltes I'm getting

VERBOSE: Restoring tools from NuGet...
VERBOSE: Feeds used:
  C:\Users\keks\AppData\Local\NuGet\Cache
  C:\Users\keks\.nuget\packages\

Restoring NuGet package Cake.0.15.2.
WARNING: Unable to find version '0.15.2' of package 'Cake'.
  C:\Users\keks\AppData\Local\NuGet\Cache: Package 'Cake.0.15.2' is not found on source 'C:\Users\keks\AppData\Local\NuGet\Cache'.
  C:\Users\keks\.nuget\packages\: Package 'Cake.0.15.2' is not found on source 'C:\Users\keks\.nuget\packages\'.

on my machine

Any idea why it doesn't use proper package sources?
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 09:02
strange
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 09:44
@kekekeks To skip tests you can also do:
Task("Run-Unit-Tests")
    .IsDependentOn("Build")
    .WithCriteria(() => !skipTests)
    .Does(() =>
{
cake will skip automatically and inform about it in summary
or run only the build task .\build.ps1 -Target "Build"
Nikita Tsukanov
@kekekeks
Aug 26 2016 09:53
nuget packages depend on unit tests
Nikita Tsukanov
@kekekeks
Aug 26 2016 10:04
@jkoritzinsky merged splitted AppBuilder in master
The idea is that there is absolutely no point in running platform detection from PCL
And on mobile platforms
So you will have access to full .NET Framework API right in AppBuilderBase<T> constructor
I've also moved UsePlatformDetect from PCL for now, since it uses reflection to access OSVersion anyway
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 10:10

nuget packages depend on unit tests

This will not skip packages

"You can control and influence the flow of the build script execution by providing criteria. This is a predicate that has to be fulfilled for the task to execute. The criteria does not affect however succeeding task will be executed."

Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 10:53

@kekekeks To skip tests you can also do:

Task("Run-Unit-Tests")
    .IsDependentOn("Build")
    .WithCriteria(() => !skipTests)
    .Does(() =>
{

I have changed to this cake script, I suspect return; might cause mono compiler issues, as travisCI is failing

still failing :(
Nikita Tsukanov
@kekekeks
Aug 26 2016 10:59
Try to force enable roslyn
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 10:59
last try
if this does not solve will force roslyn
Nikita Tsukanov
@kekekeks
Aug 26 2016 11:01
BTW, you can use mono compiler on your windows machine
just pass -mono
It gives the same error
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 11:01
I had previously issue with mono, like when you use foreach in main script body
Nikita Tsukanov
@kekekeks
Aug 26 2016 11:02
weird
Well, I've got a lot of internal compiler errors with mono in the past
Darnell Williams
@Seeker1437
Aug 26 2016 11:21
@kekekeks Thanks. @danwalmsley AvalonStudio doesnt build in rider :( I think our post build step is not xplat
Nikita Tsukanov
@kekekeks
Aug 26 2016 11:25
BTW, I was unable to build avalonia with rider for some weird reason
Darnell Williams
@Seeker1437
Aug 26 2016 11:33
Yeah I wonder if they use a custom xbuild
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 11:40
@kekekeks Found the issue in build.cake causing failures.
The Select needed to use return statement
Nikita Tsukanov
@kekekeks
Aug 26 2016 11:43
wow
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 13:13
@kekekeks
/usr/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets:  warning : Reference 'System.Reactive.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL' not resolved
/usr/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets:  warning : Reference 'System.Reactive.Interfaces, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL' not resolved
/home/travis/build/AvaloniaUI/Avalonia/src/Shared/PlatformSupport/StandardRuntimePlatform.cs(5,14): error CS0234: The type or namespace name `Reactive' does not exist in the namespace `System'. Are you missing an assembly reference?
Nikita Tsukanov
@kekekeks
Aug 26 2016 13:51
Which project is that?
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 13:51
found the issue, will submit pr
Avalonia.DotNetFrameworkRuntime
the references are broken
Nikita Tsukanov
@kekekeks
Aug 26 2016 13:53
Weird
Wrong reference path?
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 13:53
yes
Nikita Tsukanov
@kekekeks
Aug 26 2016 13:53
I hope that we could switch to MSBuild there soon
Since it's open source now
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 13:54
they are close
Wiesław Šoltés
@wieslawsoltes
Aug 26 2016 14:09
CI builds fixed :)
Nikita Tsukanov
@kekekeks
Aug 26 2016 16:40
I hope to get embedding operational
So we could have a basic WebView