These are chat archives for AvaloniaUI/Avalonia

17th
Mar 2016
Amer Koleci
@amerkoleci
Mar 17 2016 07:24 UTC
@grokys Fixes to library usually, won't hurt update to version 3.0.2
@grokys in the pull I fixed also registration of Canvas attached properties
Steven Kirk
@grokys
Mar 17 2016 08:20 UTC
ok, it's not a good idea to mix two things in a PR
there's a PR by @wieslawsoltes that also fixes that, by adding it to your PR you make it more difficult to merge
Steven Kirk
@grokys
Mar 17 2016 11:27 UTC
@QuantumDeveloper I've been looking at your Grid implementation
and I can see whole bits coped from the WPF reference source
that's going to be a problem - what you're doing is not legal afaik
you could leave us open to being sued
Darnell Williams
@Seeker1437
Mar 17 2016 11:46 UTC
WPF is based on MS-PL I thought?
this was already explained to @QuantumDeveloper - I assumed that he'd understood it could not be copied
Darnell Williams
@Seeker1437
Mar 17 2016 11:54 UTC
"Reference use" means use of the software within your company as a reference, in read only form, for the sole purposes of debugging your products, maintaining your products, or enhancing the interoperability of your products with the software, and specifically excludes the right to distribute the software outside of your company.
I see
On top of that, I am willing to bet WPF wont be released under MIT
Steven Kirk
@grokys
Mar 17 2016 11:55 UTC
nope, i don't think there's any chance of that
Darnell Williams
@Seeker1437
Mar 17 2016 12:00 UTC
Means I need to start Calendar over xD, I missed that part.
Denis Zaporozhets
@QuantumDeveloper
Mar 17 2016 12:05 UTC
@grokys first of all this Grid is not a bit copy of MS Grid. I borrowed their algorithm without copying of their data structures
And the second is that I beleive effective Grid algorithm could not be other than you see now.
You have 2 options: leave it as is and put up with poor performance or we can do something with it and apply new Grid variant.
Steven Kirk
@grokys
Mar 17 2016 12:07 UTC
but breaking the law isn't an option i'm afraid
you've even copied the comments verbatim!
i think we need to get legal advice on this
Denis Zaporozhets
@QuantumDeveloper
Mar 17 2016 12:10 UTC
we need here to decide what does breaking the law means? Does it means that I cannot do the same algorithm or just cannot copy some code?
I copied the comment just to see it every time i changed something. The is no problem with removing them, but as I said earlier where does law breaking started?
Darnell Williams
@Seeker1437
Mar 17 2016 12:11 UTC
The source that exist cannot be reditributed, even if it is a dirrivative work
Basically, from those parts of the code pointet out, even if you left out some of the data structures, it is still based almost explucisvely on the eference source which specifically prohibites the usages in the manner
Denis Zaporozhets
@QuantumDeveloper
Mar 17 2016 12:14 UTC
ok, when it will no longer be a copy? Its interesting question because as I can see there is no other effective way to solve performance problems currently
Darnell Williams
@Seeker1437
Mar 17 2016 12:17 UTC
That is an instance where you can then request (though they may not be willing) to have them release it under the MIT license (that's the only one I see them doing it in atm)
Steven Kirk
@grokys
Mar 17 2016 12:17 UTC
well strictly speaking if you're reverse engineering an API then you must not look at even the decompiled source
but i agree - this is a bit of a grey area
Darnell Williams
@Seeker1437
Mar 17 2016 12:18 UTC
It's weird honestly where the line between legal and illegal resides
Steven Kirk
@grokys
Mar 17 2016 12:18 UTC
we avoid this problem usually in perspex by not following the API exactly, and when we do, we take an existing implementation from e.g. moonlight
which will have been implemented without knowledge of the MS source
Darnell Williams
@Seeker1437
Mar 17 2016 12:19 UTC
I worked on a project that many thought was illegal but we were able to prove that 100% of the code was originall using only behavioral analysis to produce code that emulated the original behavior
Darnell Williams
@Seeker1437
Mar 17 2016 12:20 UTC
Lots of trial and error!
Steven Kirk
@grokys
Mar 17 2016 12:20 UTC
Microsoft .NET source code: If you have looked at Microsoft's proprietary implementation of .NET or their shared source code (which is also proprietary), you will not be able to contribute to Mono. If you would like to contribute in this area, be careful to not look into them in Visual Studio debugging experience.
Darnell Williams
@Seeker1437
Mar 17 2016 12:22 UTC
SO basically, it would be okay if your talent and understanding of the subject was he basis of your code, it could not come from reading other source.
knowledge not talent, though you do need talent too xD
Denis Zaporozhets
@QuantumDeveloper
Mar 17 2016 12:22 UTC
it would be better if there be at least some Grid rules and basic algorithm how it resolves its definitions, but as far as there is no such info...
Darnell Williams
@Seeker1437
Mar 17 2016 12:23 UTC
KSAs the military would say (Knowledge, Skills, and Abilities)
Darnell Williams
@Seeker1437
Mar 17 2016 12:31 UTC
Yeah this is prertty optimizd but, not even an attempt to deviate or anything :D
Denis Zaporozhets
@QuantumDeveloper
Mar 17 2016 12:35 UTC
I wanted firstly to make it work correctly, because they have different implementation (not based on GridSegment), so there was hard to understand which properties corresponds to GridSegments analogues. I tried to deviate from their implementation, but each deviation ended with not correctly working Grid :) But now I hope that basically it works as expected and now I can deviate in something:)
Steven Kirk
@grokys
Mar 17 2016 12:54 UTC
i've emailed the .net foundation for advice on how to continue
danwalmsley
@danwalmsley
Mar 17 2016 13:57 UTC
can someone point me to an example of rotate transform in Perspex?
I just need to rotate a grid and its contents by say 45 degrees
found it
no worries
danwalmsley
@danwalmsley
Mar 17 2016 14:06 UTC
is fallback value implemented in bindings yet?
Wiesław Šoltés
@wieslawsoltes
Mar 17 2016 14:38 UTC
yes
Darnell Williams
@Seeker1437
Mar 17 2016 14:59 UTC
Yaaaaay
Kevin
@KeKl
Mar 17 2016 16:58 UTC
Can someone tell me please how to get the platform window handle from a control?
There is the ITopLevelImpl with a Handle member and the window has the PlatformImpl property of type IWindowImpl,
but how to get it from a embedded control?
Steven Kirk
@grokys
Mar 17 2016 17:04 UTC
only the top level window currently has a window handle
Kevin
@KeKl
Mar 17 2016 17:08 UTC
I know but how do I get it from a Control?
Darnell Williams
@Seeker1437
Mar 17 2016 17:09 UTC
I think you can cast down to get it
ih wow tab fail
ignore me
Alexey
@flcl42
Mar 17 2016 17:10 UTC
hi guys, GridView ss for my GridView's interface. Just come to ask is there Grid implemented for perspex?
Darnell Williams
@Seeker1437
Mar 17 2016 17:13 UTC
There is, but we need a better one
Steven Kirk
@grokys
Mar 17 2016 17:18 UTC
@KeKl if you just want the handle for the window that a particular control is on, use control.GetVisualRoot() to get the root, cast it to a TopLevel and get the PlatformImpl
you'll need to add using Perspex.VisualTree; to get hold of the GetVisualRoot extension method
Kevin
@KeKl
Mar 17 2016 17:29 UTC
Thank you very much!
Working
Denis Zaporozhets
@QuantumDeveloper
Mar 17 2016 18:21 UTC
@grokys BTW, uniformgrid seems much much simpler to implement :)
danwalmsley
@danwalmsley
Mar 17 2016 18:21 UTC
@flcl42 yes grid is implemented
people are just talking about updating it to a more optimized version
the current one works as expected at the moment
@flcl42 Im super keen to hear how your grid view is coming along? Im desperate to try it out
Wiesław Šoltés
@wieslawsoltes
Mar 17 2016 22:27 UTC
Perspex was mentioned on .NET Rocks http://pca.st/cS3t#t=954
:smile:
danwalmsley
@danwalmsley
Mar 17 2016 22:28 UTC
wow!!!
cwensley @cwensley grins (;
danwalmsley
@danwalmsley
Mar 17 2016 22:34 UTC
@cwensley thanks for the mention!!!
Curtis Wensley
@cwensley
Mar 17 2016 22:34 UTC
any time, Perspex is a great project.
I said great too many times in the podcast.. it's like my word of the week. grr.
danwalmsley
@danwalmsley
Mar 17 2016 22:35 UTC
I'll listen to entire episode shortly
Steven Kirk
@grokys
Mar 17 2016 22:37 UTC
Oh awesome! Need to listen too!
Darnell Williams
@Seeker1437
Mar 17 2016 22:38 UTC
wow nice!
Same for Perspex, you don't HAVE to use XAML :D
We should errm do another markup language after* Perspex 1.0
Curtis Wensley
@cwensley
Mar 17 2016 22:54 UTC
json!
yaml?
Darnell Williams
@Seeker1437
Mar 17 2016 22:57 UTC
json first :D
I hate how fagile yaml is :D
Curtis Wensley
@cwensley
Mar 17 2016 22:58 UTC
yeah but the people that like yaml are so freakin crazy about it they'd jump for joy. it'd be fun to see (;
Darnell Williams
@Seeker1437
Mar 17 2016 23:01 UTC
True, it is pretty epic XD
crap zindex is not an attached property :OOOO
in wpf it's an attached property :O
oh because it's part of Visual damn, Perspex is very thought out
Darnell Williams
@Seeker1437
Mar 17 2016 23:15 UTC
OMG YES A CHALLENEGE
Darnell Williams
@Seeker1437
Mar 17 2016 23:23 UTC
@grokys if I were to subscribe to an animation will it notify me once the animation is complete?
Steven Kirk
@grokys
Mar 17 2016 23:38 UTC
if you have an Animation yes - it will complete when the animation is complete
Darnell Williams
@Seeker1437
Mar 17 2016 23:40 UTC
sorry I worded that question very badly
var animation = Animate.Property(dockItem, _canvasPerspexProperty, dockItem.GetValue(_canvasPerspexProperty),
    location, LinearEasing.For<double>(), TimeSpan.FromMilliseconds(200));

// TODO: Subscribe to completion and execute the below
//
//    _setLocation(dockItem, location);
//    sb.Remove(dockItem);
//    _activeStoryboardTargetLocations.Remove(dockItem);
I need to be able to call this once the animation completes but I am unsure of how to check for completion
Steven Kirk
@grokys
Mar 17 2016 23:45 UTC
ok, so Animate.Property returns an Animation which is an IObservable
so you can take your animation and subscribe to its completion:
animation.Subscribe(_ => { }, () => { /* this will be run when the animation completes */ });
the first parameter to IObservable<T>.Subscribe will receive the values, the second will be called when the animation completes
Darnell Williams
@Seeker1437
Mar 17 2016 23:47 UTC
oooooh wow, did I mis something
I onyl saw onNext, not onComplete!
sorry about that XD
and thank once again!
Steven Kirk
@grokys
Mar 17 2016 23:48 UTC
no problem - it's easy to miss, party because you need to do a using System; to get that extension method
Darnell Williams
@Seeker1437
Mar 17 2016 23:51 UTC
:D do you mind if I ask for your advice on a class? Mainly in regards to Measure.
Steven Kirk
@grokys
Mar 17 2016 23:51 UTC
sure, i'm unable to sleep right now

I feel like the measuring is off, like ti wouldn't always be correct.

Do you have any reconmendations on how this could be improved?

Steven Kirk
@grokys
Mar 17 2016 23:59 UTC
so it looks like you're not using the Perspex layout system for this? i.e. MeasureOverride
Darnell Williams
@Seeker1437
Mar 17 2016 23:59 UTC
No, I don't understand it very well