These are chat archives for AvaloniaUI/Avalonia

15th
Jun 2016
Andrey Kunchev
@donandren
Jun 15 2016 09:28
@grokys skia text rendering and hit testing is 99%+ close to Direct2D text rendering, #559 ready
Darnell Williams
@Seeker1437
Jun 15 2016 10:03
for android/ios, do we have some kind of state saving?
Steven Kirk
@grokys
Jun 15 2016 10:42
@donandren nice!!!
@Seeker1437 no we've not got that yet i don't think
Nikita Tsukanov
@kekekeks
Jun 15 2016 15:04
@grokys Could you provide me with your migration script?
Need to rename a bunch of stuff in VS extension
you will probably need to tweak it a little for your purposes
Nikita Tsukanov
@kekekeks
Jun 15 2016 15:39
@grokys do we have platform autodetect support in appbuilder?
Nikita Tsukanov
@kekekeks
Jun 15 2016 15:45
I think we need some code cleanup there
Steven Kirk
@grokys
Jun 15 2016 15:52
no, no platform autodetect yet
just a comment in ControlCatalog saying it needs to be added ;)
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:02
BTW, why are you guys so obscessed with naming files with ".xaml" extension? It will cause havoc with 3rd party vs extensions
Matthijs ter Woord
@mterwoord
Jun 15 2016 16:05
@kekekeks Not sure, wont extensions look at project types as well?
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:05
Project type is "Windows application"
Which is quite a natural thing
Matthijs ter Woord
@mterwoord
Jun 15 2016 16:06
yeah, but for xaml it's someting else i think
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:06
You can use wpf in winforms applications, you know
Matthijs ter Woord
@mterwoord
Jun 15 2016 16:06
i knwo
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:06
TL;DR: we don't have the monopoly on "xaml" file extension
Matthijs ter Woord
@mterwoord
Jun 15 2016 16:06
but then you're doing funky stuff imo, so you can expect weird things to happen
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:07
No, it's a usual practice
there are a whole bunch of msdn pages explaining how winforms&wpf interopability works
wpf was designed to interop well with winforms
Matthijs ter Woord
@mterwoord
Jun 15 2016 16:07
I know, done it beofre
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:08
At some point we'll also come to a point
When people will want to use perspex and some native toolkit together
Embedding controls, etc
Then we'll have a LOT of problems with having "xaml" extension
Steven Kirk
@grokys
Jun 15 2016 16:12
BTW, why are you guys so obscessed with naming files with ".xaml" extension? It will cause havoc with 3rd party vs extensions
because they're xaml files
xaml supports different namespaces
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:12
Argh
We aren't living in an ideal world
where people actually respect these namespaces
Steven Kirk
@grokys
Jun 15 2016 16:13
what problems is it causing you?
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:13
Ehm, WPF designer opening every time when I click on xaml file?
Steven Kirk
@grokys
Jun 15 2016 16:13
that's a problem with our extension then
it should be registered to appear when it sees the avalonia namespace
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:17
The problem is with wpf designer that overrides everything else
Steven Kirk
@grokys
Jun 15 2016 16:17
hmm, i've not seen that - i've not used our extension since the name change, but it was appearing for xaml files with the perspex namespace fine
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:18
BTW: made platform detect greawork again
Steven Kirk
@grokys
Jun 15 2016 16:18
excellent! thanks
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:25
btw, I have a weird idea
why don't we use bait&switch technique for desktop?
We could ship packages with embedded platform support there
without separate avalonia.desktop package
Steven Kirk
@grokys
Jun 15 2016 16:26
yeah, i have wondered if that would be possible
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:42
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> OmniXaml.LoadException: Error loading XAML: OmniXaml.ParseException: Cannot find a namespace with the prefix ""
   at OmniXaml.Typing.TypeRepository.GetByPrefix(String prefix, String typeName)
   at Avalonia.Markup.Xaml.Context.AvaloniaRuntimeTypeSource.GetByPrefix(String prefix, String typeName)
   at OmniXaml.Parsers.ProtoParser.ProtoInstructionParser.<ParseElement>d__22.MoveNext()
   at OmniXaml.Parsers.Parser.InstructionParser.SetNextInstruction()
   at OmniXaml.Parsers.Parser.InstructionParser.<Parse>d__23.MoveNext()
Mkay, managed to fix that
Now I'm getting black screen
Oh, I need to include styles explicitly
Nikita Tsukanov
@kekekeks
Jun 15 2016 16:59
There is no redirect from perspex.github.io
@wieslawsoltes @danwalmsley @grokys
Please check if it works for you
I've built avalonia from current master branch
Steven Kirk
@grokys
Jun 15 2016 17:16
ok, we need to rebuild the docs website too!
i wonder if there's a way to keep it u-to-date automatically?
Nikita Tsukanov
@kekekeks
Jun 15 2016 17:17
no idea
Steven Kirk
@grokys
Jun 15 2016 17:17
will check out the extension very shortly! just in the middle of some work stuff
Matthijs ter Woord
@mterwoord
Jun 15 2016 17:17
@kekekeks How well does that designer work? :)
Cool work you guys are doing btw
Nikita Tsukanov
@kekekeks
Jun 15 2016 17:17
Well, it's not actually "designer"
it's "visualizer"
So if it manages to start it shows you how your control will actually work
Matthijs ter Woord
@mterwoord
Jun 15 2016 17:18
:)
a preview
Steven Kirk
@grokys
Jun 15 2016 17:39
hmm weird the "download" button at https://gallery.msdn.microsoft.com/59a89da8-eeca-4312-8b99-c4b0a4c0e73f doesn't work!
(also the description still says perspex)
does it work for other people? it just refreshes the page for me!
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 18:10
I stopped using designer as it caused huge slowdowns :(
But will test :)
The download button does not work
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 18:56
@kekekeks Why src/PerspexVS/packages/download.sh script was deleted ?
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 19:11
@kekekeks The VS extension is registered for .xaml files ? It does not show up in Open with... dialog
I had to renamed to .paml to get it running
The extension works ok with UserControl
but i get this error when UserControl is inside Window
OmniXaml.LoadException: Error loading XAML: System.Reflection.TargetInvocationException: Obiekt docelowy wywołania zgłosił wyjątek. ---> System.IO.FileNotFoundException: Unable to find view for SpiroNet.Avalonia.Views.EditorView
   w Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(Type type, Object rootInstance)
   w Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(Object obj)
   w SpiroNet.Avalonia.Views.EditorView.InitializeComponent() w C:\DOWNLOADS\GitHub\SpiroNet\src\SpiroNet.Avalonia\Views\EditorView.paml.cs:wiersz 73
   w SpiroNet.Avalonia.Views.EditorView..ctor() w C:\DOWNLOADS\GitHub\SpiroNet\src\SpiroNet.Avalonia\Views\EditorView.paml.cs:wiersz 47
<Window x:Class="SpiroNet.Avalonia.MainWindow"
        xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:SpiroNet.Avalonia;assembly=SpiroNet.Avalonia"
        xmlns:views="clr-namespace:SpiroNet.Avalonia.Views;assembly=SpiroNet.Avalonia"
        Title="SpiroNet.Avalonia" Height="720" Width="1040"
        Background="White"
        UseLayoutRounding="True">
    <views:EditorView/>
</Window>
Nikita Tsukanov
@kekekeks
Jun 15 2016 19:33
@wieslawsoltes I honestly have no idea, there were some changes on that front by @Seeker1437 and @abdelkarim
Nikita Tsukanov
@kekekeks
Jun 15 2016 19:43
nailed it
@wieslawsoltes please update the extension and check if it works for you now
Nikita Tsukanov
@kekekeks
Jun 15 2016 19:49
Regarding Unable to find view for SpiroNet.Avalonia.Views.EditorView
Check that control has proper build action
Nikita Tsukanov
@kekekeks
Jun 15 2016 19:57
BTW, the issue with WPF editor
Is that if it was opened once
It will be being opened forever after
Nikita Tsukanov
@kekekeks
Jun 15 2016 20:02
for some reason it skips xml editor chooser infrastructure completely
VS also keeps changing build action and stuff if you rename files to xaml
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 20:06
This message was deleted
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 20:11
@kekekeks Ok now all works
Nikita Tsukanov
@kekekeks
Jun 15 2016 20:12
I think, I'll keep .paml in templates in VS extensions
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 20:15
I would prefer xaml, Avalonia samples also use xaml extension
Nikita Tsukanov
@kekekeks
Jun 15 2016 20:16
Yep, but I don't want to force users to deal with wpf designer issues
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 20:20

@kekekeks Is this new behavior?

System.InvalidCastException: Nie można rzutować obiektu typu 'Avalonia.Application' na typ 'Avalonia.Controls.Control'.
   w Avalonia.DesignerSupport.DesignerAssist.UpdateXaml(String xaml)
   w Avalonia.Designer.AppHost.AvaloniaAppHost.XamlUpdater()

when opening designer for App.xaml with Application as root

I think previously was different exception
Nikita Tsukanov
@kekekeks
Jun 15 2016 20:21
Yeah, App has a lot of additional logic before
Now designer is actually able to create an instance and load it from XAML
May be we should open inspector view with app class as the root
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 20:22
well at least do not show exception as its a bit annoying
maybe just show message App.xaml cannot be edited in the Design view. like WPF does
Nikita Tsukanov
@kekekeks
Jun 15 2016 20:23
I'm not sure on which level this should be detected
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 20:48
@donandren Nice work on Skia, just tested with Core2D
2016-06-15_22-46-44.png
You can see one issue with path rendering with multiple figures is different (gray shapes)
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 20:53

this are problematic paths:

M540,165L600,135L600,225L495,225z M570,165Q585,210 540,210z

and

