/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Dialogs/FileTooLargeDialog.xaml.cs
39 строк
1006 B
Yair
Code Quality: Updated license header
31 дек 2024, 05:03
31 дек 2024, 05:03
8436c6d
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; namespace Files.App.Dialogs { public sealed partial class FileTooLargeDialog : ContentDialog, IDialog<FileTooLargeDialogViewModel> { private FrameworkElement RootAppElement => (FrameworkElement)MainWindow.Instance.Content; public FileTooLargeDialogViewModel ViewModel { get => (FileTooLargeDialogViewModel)DataContext; set => DataContext = value; } public FileTooLargeDialog() { InitializeComponent(); } public new async Task<DialogResult> ShowAsync() { return (DialogResult)await SetContentDialogRoot(this).TryShowAsync(); } // WINUI3 private ContentDialog SetContentDialogRoot(ContentDialog contentDialog) { if (Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) contentDialog.XamlRoot = MainWindow.Instance.Content.XamlRoot; return contentDialog; } } }