Xamarin.Mac - Drag and Drop Example
This sample shows how to do a simple drag & drop between two views in a Xamarin.Mac application. When the application is run, the user can drag from the Red View and drop onto the Green View.
The drag will contain two items:
NSString
- ANSString
value containing the value "Hello World".NSImage
- ANSImage
containing a House icon.
When the drop happens on the Green View, the drop counter will be incremented and the contents of the drag package will be read and displayed in the console.
Prerequisites
- Mac computer with the latest version of macOS.
- Visual Studio for Mac.
- Latest version of Xcode from Apple.
Running the sample
- Open the solution file (.sln) in Visual Studio for Mac.
- Use the Run button or menu to start the app.