M585,315C675,330 735,255 735,255C525,270 525,240 525,240C480,315 510,360 510,360z M540,270L525,285L540,345Q570,285 630,270z M660,270Q675,300 600,300z
One more issue with text rendering, you can see at the top TabStrip the g in Page1, Page2 and Page3 is not fully visible as in Direct2D version
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 20:59
Also text look bit bolder, but maybe its specific to Skia
Steven Kirk
@grokys
Jun 15 2016 21:04
ok, i think i've fixed the DataContext problems in Core2D
so i'm going to merge virtualization into master!
Nikita Tsukanov
@kekekeks
Jun 15 2016 21:05
merge virtualization into master
that's
really
cool
Steven Kirk
@grokys
Jun 15 2016 21:07
:D
it's only scrolling by item as in WPF currently but smooth scrolling when all items are the same size should be really easy to add
where each item is a different size - that will be more difficult
just waiting for CI to run
then we'll see what it breaks for everyone ;)
Andrey Kunchev
@donandren
Jun 15 2016 21:18
@wieslawsoltes thanks, looks like the text with skia should be lifted 1px up or because the font is fraction bolder it's the issue
Steven Kirk
@grokys
Jun 15 2016 21:18
merged!
Andrey Kunchev
@donandren
Jun 15 2016 21:18
nice
Steven Kirk
@grokys
Jun 15 2016 21:26
arrgh .sln merge woes again
i hate .sln files
Nikita Tsukanov
@kekekeks
Jun 15 2016 21:26
I wonder why do they store so much info there
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 21:29
@grokys Nice work!
Steven Kirk
@grokys
Jun 15 2016 21:30
@wieslawsoltes wow - it's faster for you than it is for me! ;)
there are still some optimizations we need to do
Andrey Kunchev
@donandren
Jun 15 2016 21:31
@grokys impressive performance in @wieslawsoltes video
Steven Kirk
@grokys
Jun 15 2016 21:31
it also uncovered what i think is the memory leak you and @danwalmsley have been seeing - need to investigate that too
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 21:31
I have Core i7 dekstop machine running 4.36 GHz
Steven Kirk
@grokys
Jun 15 2016 21:31
ah yeah that's faster than my laptop ;)
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 21:32
and very fast memory
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 21:37
@grokys When I increase the viewport height the perf is bit worse (you can see some scroll lags) even with few thousand items, but still usable with millions of items
Steven Kirk
@grokys
Jun 15 2016 21:37
yeah, it's the scroll lags - @donandren has submitted a PR that should fix it a little bit that i need to merge
but it's still kinda noticeable
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 21:39
the important part for me is that I can load data into UI and the UI does not freeze and I dont get out of memory exception :)
Steven Kirk
@grokys
Jun 15 2016 21:40
yep, exactly ;) - well hopefully!
Nikita Tsukanov
@kekekeks
Jun 15 2016 21:44
Guys, what could possibly go wrong with WPF combobox and itemssource?
because for some reason I'm unable to get it working
My xaml is <ComboBox Margin="5,0,0,0" ItemsSource="{Binding AvailableTargets}">
Where AvailableTargets is ObservableCollection
Nikita Tsukanov
@kekekeks
Jun 15 2016 21:54
Oh, it's our splitter control
that doesn't propagate DataContext
argh
just lost a hour trying to figure out what's wrong
Steven Kirk
@grokys
Jun 15 2016 21:59
is this in WPF or avalonia?
Oh, it's our splitter control that doesn't propagate DataContext
Nikita Tsukanov
@kekekeks
Jun 15 2016 21:59
in our vs extension
that fancy new splitter
Steven Kirk
@grokys
Jun 15 2016 21:59
ahhh
not the avalonia splitter then
i was confused there!
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:09
@grokys I have found issue with latest Avalonia (after you merged virtualization support).
Steven Kirk
@grokys
Jun 15 2016 22:09
uh-oh!
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:09
To reproduce do in Core2D: File -> New and than again File -> New
and this happens Exception thrown: 'System.ArgumentNullException' in Avalonia.Base.dll
Jeremy Koritzinsky
@jkoritzinsky
Jun 15 2016 22:11
Kol
Nikita Tsukanov
@kekekeks
Jun 15 2016 22:11
What's our new nightly feed url?
Jeremy Koritzinsky
@jkoritzinsky
Jun 15 2016 22:12
Ignore that... Gitter mobile website is a pain...
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:12
@grokys Thats call stack: http://pastebin.com/Wv0XVtQq
Steven Kirk
@grokys
Jun 15 2016 22:12
yep, i see it
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:12
and second issue
when the ListBox with virtualization enabled is hidden (for example in different tab) looks like virtualization is off
this results in memory usage going crazy
Steven Kirk
@grokys
Jun 15 2016 22:14
ahhh ok, yeah i think i know what will cause that
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:16
one more thing I have found
when Items="{Binding Records}" has changed and Records collection has new items, the ListBox will not always be redrawn
easily reproducible in Core2D, go to Databases tab and hit + button
few times
Matthijs ter Woord
@mterwoord
Jun 15 2016 22:19
what's this core2d thing?
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:19
@grokys The issue in not present when I set VirtualizationMode="None"
Steven Kirk
@grokys
Jun 15 2016 22:26
@wieslawsoltes ok fixed the first problem
i'm going to call it a night very soon though - if you get time could you add the other two as issues?
Nikita Tsukanov
@kekekeks
Jun 15 2016 22:27
for some reason it takes ages to swith build configurations
Steven Kirk
@grokys
Jun 15 2016 22:27
it always has for every project i've ever had in VS
i have no idea why
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:32
@grokys Added new issues
Steven Kirk
@grokys
Jun 15 2016 22:41
thanks!
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:41
no problem
the fix for first issue AvaloniaUI/Avalonia@69e2c45 solved exception, but after you File -> New and again File -> New the ListBox is not rendering properly, will create issue
danwalmsley
@danwalmsley
Jun 15 2016 22:46
@grokys just giving new virtualization a quick wirl :)
anyone able to tell me what I have to do with
public IControl GetControlInDirection(NavigationDirection direction, IControl from)
Steven Kirk
@grokys
Jun 15 2016 22:52
if this is for your editor control just return null
that's intended for when your logical scrolling panel is hosting other controls
danwalmsley
@danwalmsley
Jun 15 2016 22:53
ah ok
Nikita Tsukanov
@kekekeks
Jun 15 2016 22:53
Oh, guys, I have a surprise for you
danwalmsley
@danwalmsley
Jun 15 2016 22:53
I'm seeing the weird menus problem you mentioned.. not sure why, the XAML hasn't changed
Nikita Tsukanov
@kekekeks
Jun 15 2016 22:53
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:54
@kekekeks This is huge!
danwalmsley
@danwalmsley
Jun 15 2016 22:54
@kekekeks that is great
has been much needed
Steven Kirk
@grokys
Jun 15 2016 22:54
@kekekeks whoop! excellent!
@danwalmsley yeah, i don't understand it - menus work fine in the sample apps and in core2d
danwalmsley
@danwalmsley
Jun 15 2016 22:55
the only differences is my menus are created by Bindings and the others afaik are just XAML?
so data templates come into play?
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 22:56
@danwalmsley @grokys I have found some menu issues too
danwalmsley
@danwalmsley
Jun 15 2016 22:57
<Menu Items="{Binding Model}">
    <Menu.DataTemplates>
      <DataTemplate DataType="menu:MenuItemSeparator">
        <Separator />
      </DataTemplate>
      <DataTemplate>
        <MenuItem Header="{Binding Text}" Command="{Binding Command}" Items="{Binding Children}" />
      </DataTemplate>
    </Menu.DataTemplates>
  </Menu>
