Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
[WPF] Fixed "drag image must be set before starting drag operation" e…
Browse files Browse the repository at this point in the history
…xception in "TreeViews" sample
  • Loading branch information
Alexander Sorokin committed Nov 17, 2017
1 parent 11bc60a commit ee9009b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions TestApps/Samples/Samples/TreeViews.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using Xwt;
using Xwt.Drawing;

namespace Samples
{
Expand Down Expand Up @@ -147,6 +148,8 @@ public TreeViews ()
view.DragStarted += delegate(object sender, DragStartedEventArgs e) {
var val = store.GetNavigatorAt (view.SelectedRow).GetValue (text);
e.DragOperation.Data.AddValue (val);
var img = Image.FromResource(GetType(), "class.png");
e.DragOperation.SetDragImage(img, (int)img.Size.Width, (int)img.Size.Height);
e.DragOperation.Finished += delegate(object s, DragFinishedEventArgs args) {
Console.WriteLine ("D:" + args.DeleteSource);
};
Expand Down

0 comments on commit ee9009b

Please sign in to comment.