Files
TheXamlGuy.TaskbarGroup/TheXamlGuy.TaskbarGroup.Flyout/Views/TaskbarButtonGroupDropHandler.cs
T
dan_clark@outlook.com 263704a772 Add drag/drop handling
2022-03-23 21:19:23 +00:00

50 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using TheXamlGuy.TaskbarGroup.Flyout.Foundation;
using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;
namespace TheXamlGuy.TaskbarGroup.Flyout
{
public class TaskbarButtonGroupDropHandler : IDropHandler<TaskbarButtonGroupView>
{
public async Task Handle(Drop<TaskbarButtonGroupView> message, CancellationToken canellationToken = default)
{
if (message.DropEventArgs.DataView.Contains(StandardDataFormats.StorageItems))
{
var items = await message.DropEventArgs.DataView.GetStorageItemsAsync();
foreach (var storageItem in items)
{
if (storageItem is StorageFile storageFile)
{
if (storageFile.Path is { Length: > 0 })
{
}
else
{
var properties = await storageFile.Properties.RetrievePropertiesAsync(new List<string>
{
"System.AppUserModel.ID"
});
var appUserModelId = properties["System.AppUserModel.ID"];
if (appUserModelId is not null)
{
}
}
}
if (storageItem is StorageFolder storageFolder)
{
}
}
}
}
}
}