Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ module DragDropDemo =
| Dropped of string

let doDrag (e, dragCount) =
async {
task {
use dragData = new DataTransfer()
dragData.Add(DataTransferItem.Create(DataFormat.Text, $"You have dragged text %d{dragCount} times"))

let! result = Dispatcher.UIThread.InvokeAsync<DragDropEffects>
(fun _ -> DragDrop.DoDragDropAsync(e, dragData, DragDropEffects.Copy)) |> Async.AwaitTask
(fun _ -> DragDrop.DoDragDropAsync(e, dragData, DragDropEffects.Copy))
return match result with
| DragDropEffects.Copy -> "The text was copied"
| DragDropEffects.Link -> "The text was linked"
Expand All @@ -44,7 +44,7 @@ module DragDropDemo =
match msg with
| BeginDrag e ->
let dragCount = state.dragCount + 1
{ state with dragCount = dragCount }, Cmd.OfAsync.perform doDrag (e, dragCount) Dragged
{ state with dragCount = dragCount }, Cmd.OfTask.perform doDrag (e, dragCount) Dragged
| Dragged s ->
{ state with dragText = s }, Cmd.none
| Dropped s -> { state with dropText = s }, Cmd.none
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.FuncUI.Elmish/Avalonia.FuncUI.Elmish.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Elmish" Version="4.3.0" />
<PackageReference Include="Elmish" Version="5.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading