These are chat archives for AvaloniaUI/Avalonia

5th
May 2018
Wiesław Šoltés
@wieslawsoltes
May 05 2018 11:31
Some demos from recent AvaloniaUI drag and drop feature.
danwalmsley
@danwalmsley
May 05 2018 11:45
@wieslawsoltes can you point me to example code?
Wiesław Šoltés
@wieslawsoltes
May 05 2018 11:45
wieslawsoltes/Core2D#70
@danwalmsley Currently this is all experimental, I am using Behaviors to attach drag and drop functionality from Xaml.
The DragBehavior is pretty generic.
Wiesław Šoltés
@wieslawsoltes
May 05 2018 11:50
Currently DropBehavior is Core2D specific, but can be easily adapted to other projects.
But it can be used for any control defined in Xaml
Florian
@boombuler
May 05 2018 11:59
@wieslawsoltes did you try Cross process drag drop too?
Wiesław Šoltés
@wieslawsoltes
May 05 2018 12:00
Not yet
Have been porting my drag and drop code from WPF to AvaloniaUI
When I move cursor to another process window I loose the pointer.
Wiesław Šoltés
@wieslawsoltes
May 05 2018 12:09
@boombuler Oh
I have tried dragging text from WordPad (some json) and only drag enter/over is called (with data being null). No drop event :worried:
Florian
@boombuler
May 05 2018 12:11
If your data is serializable it should work out of the box
Wiesław Šoltés
@wieslawsoltes
May 05 2018 12:11
The Data is null
Florian
@boombuler
May 05 2018 12:12
Even with current head?
Wiesław Šoltés
@wieslawsoltes
May 05 2018 12:12
I can not try current head as there is one issue in master the prevents my app from running
Will try control catalog :smile:
Florian
@boombuler
May 05 2018 12:14
OK... You just shocked me cause i thought I've fixed it 😀
Wiesław Šoltés
@wieslawsoltes
May 05 2018 12:15
No worries
This issue is preventing me from using latest builds AvaloniaUI/Avalonia#1548
Florian
@boombuler
May 05 2018 12:15
Let ne know If you have any problems with drag drop so i can get them fixed
Wiesław Šoltés
@wieslawsoltes
May 05 2018 12:16
I just tested .NET Core version of Control Catalog and dragging text from WordPad worked :smile:
So I think it will work with my app :smile:
@boombuler I am in process of adding drag and drop functionality to my app so it will be definitely stress tested :fire:
2018-05-05_14-18-08.gif
Steven Kirk
@grokys
May 05 2018 20:16
@wieslawsoltes #1552 should hopefully fix the bug you reported!
Steven Kirk
@grokys
May 05 2018 21:13
This message was deleted
unfortunately i don't know the answer!
i suspect you know more about grid layout than almost anyone at this point! ;)
i say: make it work in the way that most makes sense
if we have to change the layout of the grid in the calendar control to make it work with the new grid, i'm fine with that
walterlv
@walterlv
May 05 2018 21:58
@grokys We should change the header column width to * in the calendar.
Steven Kirk
@grokys
May 05 2018 21:59
is it Auto at the moment?
* would definitely make more sense
walterlv
@walterlv
May 05 2018 22:00
The original calendar columns are all Auto. As I mentioned in the post, all Auto behaviors stangely in the WPF's Grid.
Steven Kirk
@grokys
May 05 2018 22:00
yeah, i wonder if that comes from silverlight or it was something introduced porting it to avalonia?
that makes no sense
:+1: change it to *
any idea what's causing the TreeView items to look wrong? is that a similar mistake?
walterlv
@walterlv
May 05 2018 22:04
At the very beginning, the calendar layout is very strange, as the same in TreeView. That's my fault.
Then I fixed it on this commit.
Steven Kirk
@grokys
May 05 2018 22:05
hmm, i thought i tried it after that commit
walterlv
@walterlv
May 05 2018 22:06
Wait a minute
I'm getting up and running to check the tree view.
walterlv
@walterlv
May 05 2018 22:11
Did you tried to read and understand the algorithm? If is is not very easy to understand, I think I should write more explaining comments.
Steven Kirk
@grokys
May 05 2018 22:12
i haven't tried to understand it properly yet, no
walterlv
@walterlv
May 05 2018 22:12
You're right. The TreeView is still laying out Incorrectly.
Steven Kirk
@grokys
May 05 2018 22:13
the code looks pretty well commented though!
certainly better than the old version!
walterlv
@walterlv
May 05 2018 22:17
Do Avalonia have any UI Spy tools?
Steven Kirk
@grokys
May 05 2018 22:19
if you press F12 there's the (very basic) devtools
when its open hover over a control and press ctrl+shift to select the control in the tree
walterlv
@walterlv
May 05 2018 22:22
image.png
Interesting
I made the TreeView stange.
I's very similar to Snoop.
Steven Kirk
@grokys
May 05 2018 22:26
yeah, similar to snoop - just not as good ;)
walterlv
@walterlv
May 05 2018 23:34
image.png
image.png
@grokys Only two methods calculate the additional conventions (the children desired size) and both of them have bugs.
Steven Kirk
@grokys
May 05 2018 23:37
haha
another off-by-one bug?
walterlv
@walterlv
May 05 2018 23:37
No, this is a TODO bug.
That is, @lindexi and I don't know how ti simulate the WPF's behavior, so I write a TODO for him to finish it.
Steven Kirk
@grokys
May 05 2018 23:39
ahhh :)
walterlv
@walterlv
May 05 2018 23:40
image.png
return _additionalConventions
    .Where(x => x.Span == 1 && conventions[x.Index].Length.IsStar)
    .Sum(x => x.Min);
I aggregated all the heights even if the children are in the same row.
So the TreeView's height is larger than expected.
Steven Kirk
@grokys
May 05 2018 23:49
so did you and @lindexi work on this together?
walterlv
@walterlv
May 05 2018 23:59
Yes