this is my XAML that the menu comes from
I don't know if the fact I have DataTemplate without a DataType is having anything to do with it?
Steven Kirk
@grokys
Jun 15 2016 22:58
and you're not customizing menus in any way?
i wonder if it's because they're in the title bar?
danwalmsley
@danwalmsley
Jun 15 2016 22:59
not customizing them in anyway as far as I know
literally just using as is
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 23:00
My issue is with rendering
danwalmsley
@danwalmsley
Jun 15 2016 23:00
titlebar is not a real title bar, iv just hidden titlebar and created a titlebar with a grid
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 23:00
@danwalmsley Do you have problems with hit-testing ?
danwalmsley
@danwalmsley
Jun 15 2016 23:01
@wieslawsoltes that's interesting, my menus show something similar actually
Wiesław Šoltés
@wieslawsoltes
Jun 15 2016 23:01
the Menu ?
danwalmsley
@danwalmsley
Jun 15 2016 23:01
image.png
Steven Kirk
@grokys
Jun 15 2016 23:01
ah ok, yeah it seems you're both seeing something similar
danwalmsley
@danwalmsley
Jun 15 2016 23:01
yeah, its like there is a grid nested inside another when there shouldn't be
Steven Kirk
@grokys
Jun 15 2016 23:01
anyway, night all, i'm knackered! ;)
danwalmsley
@danwalmsley
Jun 15 2016 23:02
fair enough, mate, good work on virtualization.
night
@wieslawsoltes have you had any problems with bindings? since latest update
Nikita Tsukanov
@kekekeks
Jun 15 2016 23:12
Please, update the extension and check if it works as intended
Nikita Tsukanov
@kekekeks
Jun 15 2016 23:18
BTW, @grokys this change should finally make designer to work with the main solution
And control catalog
Unfortunately you'll still need to rebuild everything to get styles updated
Hm, for some reason it doesn't
It seems that it's unable to load reference list properly or something
Nikita Tsukanov
@kekekeks
Jun 15 2016 23:29
Oh, forgot to include solution folders to the scan, my bad