/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/UserControls/Menus/MenuFlyoutItemWithImage.xaml.cs
33 строки
1014 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; using Microsoft.UI.Xaml.Media.Imaging; // The User Control element template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 namespace Files.App.UserControls { public sealed partial class MenuFlyoutItemWithImage : MenuFlyoutItem { public BitmapImage BitmapIcon { get { return (BitmapImage)GetValue(BitmapIconProperty); } set { SetValue(BitmapIconProperty, value); } } public static readonly DependencyProperty BitmapIconProperty = DependencyProperty.Register("BitmapIcon", typeof(BitmapImage), typeof(MenuFlyoutItemWithImage), new PropertyMetadata(null, OnBitmapIconChanged)); private static void OnBitmapIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as MenuFlyoutItem).Icon = e.NewValue is not null ? new IconSourceElement() : null; } public MenuFlyoutItemWithImage() { InitializeComponent(); } } }