Metro Nuggets

Bitesized tidbits for building Modern (Metro) apps.

Introducing DropFilesBehaviour

One of the cool things about UWP apps is the way in which they can interact with “big Windows” apps as well as other UWP apps. What do I mean by this? Well, the easy example is dragging and dropping things into your app from either another UWP, or from a regular win32 application, likes files, from Explorer.

It can be a pain to set everything up for your app to start accepting files via drag and drop, so I’ve rolled the basic behaviour into, well, a behaviour.

The Solution

You can use the IsDropping property to change up elements in your UI. In my case, I wanted to highlight the BorderBrush of the attached Grid to show the user they were ok to drop the files there.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: