DataTransferManager.GetForCurrentView() in WinUI 3
See original GitHub issueDescribe the bug
Calling DataTransferManager.GetForCurrentView()
fails with a System.Runtime.InteropServices.COMException: 'Element not found'.
This is somewhat expected, given the ‘GetForCurrentView’ name.
However, I have not found any mention of this particular class. Especially not in the WinRT API changes for Desktop apps.
Is cleaning this up already somewhere on your radar? Can I work around this to make a share dialog work in WinUI 3?
Steps to reproduce the bug
var dataTransferManager = DataTransferManager.GetForCurrentView();
dataTransferManager.DataRequested += DataTransferManager_DataRequested;
Version Info
NuGet package version: WinUI 3 - Project Reunion 0.5: 0.5.5
Windows app type:
UWP | Win32 |
---|---|
Yes |
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | |
October 2020 Update (19042) | Yes |
May 2020 Update (19041) | |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
DataTransferManager.GetForCurrentView Method
This example calls the GetForCurrentView method to get the DataTransferManager object associated with the active window for the app.
Read more >DataTransferManager Class - Windows
To use the class, first call the GetForCurrentView method. This method returns the DataTransferManager object that is specific to the active window. Next,...
Read more >Building a Windows 8 Metro App, Part 3: Listing 8
Click += new RoutedEventHandler(FetchButton_Click); _dataTransferManager = DataTransferManager.GetForCurrentView(); _dataTransferManager.
Read more >c# - Why is this Element not Found?
In your case SettingsPane.GetForCurrentView() is throwing an exception because you're calling it too early. You are configuring the settings ...
Read more >CaptureElement, Windows.UI.Xaml.Controls ...
GetForCurrentView().BackRequested +=BackRequested; DataTransferManager ShareManager = DataTransferManager.GetForCurrentView(); ShareManager.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I use the following on WinUI3, It’s works, a little different on function GetForWindow, and different to page migrate-to-windows-app-sdk/guides/winui3
Thanks! We’re planning on publishing this doc to our official docs site soon with some changes and this API should be included.