These are chat archives for AvaloniaUI/Avalonia

8th
Feb 2017
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:02
Meh, it's probably easier to implement custom font loader
danwalmsley
@danwalmsley
Feb 08 2017 00:03
@kekekeks can you explain that fallback target for nugget packages again
Package Splat 1.6.2 is not compatible with netstandard1.4 (.NETStandard,Version=v1.4). Package Splat 1.6.2 supports:
  - monoandroid (MonoAndroid,Version=v0.0)
  - monomac (MonoMac,Version=v0.0)
  - monotouch (MonoTouch,Version=v0.0)
  - net45 (.NETFramework,Version=v4.5)
  - netcore45 (.NETCore,Version=v4.5)
  - portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
  - portable-win81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile32)
  - wp8 (WindowsPhone,Version=v8.0)
  - xamarinios10 (Xamarin.iOS,Version=v1.0)
  - xamarinmac10 (Xamarin.Mac,Version=v1.0)
One or more packages are incompatible with .NETStandard,Version=v1.4.
Package restore failed. Rolling back package changes for 'Mabiavalon.DockNC.Standard'.
<PackageTargetFallback> $(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback >
But in your case
Just update package reference to more recent version
danwalmsley
@danwalmsley
Feb 08 2017 00:06
this is for a different project
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:07
Just reference Splat 2.0.0 and you'll be OK
@grokys @jkoritzinsky anyone wants to check #883 or I'll just merge it right away?
danwalmsley
@danwalmsley
Feb 08 2017 00:09
but its trying to install avalonia I get that
in a netstandard project
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard1.4</TargetFramework>
    <PackageTargetFallback> $(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback >
  </PropertyGroup>



  <ItemGroup>
    <None Remove="Themes\Controls.paml" />
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Include="Themes\Controls.paml" />
  </ItemGroup>

</Project>
this didn't work
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:09
That's because we aren't targeting netstandard yet
Because of reasons
danwalmsley
@danwalmsley
Feb 08 2017 00:10
hmm ok
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:10
So you need to add references to Splat 2.0.0 and Serilog 2.3.0 manually
Basically, what's happening is that your project references PCL7 version of Avalonia
danwalmsley
@danwalmsley
Feb 08 2017 00:10
we cant upgrade avalonia to splat 2 ?
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:11
Which it turn references Splat 1.6.2
Oh, we can
But then we'll lose the ability to build against PCL Profile7
Since Splat 2.0.0 doesn't support that anymore
danwalmsley
@danwalmsley
Feb 08 2017 00:11
ah man
don't you feel like there are too many of these things now
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:11
We are in some kind of version limbo
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 00:12
@kekekeks I'll merge your PR once the CI build passes again.
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:12
thanks
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 00:12
Also: are we planning on moving to .net standard once VS 2017 comes out?
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:12
Almost certainly
There is no point not to
danwalmsley
@danwalmsley
Feb 08 2017 00:12
I still cant install avalonia into the project :(
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:14
@danwalmsley I could try and add netstandard1.1 target or something, but I'm not sure that it won't break anything
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 00:15
Yeah i was having a lot of issues getting PCL references to resolve from .net standard assemblies for a while on AvaloniaAV. Eventually temporarily dropped the feature
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:15
The trick is to lie to the package manager
and ship PCL7 assemblies for your target
Since compiler kinda knows what to do with them
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 00:17
I was able to get the packages to install, but the compiler wasn't resolving the types within them.
Nikita Tsukanov
@kekekeks
Feb 08 2017 00:17
ouch
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 00:17
Yep. Kinda hard to build a .net standard reference assembly when none of your types resolve.
danwalmsley
@danwalmsley
Feb 08 2017 01:18
@grokys
<Grid.ContextMenu>
                    <ContextMenu Items="{Binding BaseTemplates}" Name="menu">
                        <ContextMenu.ItemTemplate>
                            <DataTemplate>
                                <MenuItem Header="{Binding Name}" Command="{Binding.AddFindingCommand}"  CommandParameter="{Binding Id}" Margin="5" />
                            </DataTemplate>
                        </ContextMenu.ItemTemplate>
                    </ContextMenu>
                </Grid.ContextMenu
in the code above
how can I make Command={Binding AddFindingCommand}
get bound to the DataContext of ContextMenu
not the MenuItems DataContext?
Nikita Tsukanov
@kekekeks
Feb 08 2017 08:09
I think we have RelativeSouce implemented already
At least I remember implementing AncestorFinder class
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:06
on automation support for avalonia: getting really frightening thoughts on how to get it working:
use a remote machine, vnc into it and take screen snapshots :)
then compare those
Johan Larsson
@JohanLarsson
Feb 08 2017 09:10
@ivan-danilov do you have ideas on how you would write UI automation?
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:12
I think sending events to visuals should be enough
At least that's how it works in unit tests
Somewhat like that
Johan Larsson
@JohanLarsson
Feb 08 2017 09:15
oh, that looks pretty nice
is there a way to fetch a control from a running app?
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:16
From another process or from the current one?
Johan Larsson
@JohanLarsson
Feb 08 2017 09:17
I mean the test starts a demo app and then gets a control to test.
Guess it means other process.
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:18
What are you trying to achieve this way? I don't get it
Do you want to write UI tests?
Johan Larsson
@JohanLarsson
Feb 08 2017 09:18
Not trying anything at the moment, just curious.
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:19
For UI tests it's probably worth to create some kind of headless windowing platform
That will allow easy access to the current list of "on-screen" (well, actually, off-screen, but on-screen from application's point of view) toplevels
BTW, I was thinking about some kind of "remote display" windowing platform
that will just emulate some kind of framebuffer and listen for VNC protocol connections on a local port
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:26
@kekekeks I'd suggest implemening the webdriver protocol or something.
everybody knows they need interactive session to do ui tests
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:27
So it will be basically selenium
hm
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:27
yes, but that's pretty much a standard
MS also released a webdriver implementation for windows automation
it's a bit of a sweetspot (imo) between effort needed on avalonia side, and of surrounding tooling
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:28
Well, that could be implemented as a separate lib
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:28
yes
not sure if i miss something in the big picture though
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:29
The only thing that it needs from the main codebase is the list of toplevels
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:29
it would be a lib hooking into the live app?
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:29
Live app should reference that lib
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:30
ok, makes sense
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:30
And initialize it with AppBuilder or something
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:30
only thing I don't like with that setup, is that the live app references the test infra
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:31
Well, you can have a separate runner
with custom appbuilder setup
Steven Kirk
@grokys
Feb 08 2017 09:31
we should probably support coded UI on windows https://msdn.microsoft.com/en-us/library/dd286726.aspx
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:31
You see, in a proper app, your main executable contains only AppBuilder setup
And App itself lives in a separate lib
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:32
makes sense.
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:32
See how ControlCatalog is implemented
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:32
@grokys anything against or for coded ui?
@kekekeks that's pretty much the setup i do for wpf as well
Steven Kirk
@grokys
Feb 08 2017 09:32
not really used it
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:32
usage is similar, and due to the multi-platform nature, i'd focus on webdriver
as it means you can control software running on a raspberyr core etc :)
Johan Larsson
@JohanLarsson
Feb 08 2017 09:33
UI tests are really useful for control libs ime.
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:33
@JohanLarsson I see great value for apps as well
@grokys coded ui has a recorder, but the key in keeping your tests maintainable imo is not using a recorder
;)
Johan Larsson
@JohanLarsson
Feb 08 2017 09:33
Yeah, guess it is the same, just more maintenance :)
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:34
@JohanLarsson depends. I use the page object pattern, pretty doable then
if you do your assertions fine-grained enough
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:38

