Skip to content

Commit 7de7b34

Browse files
committed
feat: add drag-and-drop support to Dashboard view
- Enabled `AllowDrop` on key UI elements in `Dashboard.xaml`. - Updated drag-and-drop logic in `Dashboard.xaml.cs` to handle file drops. - Bumped MaterialDesignThemes package to version `5.2.2-ci935`. This improves user interaction by allowing file drag-and-drop functionality.
1 parent a63d983 commit 7de7b34

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

EasyExtractUnitypackageRework/EasyExtract/EasyExtract.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<Version>5.1.0</Version>
6363
</PackageReference>
6464
<PackageReference Include="MaterialDesignThemes">
65-
<Version>5.2.2-ci933</Version>
65+
<Version>5.2.2-ci935</Version>
6666
</PackageReference>
6767
<PackageReference Include="Microsoft.Extensions.DependencyInjection">
6868
<Version>10.0.0-preview.1.25080.5</Version>

EasyExtractUnitypackageRework/EasyExtract/Views/Dashboard.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,18 @@
4343

4444
<!-- Main container -->
4545
<Grid
46+
AllowDrop="True"
4647
HorizontalAlignment="Stretch"
4748
VerticalAlignment="Stretch"
4849
x:Name="DialogHelperGrid">
4950
<Border
51+
AllowDrop="True"
5052
AutomationProperties.HelpText="Contains the primary UI elements of the application."
5153
AutomationProperties.Name="MainContentContainer"
5254
HorizontalAlignment="Stretch"
5355
VerticalAlignment="Stretch"
5456
x:Name="MainContentBorder">
55-
<Grid x:Name="MainGrid">
57+
<Grid AllowDrop="True" x:Name="MainGrid">
5658
<Grid.RowDefinitions>
5759
<RowDefinition Height="Auto" />
5860
<RowDefinition Height="*" />

EasyExtractUnitypackageRework/EasyExtract/Views/Dashboard.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ private void Dashboard_OnDragLeave(object sender, DragEventArgs e)
316316

317317
private void Dashboard_OnDragOver(object sender, DragEventArgs e)
318318
{
319+
e.Effects = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None;
320+
321+
e.Handled = true;
319322
CancelPendingReset();
320323
UpdateDragDropText("Ready to drop", DragDropColors.DragOver);
321324
}

0 commit comments

Comments
 (0)