Browse Source
Fix in HeadlessClipboardStub.GetDataAsync where format is not considered (#18008)
pull/18029/head
Yoshihiro Ito
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
11 additions and
1 deletions
-
src/Headless/Avalonia.Headless/HeadlessPlatformStubs.cs
|
|
|
@ -66,7 +66,17 @@ namespace Avalonia.Headless |
|
|
|
|
|
|
|
public async Task<object?> GetDataAsync(string format) |
|
|
|
{ |
|
|
|
return await Task.Run(() => _data); |
|
|
|
return await Task.Run(() => |
|
|
|
{ |
|
|
|
if (format == DataFormats.Text) |
|
|
|
return _text; |
|
|
|
if (format == DataFormats.Files && _data is not null) |
|
|
|
return _data.GetFiles(); |
|
|
|
if (format == DataFormats.FileNames && _data is not null) |
|
|
|
return _data.GetFileNames(); |
|
|
|
else |
|
|
|
return (object?)_data; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|