as it means you can control software running on a raspberyr core etc

Still want that VNC platform tho

You know, we could run devtools on iphone and connect to them from PC
Or even use jsvnc
and connect from browser
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:40
@kekekeks not saying having vnc as platform is not interesting!
on the contrary
but it would need a managed drawing platform?
or skia is still usable/
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:41
Skia can draw to whatever surface you want
Matthijs ter Woord
@mterwoord
Feb 08 2017 09:41
ok
Nikita Tsukanov
@kekekeks
Feb 08 2017 09:41
Currently we are using this interface as render target abstraction for Skia - https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Platform/Surfaces/ILockedFramebuffer.cs
Nikita Tsukanov
@kekekeks
Feb 08 2017 10:18
@grokys @wieslawsoltes it seems that AppVeyor skips iOS app builds completely
Even managed code isn't compiled
So it was completely broken for a really long time
There are still references to TestApplication there
Steven Kirk
@grokys
Feb 08 2017 10:32
don't you need a mac to build iOS?
Matthijs ter Woord
@mterwoord
Feb 08 2017 10:33
yep
but i think he's meaning the shared projects or something
Andrea Del Signore
@sejerpz
Feb 08 2017 10:36
hi, yestarday I tried avalonia on linux, but my experience was not so good, the problems comes not from avalonia per se, but from dotnet core. It segfaults whenever I try to do a restore. From my understanding the problem is the linux kernel version (I'm on debian sid with kernel 4.9). Anyone has the same problem? Any solution or workaround?
Nikita Tsukanov
@kekekeks
Feb 08 2017 10:44

don't you need a mac to build iOS?

No

You can compile managed code without mac
You need Mac for AOT compilation and producing app bundle
I'm on debian sid
sid
That's the problem
Sid always breaks toys, you know)
Andrea Del Signore
@sejerpz
Feb 08 2017 11:19
eheh yes I know, but I can't reinstall it :)
this is the dotnet core bug: dotnet/coreclr#6016
Andrea Del Signore
@sejerpz
Feb 08 2017 11:25
the issue it's closed, but I couldn't dowload any version with the fix included
Nikita Tsukanov
@kekekeks
Feb 08 2017 11:48
Compile from sources. You are doomed to do that from time to time with sid
Nikita Tsukanov
@kekekeks
Feb 08 2017 16:59
@grokys RenderTargetBitmap doesn't know anything about target DPI
Steven Kirk
@grokys
Feb 08 2017 16:59
yeah, it needs to
Somewhat fixed iOS support
BTW, what might be wrong with this control:
    class SimpleControl : ContentControl
    {
        public SimpleControl()
        {
            Content = new Button() {Content = "WAT"};
            MinWidth = 100;
            MinHeight = 200;
            Background = Brushes.CadetBlue;
        }
    }
