简体   繁体   中英

C# - Override OnFileActivated - No Suitable Method

When following the example here.

This code throws an error:

protected override void OnFileActivated(FileActivatedEventArgs args)
{
       // TODO: Handle file activation
       // The number of files received is args.Files.Size
       // The name of the first file is args.Files[0].Name
}

The error is:

'MainPage.OnFileActivated(FileActivatedEventArgs)': no suitable method found to override

Why is this override method not found? I am using UWP.

if you look at the documentation

https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.application.onfileactivated?view=winrt-19041

you will see the override should be on the application class, you haven't provided the code, but it looks like you have tried to overload it on a page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM