These are chat archives for AvaloniaUI/Avalonia

15th
Mar 2016
Darnell Williams
@Seeker1437
Mar 15 2016 10:23
Oh @grokys welcome back!
Steven Kirk
@grokys
Mar 15 2016 10:23
thanks!
Steven Kirk
@grokys
Mar 15 2016 11:13
hey guys, i'm writing a guide for people coming from WPF to Perspex - what are the most noticeable differences you've found?
Eric Winnington
@ewinnington
Mar 15 2016 12:24
That guide will be very appreciated here @grokys - with a raspberry pi 2 & now a mac at home to test, I'm looking forward to setting up a xplat perspex app, especially if I can do it on .net core without mono. If you need someone to read it over...
Steven Kirk
@grokys
Mar 15 2016 12:29
@ewinnington ok, you can see what I've got so far here: https://github.com/Perspex/Perspex/blob/master/docs/tutorial/from-wpf.md
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 12:48
@grokys I would add some information how DataTemplates are chosen
Steven Kirk
@grokys
Mar 15 2016 12:48
ok, good idea. what specifically did you find different to WPF?
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 12:49
the order, inheritance, interface etc. are important for DataTemplates
also some info about TreeDataTemplate would be nice
Steven Kirk
@grokys
Mar 15 2016 12:50
ok, thanks!
TreeDataTemplate definitely needs documenting
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 12:55
I would also add some info about naming controls and finding them in code behind
Steven Kirk
@grokys
Mar 15 2016 12:56
yep - good point, as we've not yet got a xaml compiler to do that automatically
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 12:58
and definitely some extended info about style selectors and classes
binding to element name like {Binding #controlName.SomeProperty} etc.
In Grid section I would add info about <Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="*,Auto">
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 13:03
Also would add info that you need to specify assembly when defining namespace even if if the resource if its in same assembly xmlns:viewmodels="clr-namespace:MyApp.ViewModels;assembly=MyApp"
This is also causing sometimes trouble, when you add new xaml resource to project, that you have specify that its not compiled.
Eric Winnington
@ewinnington
Mar 15 2016 13:04
In the Styles document: https://github.com/Perspex/Perspex/blob/master/docs/spec/styles.md
When you talk about classes on buttons, <Button Classes="blue"> or Classes="h1", it would be nice to contrast that with what WPF had (was it possible?) and maybe give us some code behind in Perspex to add a class to an item.
Also is giving multiple classes to an element possible (with space? comma? etc...)
That could go into the from WPF docu
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 13:06
I would add info how to consume converters in bindings in xaml using Static
something like Text="{Binding A, Mode=TwoWay, Converter={Static converters:ByteToStringConverter.Instance}}"
this is related to Resources section
@grokys I think the x:Name is not supported?
Some info about difference between events like AttachedToVisualTree etc. as they have different names in WPF
Steven Kirk
@grokys
Mar 15 2016 13:11
ok, thanks - all good suggestions!
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 13:20
Info about how to get access to drawing context would be nice public override void Render(DrawingContext context)
Info about IsVisible property
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 13:32
@grokys The from-wpf.md should also be added to https://github.com/Perspex/Perspex/blob/master/docs/tutorial/toc.yml like this
- name: Perspex for WPF Developers
  href: from-wpf.md
so generated docs will include it in navigation
Steven Kirk
@grokys
Mar 15 2016 13:40
yeah, i was going to add it when it was a bit more complete, because i need to regenerate the site etc
danwalmsley
@danwalmsley
Mar 15 2016 13:49
@grokys still getting huge memory leaks just leaving my application in idle
have a suspicion it might not be releaseing formatted text objects?
Steven Kirk
@grokys
Mar 15 2016 13:56
in idle? hmm, if it's idle it shouldn't even be rendering so i doubt it's formatted text
do a snapshot in the VS profiler before and after, and see what's being created
danwalmsley
@danwalmsley
Mar 15 2016 13:59
well my caret blinks
I think that triggers a full re-render every 500ms
image.png
it must be in unmanaged memory
there are my snapshots
but total memory usage has gone from 30mb to now nearly 750mb
but it doesn't show on the managed heap
I'm leaving it until I get outfmemory exception see if that gives us a clue
does Perspex say if just my texteditor needs re-rendering, then re-render entire visual tree
or only the bits that are marked invalid?
danwalmsley
@danwalmsley
Mar 15 2016 14:10
This message was deleted
image.png
its slowly allocating drawing context? Direct2D layers, perhaps these have a small managed footprint, but huge unmanaged footprint?
This message was deleted
i'll take out the caret blink code
then it shouldn't be doing anything and see if the leak still happens
danwalmsley
@danwalmsley
Mar 15 2016 14:19
maybe visual studio has a bug, its showing 100MB usage in task manager
but over 2GB in vs
image.png
Steven Kirk
@grokys
Mar 15 2016 17:32
strange
what did taking out the caret blink do?
Darnell Williams
@Seeker1437
Mar 15 2016 17:53
@grokys
oops lolol
yep - good point, as we've not yet got a xaml compiler to do that automatically
what would this take to do?
Steven Kirk
@grokys
Mar 15 2016 18:13
not sure yet tbh - it's nothing i've thought much about at this point
i think OmniXAML would need support for x:Class, not sure if Portable.Xaml has that
Curtis Wensley
@cwensley
Mar 15 2016 18:17
grokys, Portable.Xaml has it, but it doesn't appear to do anything with it.. Though I'm not sure if it needs to.
I'd like to create a code writer for Portable.Xaml, if that would be of any use.
Steven Kirk
@grokys
Mar 15 2016 18:38
you mean a tool to generate C# from XAML?
that would be amazing
Curtis Wensley
@cwensley
Mar 15 2016 18:38
yeah
Steven Kirk
@grokys
Mar 15 2016 18:38
we've discussed that at various points, it would be a really nice option
(by the way, I didn't realise you were the guy behind Eto.Forms - really nice framework that!)
Curtis Wensley
@cwensley
Mar 15 2016 18:40
it's not without challenges, but I've done something similar before (eto.parse).
haha, thanks! (;
Steven Kirk
@grokys
Mar 15 2016 18:47
i really need to try integrating Portable.Xaml...
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 19:45
@grokys Can you have a look at my PR Perspex/Perspex#471
Steven Kirk
@grokys
Mar 15 2016 19:46
looks good to me
will merge after CI passes
Wiesław Šoltés
@wieslawsoltes
Mar 15 2016 19:47
ok
Denis Zaporozhets
@QuantumDeveloper
Mar 15 2016 20:06
@grokys hi
can you say why _rowDefinitions.TrackItemPropertyChanged(_ => Invalidate()); calls only once?
as I understand it should be called each time when something changed in col/rows ?
Abdelkarim Sellamna
@abdelkarim
Mar 15 2016 20:34
@grokys @cwensley @Seeker1437 I hope that you guys didn't think that I've gave up on you. :)
I hope that you do remember the xml project that I've mentioned before
I am currently working on coupling it with the following project https://github.com/terrajobst/nquery-vnext to produce a rich editing experience
for visual studio and other IDE's, since the work will be portable, as roslyn
blob
for that I've started on local project, PerspexPad, where I hosted the visual studio editor and trying to do things little by little, the will allow a xaml compiler to be easily written, either to compile it or to produce the code behind files
what I am targetting right now, is completion, it will be a huge work, but I am ambitious
:)
Steven Kirk
@grokys
Mar 15 2016 20:41
@QuantumDeveloper hmm, that doesn't sounds right - yes it should call the callback each time a property on an object in the collection changes
maybe its a bug
good luck @abdelkarim - i can't say i understand exactly what you're trying to do, but it sounds interesting
Darnell Williams
@Seeker1437
Mar 15 2016 21:17
It looks to me is that he is working on what amounts to the System Xaml for Perspex including the needed analyzers and parsers that would bring editing in VS to a level at or greater than what VS does for WPF
That picture is like a systax walker woah
Darnell Williams
@Seeker1437
Mar 15 2016 21:23
I really am without much talent... and room to grow forever I love it :D Allow me to learn from
danwalmsley
@danwalmsley
Mar 15 2016 21:35
@abdelkarim in your nquery port what are you doing about text editor?
Abdelkarim Sellamna
@abdelkarim
Mar 15 2016 21:37
the editor that is used in nquery is vs2010 wpf editor, pre-packaged by Ms for testing purposes, since my work involves the ide very much, I don't need to launch vs exp each time I want to test something
the editor is provided as a nuged package.
Wish me good luck guys, I will share the news as soon as I have a milestone cleared, later I will open up the work for contribution
danwalmsley
@danwalmsley
Mar 15 2016 21:38
ah I thought you must have been making nquery work cross platform and have an editor based on perspex
Abdelkarim Sellamna
@abdelkarim
Mar 15 2016 21:38
once I've understood enough of it
danwalmsley
@danwalmsley
Mar 15 2016 21:38
:D awesome good luck
Abdelkarim Sellamna
@abdelkarim
Mar 15 2016 21:39
nquery is mini-roslyn implementation, I am using it as a reference, I do take things from there, but most of it is not needed, it deals with sql-related data,..
what will be cross platform is the xaml parser, code fixes, services,... all of those will be in portable libs
so that hosting our work in xamarin, becomes a matter of implementing the editor features and binding them to tthe services that we're exposing
Darnell Williams
@Seeker1437
Mar 15 2016 22:24
DOes this means it would also be quite possible to develop things using Perspex on iOS?
And what I mean by that is: A Perspex IDE that runs on iOS.... I know it's crazy but that would be nice :D
I already develop for android.... on android using AIDE.
Denis Zaporozhets
@QuantumDeveloper
Mar 15 2016 23:00
@grokys #469 #472
danwalmsley
@danwalmsley
Mar 15 2016 23:18
@QuantumDeveloper #469 failed checks :(
Darnell Williams
@Seeker1437
Mar 15 2016 23:31
@grokys is a Popup an ITopLevel?
yes :dancer:
Steven Kirk
@grokys
Mar 15 2016 23:49
Popup isn't, PopupRoot is
Darnell Williams
@Seeker1437
Mar 15 2016 23:49
oh