Johan Larsson
@JohanLarsson
Feb 08 2017 17:24
NickeManarin/ScreenToGif#33
Nikita Tsukanov
@kekekeks
Feb 08 2017 17:25
For some reason it has (0, 0) bounds
Even after layout pass
Hm
It seems that the issue is with toplevel
That doesn't have any visual children
while having logical ones
Ah,
    <StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/>
    <StyleInclude Source="resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"/>
Is now mandatory
Nikita Tsukanov
@kekekeks
Feb 08 2017 17:31
BTW, @grokys since you now have experience with visual studio extensions, could you please take a look at "greedy wpf designer" issue?
Steven Kirk
@grokys
Feb 08 2017 17:32
yeah, i will do that when i get some time!
Nikita Tsukanov
@kekekeks
Feb 08 2017 17:33
no rush, it's just WPF designer that tried to enforce its build action for XAML-file in iOS project
And broken the build
Steven Kirk
@grokys
Feb 08 2017 17:41
yeah, there's a lot of problems with the designer... i need to have it turned off
Nikita Tsukanov
@kekekeks
Feb 08 2017 17:42
We need some out-of-process designer and autocomplete, I think
Since it just doesn't work properly with visual studio
Visual Studio in a nutshell
Johan Larsson
@JohanLarsson
Feb 08 2017 17:51
what do you mean when you say designer?
drag controls onto a designer surface?
Matthijs ter Woord
@mterwoord
Feb 08 2017 18:07
@kekekeks I'd say tehre's some memory bug somewhere then...
danwalmsley
@danwalmsley
Feb 08 2017 18:12
Any
Matthijs ter Woord
@mterwoord
Feb 08 2017 18:13
?
Nikita Tsukanov
@kekekeks
Feb 08 2017 18:22

what do you mean when you say designer?

Previewer, actually

Johan Larsson
@JohanLarsson
Feb 08 2017 18:23
nice, sounds right
Nikita Tsukanov
@kekekeks
Feb 08 2017 18:23
argh
It even works properly sometimes
Johan Larsson
@JohanLarsson
Feb 08 2017 18:25
that looks really nice, interactive and all
Nikita Tsukanov
@kekekeks
Feb 08 2017 18:27
You can install it from VS gallery
It works if you have something targeting .NET 4.5
That looks a bit better than our previous mess
With "single-instance" emulated window
BTW, the funny thing with iOS is that it actually has NSWindow class
You are just not supposed to have more than one
JACKPOT
@grokys @jkoritzinsky @danwalmsley @SuperJMN @ImaBrokeDude_twitter @wieslawsoltes
Apache license
Steal all the code
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:10
YES!
take all the grid code?!
*!!!
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:10
It's DATAgrid
The thing that people are always asking about when I tell them about avalonia
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:11
Nice!
just look at that
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:12
Can't we also spin our the measure and arrange phases to our Grid control since they use a custom panel impl?
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:12
I almost regret that we don't have a compatibility layer
You see, DataGrid has completely different purpose
It's optimized for item virtualization
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:13
Btw I already added Avalonia support for OxyPlot so we already have a usable graphing component
Graphing/charting
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:14
Yep, so porting their chart isn't important
but DataGrid tho
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:15
Yeah lets def take DataGrid
Maybe take the Map control too?
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:16
They probably use WebView or something like that
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:17
They don't according to docs. They use D2D
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:17
Very nice
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:18
They are using some cpp code
Which is not nice at all
They've also submerged Crimea into the sea for some reason
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:21
Yeah... Pref or mapping issues with SharpDX maybe? Or just a preference to use C++ for whatever reason.
Cause SharpDX docs aren't the best
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:22
I think it could be ported to our API anyway
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:22
Yeah I think so
We can take a lot of their controls. We should also look at the date time controls too.
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:23
Calendar looks good
But DatePicker is unusable for actually picking dates
It's fine for recent dates
But if you need to specify your birthday
Or some date in the distant past
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:24
It still works pretty well as long as there's inertial scrolling.
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:25
Meh
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:25
Its the same style as all mobile date pickers.
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:25
I was requested to remove native (iOS/Android) datepicker controls from an app recently
For that precise reason
People needed to input dates that are mostly in 1940-1970 time period
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:25
Ok. Embedded calendar idea?
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:26
Yeah
Something like that
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:26
Sounds good to me.
Btw we really should have a set of mobile styles for our controls eventually. To make them look similar to the native platforms when possible.
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:27
Yep, definitely need styles at least for buttons and textboxes
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:28
Yeah. An optional class for check boxes too would look nice.
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:28
WPF handled native look&feel for windows versions that way
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:28
Yeah that sounds good to me.
Btw I think RangeSlider would also be a good control to take. I've definitely thought about having something similar to that many times.
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:28
That grid tho
do want
Nikita Tsukanov
@kekekeks
Feb 08 2017 22:48
I like that codecov build check
The only times I've got it as "passed" were the ones when I've removed whole projects from the repo
Jeremy Koritzinsky
@jkoritzinsky
Feb 08 2017 22:55
Yeah we can customize that. I never got around to it.
Our requirements are really high for our project.
At least for now.