diff --git a/docs/codesnippet/Rtf/RtfDocumentProcessor.cs b/docs/codesnippet/Rtf/RtfDocumentProcessor.cs index c2104547d..35fd8e2ea 100644 --- a/docs/codesnippet/Rtf/RtfDocumentProcessor.cs +++ b/docs/codesnippet/Rtf/RtfDocumentProcessor.cs @@ -51,7 +51,7 @@ public FileModel Load(FileAndType file, ImmutableDictionary meta EnvironmentContext.FileAbstractLayer.GetPhysicalPath(file.File) ); - return new FileModel(file, content) { LocalPathFromRoot = localPathFromRoot, }; + return new FileModel(file, content) { LocalPathFromRoot = localPathFromRoot }; } #endregion diff --git a/samples/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml.cs b/samples/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml.cs index 53bcf80c3..5905e2e6a 100644 --- a/samples/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml.cs +++ b/samples/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml.cs @@ -41,7 +41,7 @@ private void InitializeData() (byte)random.Next(0, 250), (byte)random.Next(0, 250) ) - ) + ), } ); } diff --git a/samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml.cs b/samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml.cs index 40eba0dc5..19ae1288a 100644 --- a/samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml.cs +++ b/samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml.cs @@ -27,15 +27,14 @@ private async void OnShowDialogClick(object sender, RoutedEventArgs e) private async Task ShowSampleDialogAsync() { // Defining dialog object - ContentDialog myDialog = - new() - { - Title = "My sample dialog", - Content = "Content of the dialog", - CloseButtonText = "Close button", - PrimaryButtonText = "Primary button", - SecondaryButtonText = "Secondary button" - }; + ContentDialog myDialog = new() + { + Title = "My sample dialog", + Content = "Content of the dialog", + CloseButtonText = "Close button", + PrimaryButtonText = "Primary button", + SecondaryButtonText = "Secondary button", + }; // Setting the dialog container myDialog.DialogHost = ContentPresenterForDialogs; diff --git a/samples/Wpf.Ui.Demo.Mvvm/ViewModels/DataViewModel.cs b/samples/Wpf.Ui.Demo.Mvvm/ViewModels/DataViewModel.cs index cbe43ff9c..8c941576f 100644 --- a/samples/Wpf.Ui.Demo.Mvvm/ViewModels/DataViewModel.cs +++ b/samples/Wpf.Ui.Demo.Mvvm/ViewModels/DataViewModel.cs @@ -40,7 +40,7 @@ private void InitializeViewModel() (byte)random.Next(0, 250), (byte)random.Next(0, 250) ) - ) + ), } ); } diff --git a/samples/Wpf.Ui.Demo.Mvvm/ViewModels/MainWindowViewModel.cs b/samples/Wpf.Ui.Demo.Mvvm/ViewModels/MainWindowViewModel.cs index 079533861..c1767cd17 100644 --- a/samples/Wpf.Ui.Demo.Mvvm/ViewModels/MainWindowViewModel.cs +++ b/samples/Wpf.Ui.Demo.Mvvm/ViewModels/MainWindowViewModel.cs @@ -47,13 +47,13 @@ private void InitializeViewModel() { Content = "Home", Icon = new SymbolIcon { Symbol = SymbolRegular.Home24 }, - TargetPageType = typeof(Views.Pages.DashboardPage) + TargetPageType = typeof(Views.Pages.DashboardPage), }, new NavigationViewItem() { Content = "Data", Icon = new SymbolIcon { Symbol = SymbolRegular.DataHistogram24 }, - TargetPageType = typeof(Views.Pages.DataPage) + TargetPageType = typeof(Views.Pages.DataPage), }, ]; @@ -63,7 +63,7 @@ private void InitializeViewModel() { Content = "Settings", Icon = new SymbolIcon { Symbol = SymbolRegular.Settings24 }, - TargetPageType = typeof(Views.Pages.SettingsPage) + TargetPageType = typeof(Views.Pages.SettingsPage), }, ]; diff --git a/samples/Wpf.Ui.Demo.Simple/Views/Pages/DataPage.xaml.cs b/samples/Wpf.Ui.Demo.Simple/Views/Pages/DataPage.xaml.cs index 99dc09c0b..dcc623b84 100644 --- a/samples/Wpf.Ui.Demo.Simple/Views/Pages/DataPage.xaml.cs +++ b/samples/Wpf.Ui.Demo.Simple/Views/Pages/DataPage.xaml.cs @@ -41,7 +41,7 @@ private void InitializeData() (byte)random.Next(0, 250), (byte)random.Next(0, 250) ) - ) + ), } ); } diff --git a/src/Wpf.Ui.Gallery/Controls/PageControlDocumentation.xaml.cs b/src/Wpf.Ui.Gallery/Controls/PageControlDocumentation.xaml.cs index 6e0d1d9bd..630c027ea 100644 --- a/src/Wpf.Ui.Gallery/Controls/PageControlDocumentation.xaml.cs +++ b/src/Wpf.Ui.Gallery/Controls/PageControlDocumentation.xaml.cs @@ -151,11 +151,12 @@ private void OnClick(string? param) string navigationUrl = param switch { - "doc" when GetDocumentationType(_page) is { } documentationType - => CreateUrlForDocumentation(documentationType), + "doc" when GetDocumentationType(_page) is { } documentationType => CreateUrlForDocumentation( + documentationType + ), "xaml" => CreateUrlForGithub(_page.GetType(), ".xaml"), "c#" => CreateUrlForGithub(_page.GetType(), ".xaml.cs"), - _ => string.Empty + _ => string.Empty, }; if (string.IsNullOrEmpty(navigationUrl)) diff --git a/src/Wpf.Ui.Gallery/Helpers/PaneDisplayModeToIndexConverter.cs b/src/Wpf.Ui.Gallery/Helpers/PaneDisplayModeToIndexConverter.cs index 23bbf4a9e..6c638ed36 100644 --- a/src/Wpf.Ui.Gallery/Helpers/PaneDisplayModeToIndexConverter.cs +++ b/src/Wpf.Ui.Gallery/Helpers/PaneDisplayModeToIndexConverter.cs @@ -16,7 +16,7 @@ public object Convert(object? value, Type targetType, object? parameter, Culture NavigationViewPaneDisplayMode.LeftFluent => 1, NavigationViewPaneDisplayMode.Top => 2, NavigationViewPaneDisplayMode.Bottom => 3, - _ => 0 + _ => 0, }; } @@ -27,7 +27,7 @@ public object ConvertBack(object? value, Type targetType, object? parameter, Cul 1 => NavigationViewPaneDisplayMode.LeftFluent, 2 => NavigationViewPaneDisplayMode.Top, 3 => NavigationViewPaneDisplayMode.Bottom, - _ => NavigationViewPaneDisplayMode.Left + _ => NavigationViewPaneDisplayMode.Left, }; } } diff --git a/src/Wpf.Ui.Gallery/Models/Unit.cs b/src/Wpf.Ui.Gallery/Models/Unit.cs index 6144ab902..065a10000 100644 --- a/src/Wpf.Ui.Gallery/Models/Unit.cs +++ b/src/Wpf.Ui.Gallery/Models/Unit.cs @@ -9,5 +9,5 @@ public enum Unit { Grams, Kilograms, - Milliliters + Milliliters, } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/AllControlsViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/AllControlsViewModel.cs index 8aae53d39..0eea3970d 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/AllControlsViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/AllControlsViewModel.cs @@ -19,7 +19,7 @@ public partial class AllControlsViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) .OrderBy(x => x.Name) ); diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/BasicInputViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/BasicInputViewModel.cs index 01e60cf6d..c1a82aa73 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/BasicInputViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/BasicInputViewModel.cs @@ -20,7 +20,7 @@ public partial class BasicInputViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/CheckBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/CheckBoxViewModel.cs index ab53742e4..19704a0dd 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/CheckBoxViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/CheckBoxViewModel.cs @@ -53,10 +53,9 @@ private void OnSingleChecked(string option) bool allUnchecked = !OptionOneCheckBoxChecked && !OptionTwoCheckBoxChecked && !OptionThreeCheckBoxChecked; - SelectAllCheckBoxChecked = allChecked - ? true - : allUnchecked - ? false - : (bool?)null; + SelectAllCheckBoxChecked = + allChecked ? true + : allUnchecked ? false + : (bool?)null; } } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ComboBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ComboBoxViewModel.cs index d2a941272..9856fb18b 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ComboBoxViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ComboBoxViewModel.cs @@ -13,7 +13,7 @@ public partial class ComboBoxViewModel : ViewModel "Arial", "Comic Sans MS", "Segoe UI", - "Times New Roman" + "Times New Roman", ]; [ObservableProperty] @@ -32,6 +32,6 @@ public partial class ComboBoxViewModel : ViewModel 28, 36, 48, - 72 + 72, ]; } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ThumbRateViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ThumbRateViewModel.cs index 1253e33fd..2e35c0cf1 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ThumbRateViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/BasicInput/ThumbRateViewModel.cs @@ -26,7 +26,7 @@ public ThumbRateState ThumbRateState { ThumbRateState.Liked => "Liked", ThumbRateState.Disliked => "Disliked", - _ => "None" + _ => "None", }; ThumRateStateCodeText = $""; diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/CollectionsViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/CollectionsViewModel.cs index 823ff479b..fad839bdf 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/CollectionsViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/CollectionsViewModel.cs @@ -20,7 +20,7 @@ public partial class CollectionsViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/DataGridViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/DataGridViewModel.cs index fa30d78bc..9551d06a3 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/DataGridViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/DataGridViewModel.cs @@ -35,7 +35,7 @@ private static ObservableCollection GenerateProducts() Unit = units[random.Next(0, units.Length)], UnitPrice = Math.Round(random.NextDouble() * 20.0, 3), UnitsInStock = random.Next(0, 100), - IsVirtual = random.Next(0, 2) == 1 + IsVirtual = random.Next(0, 2) == 1, } ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/ListBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/ListBoxViewModel.cs index 78ff39e9b..5114f48fd 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/ListBoxViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/ListBoxViewModel.cs @@ -14,6 +14,6 @@ public partial class ListBoxViewModel : ViewModel "Comic Sans MS", "Courier New", "Segoe UI", - "Times New Roman" + "Times New Roman", ]; } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/ListViewViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/ListViewViewModel.cs index fb6a222e5..34ef73a3a 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/ListViewViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Collections/ListViewViewModel.cs @@ -48,7 +48,7 @@ private static ObservableCollection GeneratePersons() "Arielle", "Arielle", "Jamie", - "Alexzander" + "Alexzander", }; var surnames = new[] { @@ -64,7 +64,7 @@ private static ObservableCollection GeneratePersons() "Banks", "Hood", "Fry", - "Carroll" + "Carroll", }; var companies = new[] { @@ -74,7 +74,7 @@ private static ObservableCollection GeneratePersons() "Megabyte Computers Inc", "Roude Mics", "XD Projekt Red S.A.", - "Lepo.co" + "Lepo.co", }; for (int i = 0; i < 50; i++) @@ -97,7 +97,7 @@ private void UpdateListViewSelectionMode(int selectionModeIndex) { 1 => SelectionMode.Multiple, 2 => SelectionMode.Extended, - _ => SelectionMode.Single + _ => SelectionMode.Single, }; } } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DateAndTime/DateAndTimeViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DateAndTime/DateAndTimeViewModel.cs index 166dd1870..5d5d5ac77 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/DateAndTime/DateAndTimeViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DateAndTime/DateAndTimeViewModel.cs @@ -20,7 +20,7 @@ public partial class DateAndTimeViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DesignGuidance/IconsViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DesignGuidance/IconsViewModel.cs index 51a3a97de..6bbf85181 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/DesignGuidance/IconsViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DesignGuidance/IconsViewModel.cs @@ -73,7 +73,7 @@ public IconsViewModel() Name = iconName, Icon = icon, Symbol = ((char)icon).ToString(), - Code = ((int)icon).ToString("X4") + Code = ((int)icon).ToString("X4"), } ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/ContentDialogViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/ContentDialogViewModel.cs index 66756260d..aa23b3fde 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/ContentDialogViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/ContentDialogViewModel.cs @@ -32,7 +32,7 @@ private async Task OnShowDialog(object content) { ContentDialogResult.Primary => "User saved their work", ContentDialogResult.Secondary => "User did not save their work", - _ => "User cancelled the dialog" + _ => "User cancelled the dialog", }; } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogsAndFlyoutsViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogsAndFlyoutsViewModel.cs index 892da7468..b9404a455 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogsAndFlyoutsViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/DialogsAndFlyoutsViewModel.cs @@ -20,7 +20,7 @@ public partial class DialogsAndFlyoutsViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/SnackbarViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/SnackbarViewModel.cs index 7b8db4ece..7c6b386dc 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/SnackbarViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/DialogsAndFlyouts/SnackbarViewModel.cs @@ -50,7 +50,7 @@ private void UpdateSnackbarAppearance(int appearanceIndex) 6 => ControlAppearance.Light, 7 => ControlAppearance.Dark, 8 => ControlAppearance.Transparent, - _ => ControlAppearance.Primary + _ => ControlAppearance.Primary, }; } } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/LayoutViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/LayoutViewModel.cs index 975aff3be..4e1778e70 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/LayoutViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/LayoutViewModel.cs @@ -20,7 +20,7 @@ public partial class LayoutViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/MediaViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/MediaViewModel.cs index 527a880e7..4840a6537 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/MediaViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Media/MediaViewModel.cs @@ -20,7 +20,7 @@ public partial class MediaViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/BreadcrumbBarViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/BreadcrumbBarViewModel.cs index 9bf739c56..2ad7cf6d7 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/BreadcrumbBarViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/BreadcrumbBarViewModel.cs @@ -27,7 +27,7 @@ public partial class BreadcrumbBarViewModel : ViewModel "Images", "Folder1", "Folder2", - "Folder3" + "Folder3", ]; [ObservableProperty] diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewModel.cs index cfb96f614..55a794ac0 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Navigation/NavigationViewModel.cs @@ -20,7 +20,7 @@ public partial class NavigationViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/OpSystem/FilePickerViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/OpSystem/FilePickerViewModel.cs index 5414ae842..6c860e820 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/OpSystem/FilePickerViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/OpSystem/FilePickerViewModel.cs @@ -50,12 +50,11 @@ public void OnOpenFile() { OpenedFilePathVisibility = Visibility.Collapsed; - OpenFileDialog openFileDialog = - new() - { - InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), - Filter = "All files (*.*)|*.*" - }; + OpenFileDialog openFileDialog = new() + { + InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), + Filter = "All files (*.*)|*.*", + }; if (openFileDialog.ShowDialog() != true) { @@ -76,12 +75,11 @@ public void OnOpenPicture() { OpenedPicturePathVisibility = Visibility.Collapsed; - OpenFileDialog openFileDialog = - new() - { - InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), - Filter = "Image files (*.bmp;*.jpg;*.jpeg;*.png)|*.bmp;*.jpg;*.jpeg;*.png|All files (*.*)|*.*" - }; + OpenFileDialog openFileDialog = new() + { + InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), + Filter = "Image files (*.bmp;*.jpg;*.jpeg;*.png)|*.bmp;*.jpg;*.jpeg;*.png|All files (*.*)|*.*", + }; if (openFileDialog.ShowDialog() != true) { @@ -102,13 +100,12 @@ public void OnOpenMultiple() { OpenedMultiplePathVisibility = Visibility.Collapsed; - OpenFileDialog openFileDialog = - new() - { - Multiselect = true, - InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), - Filter = "All files (*.*)|*.*" - }; + OpenFileDialog openFileDialog = new() + { + Multiselect = true, + InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), + Filter = "All files (*.*)|*.*", + }; if (openFileDialog.ShowDialog() != true) { @@ -132,12 +129,11 @@ public void OnOpenFolder() #if NET8_0_OR_GREATER OpenedFolderPathVisibility = Visibility.Collapsed; - OpenFolderDialog openFolderDialog = - new() - { - Multiselect = true, - InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) - }; + OpenFolderDialog openFolderDialog = new() + { + Multiselect = true, + InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), + }; if (openFolderDialog.ShowDialog() != true) { @@ -162,12 +158,11 @@ public async Task OnSaveFile(CancellationToken cancellation) { SavedFileNoticeVisibility = Visibility.Collapsed; - SaveFileDialog saveFileDialog = - new() - { - Filter = "Text Files (*.txt)|*.txt", - InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) - }; + SaveFileDialog saveFileDialog = new() + { + Filter = "Text Files (*.txt)|*.txt", + InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), + }; if (!string.IsNullOrEmpty(FileToSaveName)) { diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/OpSystem/OpSystemViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/OpSystem/OpSystemViewModel.cs index d52cd68fb..9c6ddc2cc 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/OpSystem/OpSystemViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/OpSystem/OpSystemViewModel.cs @@ -20,7 +20,7 @@ public partial class OpSystemViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBadgeViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBadgeViewModel.cs index 309f99cd0..fde1b1938 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBadgeViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBadgeViewModel.cs @@ -32,7 +32,7 @@ private static InfoBadgeSeverity ConvertIndexToInfoBadgeSeverity(int value) 2 => InfoBadgeSeverity.Success, 3 => InfoBadgeSeverity.Caution, 4 => InfoBadgeSeverity.Critical, - _ => InfoBadgeSeverity.Attention + _ => InfoBadgeSeverity.Attention, }; } } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBarViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBarViewModel.cs index 0ffae8af4..175312379 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBarViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBarViewModel.cs @@ -54,7 +54,7 @@ private static InfoBarSeverity ConvertIndexToInfoBarSeverity(int value) 1 => InfoBarSeverity.Success, 2 => InfoBarSeverity.Warning, 3 => InfoBarSeverity.Error, - _ => InfoBarSeverity.Informational + _ => InfoBarSeverity.Informational, }; } } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/StatusAndInfoViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/StatusAndInfoViewModel.cs index 1fafb8ddc..eb0acfd75 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/StatusAndInfoViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/StatusAndInfoViewModel.cs @@ -20,7 +20,7 @@ public partial class StatusAndInfoViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/AutoSuggestBoxViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/AutoSuggestBoxViewModel.cs index 932cc4f20..6389a2313 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/AutoSuggestBoxViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/AutoSuggestBoxViewModel.cs @@ -8,22 +8,21 @@ namespace Wpf.Ui.Gallery.ViewModels.Pages.Text; public partial class AutoSuggestBoxViewModel : ViewModel { [ObservableProperty] - private List _autoSuggestBoxSuggestions = - new() - { - "John", - "Winston", - "Adrianna", - "Spencer", - "Phoebe", - "Lucas", - "Carl", - "Marissa", - "Brandon", - "Antoine", - "Arielle", - "Arielle", - "Jamie", - "Alexzander" - }; + private List _autoSuggestBoxSuggestions = new() + { + "John", + "Winston", + "Adrianna", + "Spencer", + "Phoebe", + "Lucas", + "Carl", + "Marissa", + "Brandon", + "Antoine", + "Arielle", + "Arielle", + "Jamie", + "Alexzander", + }; } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextViewModel.cs index f2b533ae2..466875d2a 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Pages/Text/TextViewModel.cs @@ -20,7 +20,7 @@ public partial class TextViewModel : ViewModel Name = x.Name, Icon = x.Icon, Description = x.Description, - PageType = x.PageType + PageType = x.PageType, }) ); } diff --git a/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs b/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs index c6101117e..8132dd717 100644 --- a/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs +++ b/src/Wpf.Ui.Gallery/ViewModels/Windows/MainWindowViewModel.cs @@ -41,8 +41,8 @@ public partial class MainWindowViewModel(IStringLocalizer localize { new NavigationViewItem("Typography", SymbolRegular.TextFont24, typeof(TypographyPage)), new NavigationViewItem("Icons", SymbolRegular.Diversity24, typeof(IconsPage)), - new NavigationViewItem("Colors", SymbolRegular.Color24, typeof(ColorsPage)) - } + new NavigationViewItem("Colors", SymbolRegular.Color24, typeof(ColorsPage)), + }, }, new NavigationViewItem("All samples", SymbolRegular.List24, typeof(AllControlsPage)), new NavigationViewItemSeparator(), @@ -63,7 +63,7 @@ public partial class MainWindowViewModel(IStringLocalizer localize new NavigationViewItem(nameof(ThumbRate), typeof(ThumbRatePage)), new NavigationViewItem(nameof(SplitButton), typeof(SplitButtonPage)), new NavigationViewItem(nameof(Slider), typeof(SliderPage)), - } + }, }, new NavigationViewItem { @@ -79,7 +79,7 @@ public partial class MainWindowViewModel(IStringLocalizer localize #if DEBUG new NavigationViewItem("TreeList", typeof(TreeListPage)), #endif - } + }, }, new NavigationViewItem("Date & time", SymbolRegular.CalendarClock24, typeof(DateAndTimePage)) { @@ -88,8 +88,8 @@ public partial class MainWindowViewModel(IStringLocalizer localize new NavigationViewItem(nameof(CalendarDatePicker), typeof(CalendarDatePickerPage)), new NavigationViewItem(nameof(System.Windows.Controls.Calendar), typeof(CalendarPage)), new NavigationViewItem(nameof(DatePicker), typeof(DatePickerPage)), - new NavigationViewItem(nameof(TimePicker), typeof(TimePickerPage)) - } + new NavigationViewItem(nameof(TimePicker), typeof(TimePickerPage)), + }, }, new NavigationViewItem("Dialogs & flyouts", SymbolRegular.Chat24, typeof(DialogsAndFlyoutsPage)) { @@ -99,7 +99,7 @@ public partial class MainWindowViewModel(IStringLocalizer localize new NavigationViewItem(nameof(ContentDialog), typeof(ContentDialogPage)), new NavigationViewItem(nameof(Flyout), typeof(FlyoutPage)), new NavigationViewItem(nameof(Wpf.Ui.Controls.MessageBox), typeof(MessageBoxPage)), - } + }, }, #if DEBUG new NavigationViewItem("Layout", SymbolRegular.News24, typeof(LayoutPage)) @@ -108,7 +108,7 @@ public partial class MainWindowViewModel(IStringLocalizer localize { new NavigationViewItem("Expander", typeof(ExpanderPage)), new NavigationViewItem("CardControl", typeof(CardControlPage)), - new NavigationViewItem("CardAction", typeof(CardActionPage)) + new NavigationViewItem("CardAction", typeof(CardActionPage)), }, }, #endif @@ -122,8 +122,8 @@ public partial class MainWindowViewModel(IStringLocalizer localize new NavigationViewItem("Image", typeof(ImagePage)), new NavigationViewItem("Canvas", typeof(CanvasPage)), new NavigationViewItem("WebView", typeof(WebViewPage)), - new NavigationViewItem("WebBrowser", typeof(WebBrowserPage)) - } + new NavigationViewItem("WebBrowser", typeof(WebBrowserPage)), + }, }, new NavigationViewItem("Navigation", SymbolRegular.Navigation24, typeof(NavigationPage)) { @@ -133,8 +133,8 @@ public partial class MainWindowViewModel(IStringLocalizer localize new NavigationViewItem("NavigationView", typeof(NavigationViewPage)), new NavigationViewItem("Menu", typeof(MenuPage)), new NavigationViewItem("Multilevel navigation", typeof(MultilevelNavigationPage)), - new NavigationViewItem("TabControl", typeof(TabControlPage)) - } + new NavigationViewItem("TabControl", typeof(TabControlPage)), + }, }, new NavigationViewItem( "Status & info", @@ -148,8 +148,8 @@ public partial class MainWindowViewModel(IStringLocalizer localize new NavigationViewItem("InfoBar", typeof(InfoBarPage)), new NavigationViewItem("ProgressBar", typeof(ProgressBarPage)), new NavigationViewItem("ProgressRing", typeof(ProgressRingPage)), - new NavigationViewItem("ToolTip", typeof(ToolTipPage)) - } + new NavigationViewItem("ToolTip", typeof(ToolTipPage)), + }, }, new NavigationViewItem("Text", SymbolRegular.DrawText24, typeof(TextPage)) { @@ -162,7 +162,7 @@ public partial class MainWindowViewModel(IStringLocalizer localize new NavigationViewItem(nameof(Label), typeof(LabelPage)), new NavigationViewItem(nameof(Wpf.Ui.Controls.TextBlock), typeof(TextBlockPage)), new NavigationViewItem(nameof(Wpf.Ui.Controls.TextBox), typeof(TextBoxPage)), - } + }, }, new NavigationViewItem("System", SymbolRegular.Desktop24, typeof(OpSystemPage)) { @@ -170,21 +170,21 @@ public partial class MainWindowViewModel(IStringLocalizer localize { new NavigationViewItem("Clipboard", typeof(ClipboardPage)), new NavigationViewItem("FilePicker", typeof(FilePickerPage)), - } + }, }, - new NavigationViewItem("Windows", SymbolRegular.WindowApps24, typeof(WindowsPage)) + new NavigationViewItem("Windows", SymbolRegular.WindowApps24, typeof(WindowsPage)), ]; [ObservableProperty] private ObservableCollection _footerMenuItems = [ - new NavigationViewItem("Settings", SymbolRegular.Settings24, typeof(SettingsPage)) + new NavigationViewItem("Settings", SymbolRegular.Settings24, typeof(SettingsPage)), ]; [ObservableProperty] private ObservableCollection _trayMenuItems = [ new Wpf.Ui.Controls.MenuItem { Header = "Home", Tag = "tray_home" }, - new Wpf.Ui.Controls.MenuItem { Header = "Close", Tag = "tray_close" } + new Wpf.Ui.Controls.MenuItem { Header = "Close", Tag = "tray_close" }, ]; } diff --git a/src/Wpf.Ui.Gallery/Views/Windows/SandboxWindow.xaml.cs b/src/Wpf.Ui.Gallery/Views/Windows/SandboxWindow.xaml.cs index 1046f73bb..965f18085 100644 --- a/src/Wpf.Ui.Gallery/Views/Windows/SandboxWindow.xaml.cs +++ b/src/Wpf.Ui.Gallery/Views/Windows/SandboxWindow.xaml.cs @@ -26,7 +26,7 @@ public SandboxWindow(SandboxWindowViewModel viewModel) NavigationView.MenuItemsSourceProperty, new ObservableCollection() { - new NavigationViewItem("Home", SymbolRegular.Home24, typeof(SamplePage1)) + new NavigationViewItem("Home", SymbolRegular.Home24, typeof(SamplePage1)), } ); diff --git a/src/Wpf.Ui.SyntaxHighlight/Controls/CodeBlock.cs b/src/Wpf.Ui.SyntaxHighlight/Controls/CodeBlock.cs index 924712579..3650ee772 100644 --- a/src/Wpf.Ui.SyntaxHighlight/Controls/CodeBlock.cs +++ b/src/Wpf.Ui.SyntaxHighlight/Controls/CodeBlock.cs @@ -88,7 +88,7 @@ protected virtual void UpdateSyntax() VerticalContentAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Left, - HorizontalContentAlignment = HorizontalAlignment.Left + HorizontalContentAlignment = HorizontalAlignment.Left, }; richTextBox.Document.Blocks.Clear(); diff --git a/src/Wpf.Ui.SyntaxHighlight/SyntaxLanguage.cs b/src/Wpf.Ui.SyntaxHighlight/SyntaxLanguage.cs index e0b7becd6..79ce3199d 100644 --- a/src/Wpf.Ui.SyntaxHighlight/SyntaxLanguage.cs +++ b/src/Wpf.Ui.SyntaxHighlight/SyntaxLanguage.cs @@ -12,5 +12,5 @@ internal enum SyntaxLanguage { Autodetect, XAML, - CSHARP + CSHARP, } diff --git a/src/Wpf.Ui.Tray/Interop/User32.cs b/src/Wpf.Ui.Tray/Interop/User32.cs index 1a1482e79..2c41c2530 100644 --- a/src/Wpf.Ui.Tray/Interop/User32.cs +++ b/src/Wpf.Ui.Tray/Interop/User32.cs @@ -186,7 +186,7 @@ public enum WM_NCHITTEST HTSIZELAST = HTBOTTOMRIGHT, HTOBJECT = 19, HTCLOSE = 20, - HTHELP = 21 + HTHELP = 21, } /// @@ -246,7 +246,7 @@ public enum GWL /// /// Sets the new address of the dialog box procedure. /// - DWLP_DLGPROC = 0x4 + DWLP_DLGPROC = 0x4, } /// @@ -284,7 +284,7 @@ public enum WCA WCA_CORNER_STYLE = 27, WCA_PART_COLOR = 28, WCA_DISABLE_MOVESIZE_FEEDBACK = 29, - WCA_LAST = 30 + WCA_LAST = 30, } [Flags] @@ -294,7 +294,7 @@ public enum ACCENT_FLAGS DrawTopBorder = 0x40, DrawRightBorder = 0x80, DrawBottomBorder = 0x100, - DrawAllBorders = DrawLeftBorder | DrawTopBorder | DrawRightBorder | DrawBottomBorder + DrawAllBorders = DrawLeftBorder | DrawTopBorder | DrawRightBorder | DrawBottomBorder, } /// @@ -307,7 +307,7 @@ public enum ACCENT_STATE ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, ACCENT_ENABLE_BLURBEHIND = 3, ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, - ACCENT_INVALID_STATE = 5 + ACCENT_INVALID_STATE = 5, } /// @@ -348,7 +348,7 @@ public enum CS : uint BYTEALIGNWINDOW = 0x2000, GLOBALCLASS = 0x4000, IME = 0x00010000, - DROPSHADOW = 0x00020000 + DROPSHADOW = 0x00020000, } /// diff --git a/src/Wpf.Ui.Tray/TrayManager.cs b/src/Wpf.Ui.Tray/TrayManager.cs index 2f1055429..67b4c12bc 100644 --- a/src/Wpf.Ui.Tray/TrayManager.cs +++ b/src/Wpf.Ui.Tray/TrayManager.cs @@ -79,7 +79,7 @@ public static bool Register(INotifyIcon notifyIcon, HwndSource? parentSource) parentSource.Handle ) { - ElementId = notifyIcon.Id + ElementId = notifyIcon.Id, }; notifyIcon.ShellIconData = new Interop.Shell32.NOTIFYICONDATA @@ -88,7 +88,7 @@ public static bool Register(INotifyIcon notifyIcon, HwndSource? parentSource) uFlags = Interop.Shell32.NIF.MESSAGE, uCallbackMessage = (int)Interop.User32.WM.TRAYMOUSEMESSAGE, hWnd = notifyIcon.HookWindow.Handle, - dwState = 0x2 + dwState = 0x2, }; if (!string.IsNullOrEmpty(notifyIcon.TooltipText)) diff --git a/src/Wpf.Ui/Appearance/ApplicationTheme.cs b/src/Wpf.Ui/Appearance/ApplicationTheme.cs index 192e26a61..318a17c06 100644 --- a/src/Wpf.Ui/Appearance/ApplicationTheme.cs +++ b/src/Wpf.Ui/Appearance/ApplicationTheme.cs @@ -28,5 +28,5 @@ public enum ApplicationTheme /// /// High contract application theme. /// - HighContrast + HighContrast, } diff --git a/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs b/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs index 74641fa12..f6161fc9f 100644 --- a/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs +++ b/src/Wpf.Ui/Appearance/ApplicationThemeManager.cs @@ -235,11 +235,15 @@ public static bool IsAppMatchesSystem() return appApplicationTheme switch { - ApplicationTheme.Dark - => sysTheme is SystemTheme.Dark or SystemTheme.CapturedMotion or SystemTheme.Glow, - ApplicationTheme.Light - => sysTheme is SystemTheme.Light or SystemTheme.Flow or SystemTheme.Sunrise, - _ => appApplicationTheme == ApplicationTheme.HighContrast && SystemThemeManager.HighContrast + ApplicationTheme.Dark => sysTheme + is SystemTheme.Dark + or SystemTheme.CapturedMotion + or SystemTheme.Glow, + ApplicationTheme.Light => sysTheme + is SystemTheme.Light + or SystemTheme.Flow + or SystemTheme.Sunrise, + _ => appApplicationTheme == ApplicationTheme.HighContrast && SystemThemeManager.HighContrast, }; } diff --git a/src/Wpf.Ui/Appearance/ResourceDictionaryManager.cs b/src/Wpf.Ui/Appearance/ResourceDictionaryManager.cs index db28301af..269230684 100644 --- a/src/Wpf.Ui/Appearance/ResourceDictionaryManager.cs +++ b/src/Wpf.Ui/Appearance/ResourceDictionaryManager.cs @@ -113,7 +113,10 @@ public bool UpdateDictionary(string resourceLookup, Uri? newResourceUri) { sourceUri = applicationDictionaries[i].Source.ToString(); - if (sourceUri.Contains(SearchNamespace, StringComparison.OrdinalIgnoreCase) && sourceUri.Contains(resourceLookup, StringComparison.OrdinalIgnoreCase)) + if ( + sourceUri.Contains(SearchNamespace, StringComparison.OrdinalIgnoreCase) + && sourceUri.Contains(resourceLookup, StringComparison.OrdinalIgnoreCase) + ) { applicationDictionaries[i] = new() { Source = newResourceUri }; @@ -128,12 +131,12 @@ public bool UpdateDictionary(string resourceLookup, Uri? newResourceUri) continue; } - sourceUri = applicationDictionaries[i] - .MergedDictionaries[j] - .Source - .ToString(); + sourceUri = applicationDictionaries[i].MergedDictionaries[j].Source.ToString(); - if (!sourceUri.Contains(SearchNamespace, StringComparison.OrdinalIgnoreCase) || !sourceUri.Contains(resourceLookup, StringComparison.OrdinalIgnoreCase)) + if ( + !sourceUri.Contains(SearchNamespace, StringComparison.OrdinalIgnoreCase) + || !sourceUri.Contains(resourceLookup, StringComparison.OrdinalIgnoreCase) + ) { continue; } diff --git a/src/Wpf.Ui/Appearance/SystemTheme.cs b/src/Wpf.Ui/Appearance/SystemTheme.cs index 23cee95c1..238e5472e 100644 --- a/src/Wpf.Ui/Appearance/SystemTheme.cs +++ b/src/Wpf.Ui/Appearance/SystemTheme.cs @@ -68,5 +68,5 @@ public enum SystemTheme /// /// Light theme: Flow /// - Flow + Flow, } diff --git a/src/Wpf.Ui/Controls/Arc/Arc.cs b/src/Wpf.Ui/Controls/Arc/Arc.cs index c668584a7..85dd425e1 100644 --- a/src/Wpf.Ui/Controls/Arc/Arc.cs +++ b/src/Wpf.Ui/Controls/Arc/Arc.cs @@ -235,12 +235,11 @@ protected override Size ArrangeOverride(Size finalSize) protected override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); - Pen pen = - new(Stroke, StrokeThickness) - { - StartLineCap = StrokeStartLineCap, - EndLineCap = StrokeStartLineCap - }; + Pen pen = new(Stroke, StrokeThickness) + { + StartLineCap = StrokeStartLineCap, + EndLineCap = StrokeStartLineCap, + }; drawingContext.DrawGeometry(Stroke, pen, DefinedGeometry()); } diff --git a/src/Wpf.Ui/Controls/AutoSuggestBox/AutoSuggestBox.cs b/src/Wpf.Ui/Controls/AutoSuggestBox/AutoSuggestBox.cs index bc80dd74e..5743e07a2 100644 --- a/src/Wpf.Ui/Controls/AutoSuggestBox/AutoSuggestBox.cs +++ b/src/Wpf.Ui/Controls/AutoSuggestBox/AutoSuggestBox.cs @@ -358,7 +358,7 @@ protected virtual void OnQuerySubmitted(string queryText) { var args = new AutoSuggestBoxQuerySubmittedEventArgs(QuerySubmittedEvent, this) { - QueryText = queryText + QueryText = queryText, }; RaiseEvent(args); @@ -372,7 +372,7 @@ protected virtual void OnSuggestionChosen(object selectedItem) { var args = new AutoSuggestBoxSuggestionChosenEventArgs(SuggestionChosenEvent, this) { - SelectedItem = selectedItem + SelectedItem = selectedItem, }; RaiseEvent(args); @@ -393,7 +393,7 @@ protected virtual void OnTextChanged(AutoSuggestionBoxTextChangeReason reason, s var args = new AutoSuggestBoxTextChangedEventArgs(TextChangedEvent, this) { Reason = reason, - Text = text + Text = text, }; RaiseEvent(args); @@ -557,7 +557,9 @@ private void DefaultFiltering(string text) .Where(item => { var itemText = GetStringFromObj(item); - return splitText.All(key => itemText?.Contains(key, StringComparison.OrdinalIgnoreCase) ?? false); + return splitText.All(key => + itemText?.Contains(key, StringComparison.OrdinalIgnoreCase) ?? false + ); }) .ToList(); diff --git a/src/Wpf.Ui/Controls/CalendarDatePicker/CalendarDatePicker.cs b/src/Wpf.Ui/Controls/CalendarDatePicker/CalendarDatePicker.cs index 1267a64c0..9576843f3 100644 --- a/src/Wpf.Ui/Controls/CalendarDatePicker/CalendarDatePicker.cs +++ b/src/Wpf.Ui/Controls/CalendarDatePicker/CalendarDatePicker.cs @@ -117,7 +117,7 @@ private void InitializePopup() { Source = this, Mode = BindingMode.TwoWay, - UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged + UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, } ); _ = calendar.SetBinding( @@ -126,7 +126,7 @@ private void InitializePopup() { Source = this, Mode = BindingMode.TwoWay, - UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged + UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, } ); _ = calendar.SetBinding( @@ -135,7 +135,7 @@ private void InitializePopup() { Source = this, Mode = BindingMode.TwoWay, - UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged + UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, } ); @@ -151,7 +151,7 @@ private void InitializePopup() VerticalOffset = 1D, VerticalAlignment = VerticalAlignment.Center, PopupAnimation = PopupAnimation.None, - AllowsTransparency = true + AllowsTransparency = true, }; _ = _popup.SetBinding( @@ -160,7 +160,7 @@ private void InitializePopup() { Source = this, Mode = BindingMode.TwoWay, - UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged + UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, } ); } diff --git a/src/Wpf.Ui/Controls/CardAction/CardAction.cs b/src/Wpf.Ui/Controls/CardAction/CardAction.cs index 9614b8388..dac6f7554 100644 --- a/src/Wpf.Ui/Controls/CardAction/CardAction.cs +++ b/src/Wpf.Ui/Controls/CardAction/CardAction.cs @@ -55,4 +55,4 @@ protected override AutomationPeer OnCreateAutomationPeer() { return new CardActionAutomationPeer(this); } -} \ No newline at end of file +} diff --git a/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.cs b/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.cs index 292a8bf70..02ee306ba 100644 --- a/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.cs +++ b/src/Wpf.Ui/Controls/ContentDialog/ContentDialog.cs @@ -584,7 +584,7 @@ protected virtual void OnButtonClick(ContentDialogButton button) { var buttonClickEventArgs = new ContentDialogButtonClickEventArgs(ButtonClickedEvent, this) { - Button = button + Button = button, }; RaiseEvent(buttonClickEventArgs); @@ -593,7 +593,7 @@ protected virtual void OnButtonClick(ContentDialogButton button) { ContentDialogButton.Primary => ContentDialogResult.Primary, ContentDialogButton.Secondary => ContentDialogResult.Secondary, - _ => ContentDialogResult.None + _ => ContentDialogResult.None, }; Hide(result); diff --git a/src/Wpf.Ui/Controls/ContentDialog/ContentDialogButton.cs b/src/Wpf.Ui/Controls/ContentDialog/ContentDialogButton.cs index 790766578..512a86e9f 100644 --- a/src/Wpf.Ui/Controls/ContentDialog/ContentDialogButton.cs +++ b/src/Wpf.Ui/Controls/ContentDialog/ContentDialogButton.cs @@ -24,5 +24,5 @@ public enum ContentDialogButton /// /// The close button is the default. /// - Close + Close, } diff --git a/src/Wpf.Ui/Controls/ContentDialog/ContentDialogResult.cs b/src/Wpf.Ui/Controls/ContentDialog/ContentDialogResult.cs index 491b806a1..378c7be7e 100644 --- a/src/Wpf.Ui/Controls/ContentDialog/ContentDialogResult.cs +++ b/src/Wpf.Ui/Controls/ContentDialog/ContentDialogResult.cs @@ -24,5 +24,5 @@ public enum ContentDialogResult /// /// The secondary button was tapped by the user. /// - Secondary + Secondary, } diff --git a/src/Wpf.Ui/Controls/ContextMenu/ContextMenuLoader.xaml.cs b/src/Wpf.Ui/Controls/ContextMenu/ContextMenuLoader.xaml.cs index 46ce1a442..739e36492 100644 --- a/src/Wpf.Ui/Controls/ContextMenu/ContextMenuLoader.xaml.cs +++ b/src/Wpf.Ui/Controls/ContextMenu/ContextMenuLoader.xaml.cs @@ -42,13 +42,10 @@ private void AddEditorContextMenuDefaultStyle(Assembly currentAssembly) "System.Windows.Documents.TextEditorContextMenu+EditorContextMenu, " + currentAssembly ); - ResourceDictionary resourceDict = - new() - { - Source = new Uri( - "pack://application:,,,/Wpf.Ui;component/Controls/ContextMenu/ContextMenu.xaml" - ) - }; + ResourceDictionary resourceDict = new() + { + Source = new Uri("pack://application:,,,/Wpf.Ui;component/Controls/ContextMenu/ContextMenu.xaml"), + }; Style contextMenuStyle = (Style)resourceDict["UiContextMenu"]; diff --git a/src/Wpf.Ui/Controls/ControlAppearance.cs b/src/Wpf.Ui/Controls/ControlAppearance.cs index 301f5e520..3112fb704 100644 --- a/src/Wpf.Ui/Controls/ControlAppearance.cs +++ b/src/Wpf.Ui/Controls/ControlAppearance.cs @@ -53,5 +53,5 @@ public enum ControlAppearance /// /// Transparent color theme. /// - Transparent + Transparent, } diff --git a/src/Wpf.Ui/Controls/DataGrid/DataGrid.cs b/src/Wpf.Ui/Controls/DataGrid/DataGrid.cs index 77d0e7e73..1f170c8a9 100644 --- a/src/Wpf.Ui/Controls/DataGrid/DataGrid.cs +++ b/src/Wpf.Ui/Controls/DataGrid/DataGrid.cs @@ -59,13 +59,12 @@ public class DataGrid : System.Windows.Controls.DataGrid ); /// Identifies the dependency property. - public static readonly DependencyProperty TextColumnElementStyleProperty = - DependencyProperty.Register( - nameof(TextColumnElementStyle), - typeof(Style), - typeof(DataGrid), - new FrameworkPropertyMetadata(null) - ); + public static readonly DependencyProperty TextColumnElementStyleProperty = DependencyProperty.Register( + nameof(TextColumnElementStyle), + typeof(Style), + typeof(DataGrid), + new FrameworkPropertyMetadata(null) + ); /// Identifies the dependency property. public static readonly DependencyProperty TextColumnEditingElementStyleProperty = @@ -165,7 +164,11 @@ private void UpdateSingleColumn(DataGridColumn dataGridColumn) _ = BindingOperations.SetBinding( checkBoxColumn, DataGridBoundColumn.ElementStyleProperty, - new Binding { Path = new PropertyPath(CheckBoxColumnElementStyleProperty), Source = this } + new Binding + { + Path = new PropertyPath(CheckBoxColumnElementStyleProperty), + Source = this, + } ); } @@ -179,7 +182,8 @@ private void UpdateSingleColumn(DataGridColumn dataGridColumn) DataGridBoundColumn.EditingElementStyleProperty, new Binding { - Path = new PropertyPath(CheckBoxColumnEditingElementStyleProperty), Source = this + Path = new PropertyPath(CheckBoxColumnEditingElementStyleProperty), + Source = this, } ); } @@ -195,7 +199,11 @@ private void UpdateSingleColumn(DataGridColumn dataGridColumn) _ = BindingOperations.SetBinding( comboBoxColumn, DataGridBoundColumn.ElementStyleProperty, - new Binding { Path = new PropertyPath(ComboBoxColumnElementStyleProperty), Source = this } + new Binding + { + Path = new PropertyPath(ComboBoxColumnElementStyleProperty), + Source = this, + } ); } @@ -209,7 +217,8 @@ private void UpdateSingleColumn(DataGridColumn dataGridColumn) DataGridBoundColumn.EditingElementStyleProperty, new Binding { - Path = new PropertyPath(ComboBoxColumnEditingElementStyleProperty), Source = this + Path = new PropertyPath(ComboBoxColumnEditingElementStyleProperty), + Source = this, } ); } @@ -224,7 +233,8 @@ private void UpdateSingleColumn(DataGridColumn dataGridColumn) DataGridBoundColumn.EditingElementStyleProperty, new Binding { - Path = new PropertyPath(ComboBoxColumnEditingElementStyleProperty), Source = this + Path = new PropertyPath(ComboBoxColumnEditingElementStyleProperty), + Source = this, } ); } @@ -252,7 +262,11 @@ private void UpdateSingleColumn(DataGridColumn dataGridColumn) _ = BindingOperations.SetBinding( textBoxColumn, DataGridBoundColumn.EditingElementStyleProperty, - new Binding { Path = new PropertyPath(TextColumnEditingElementStyleProperty), Source = this } + new Binding + { + Path = new PropertyPath(TextColumnEditingElementStyleProperty), + Source = this, + } ); } diff --git a/src/Wpf.Ui/Controls/ElementPlacement.cs b/src/Wpf.Ui/Controls/ElementPlacement.cs index 76016e63d..4019e84f0 100644 --- a/src/Wpf.Ui/Controls/ElementPlacement.cs +++ b/src/Wpf.Ui/Controls/ElementPlacement.cs @@ -18,5 +18,5 @@ public enum ElementPlacement /// /// Puts the control element on the right. /// - Right + Right, } diff --git a/src/Wpf.Ui/Controls/FluentWindow/FluentWindow.cs b/src/Wpf.Ui/Controls/FluentWindow/FluentWindow.cs index 9d4905211..bccafdb30 100644 --- a/src/Wpf.Ui/Controls/FluentWindow/FluentWindow.cs +++ b/src/Wpf.Ui/Controls/FluentWindow/FluentWindow.cs @@ -241,7 +241,7 @@ protected virtual void OnExtendsContentIntoTitleBarChanged(bool oldValue, bool n CornerRadius = default, GlassFrameThickness = new Thickness(-1), ResizeBorderThickness = ResizeMode == ResizeMode.NoResize ? default : new Thickness(4), - UseAeroCaptionButtons = false + UseAeroCaptionButtons = false, } ); diff --git a/src/Wpf.Ui/Controls/FontTypography.cs b/src/Wpf.Ui/Controls/FontTypography.cs index 2086a43f8..7f8de2462 100644 --- a/src/Wpf.Ui/Controls/FontTypography.cs +++ b/src/Wpf.Ui/Controls/FontTypography.cs @@ -17,5 +17,5 @@ public enum FontTypography Subtitle, Title, TitleLarge, - Display + Display, } diff --git a/src/Wpf.Ui/Controls/GridView/GridView.cs b/src/Wpf.Ui/Controls/GridView/GridView.cs index 974c54b13..6f5de312a 100644 --- a/src/Wpf.Ui/Controls/GridView/GridView.cs +++ b/src/Wpf.Ui/Controls/GridView/GridView.cs @@ -25,13 +25,12 @@ public class GridView : System.Windows.Controls.GridView { static GridView() { - ResourceDictionary resourceDict = - new() - { - Source = new Uri( - "pack://application:,,,/Wpf.Ui;component/Controls/GridView/GridViewColumnHeader.xaml" - ) - }; + ResourceDictionary resourceDict = new() + { + Source = new Uri( + "pack://application:,,,/Wpf.Ui;component/Controls/GridView/GridViewColumnHeader.xaml" + ), + }; Style defaultStyle = (Style)resourceDict["UiGridViewColumnHeaderStyle"]; diff --git a/src/Wpf.Ui/Controls/GridView/GridViewColumn.cs b/src/Wpf.Ui/Controls/GridView/GridViewColumn.cs index 7a29fabdd..ccd0b08df 100644 --- a/src/Wpf.Ui/Controls/GridView/GridViewColumn.cs +++ b/src/Wpf.Ui/Controls/GridView/GridViewColumn.cs @@ -29,28 +29,26 @@ namespace Wpf.Ui.Controls; public class GridViewColumn : System.Windows.Controls.GridViewColumn { // use reflection to get the `_desiredWidth` private field. - private static readonly Lazy _desiredWidthField = - new( - () => - typeof(System.Windows.Controls.GridViewColumn).GetField( - "_desiredWidth", - BindingFlags.NonPublic | BindingFlags.Instance - ) ?? throw new InvalidOperationException("The `_desiredWidth` field was not found.") - ); + private static readonly Lazy _desiredWidthField = new( + () => + typeof(System.Windows.Controls.GridViewColumn).GetField( + "_desiredWidth", + BindingFlags.NonPublic | BindingFlags.Instance + ) ?? throw new InvalidOperationException("The `_desiredWidth` field was not found.") + ); private static FieldInfo DesiredWidthField => _desiredWidthField.Value; // use reflection to get the `UpdateActualWidth` private method. - private static readonly Lazy _updateActualWidthMethod = - new(() => - { - MethodInfo methodInfo = - typeof(System.Windows.Controls.GridViewColumn).GetMethod( - "UpdateActualWidth", - BindingFlags.NonPublic | BindingFlags.Instance - ) ?? throw new InvalidOperationException("The `UpdateActualWidth` method was not found."); - return methodInfo; - }); + private static readonly Lazy _updateActualWidthMethod = new(() => + { + MethodInfo methodInfo = + typeof(System.Windows.Controls.GridViewColumn).GetMethod( + "UpdateActualWidth", + BindingFlags.NonPublic | BindingFlags.Instance + ) ?? throw new InvalidOperationException("The `UpdateActualWidth` method was not found."); + return methodInfo; + }); private static MethodInfo UpdateActualWidthMethod => _updateActualWidthMethod.Value; diff --git a/src/Wpf.Ui/Controls/GridView/GridViewHeaderRowPresenter.cs b/src/Wpf.Ui/Controls/GridView/GridViewHeaderRowPresenter.cs index 2e99fad90..b1b309519 100644 --- a/src/Wpf.Ui/Controls/GridView/GridViewHeaderRowPresenter.cs +++ b/src/Wpf.Ui/Controls/GridView/GridViewHeaderRowPresenter.cs @@ -69,14 +69,13 @@ private void UpdateIndicatorStyle() indicator.Margin = new Thickness(0); indicator.Width = 3.0; - ResourceDictionary resourceDictionary = - new() - { - Source = new Uri( - "pack://application:,,,/Wpf.Ui;component/Controls/GridView/GridViewHeaderRowIndicator.xaml", - UriKind.Absolute - ) - }; + ResourceDictionary resourceDictionary = new() + { + Source = new Uri( + "pack://application:,,,/Wpf.Ui;component/Controls/GridView/GridViewHeaderRowIndicator.xaml", + UriKind.Absolute + ), + }; if (resourceDictionary["GridViewHeaderRowIndicatorTemplate"] is ControlTemplate template) { diff --git a/src/Wpf.Ui/Controls/IconElement/FontIcon.cs b/src/Wpf.Ui/Controls/IconElement/FontIcon.cs index d71fddd43..6bc9a6168 100644 --- a/src/Wpf.Ui/Controls/IconElement/FontIcon.cs +++ b/src/Wpf.Ui/Controls/IconElement/FontIcon.cs @@ -117,7 +117,10 @@ protected override UIElement InitializeChildren() SetResourceReference(FontSizeProperty, "DefaultIconFontSize"); // If the FontSize is the default, set it to the parent's FontSize. - if (VisualParent is not null && TextElement.GetFontSize(VisualParent) != SystemFonts.MessageFontSize) + if ( + VisualParent is not null + && TextElement.GetFontSize(VisualParent) != SystemFonts.MessageFontSize + ) { SetCurrentValue(FontSizeProperty, TextElement.GetFontSize(VisualParent)); } diff --git a/src/Wpf.Ui/Controls/IconElement/IconElement.cs b/src/Wpf.Ui/Controls/IconElement/IconElement.cs index d5d13e18a..a9a7e05ce 100644 --- a/src/Wpf.Ui/Controls/IconElement/IconElement.cs +++ b/src/Wpf.Ui/Controls/IconElement/IconElement.cs @@ -59,7 +59,7 @@ private void EnsureLayoutRoot() return; } - _layoutRoot = new Grid { Background = Brushes.Transparent, SnapsToDevicePixels = true, }; + _layoutRoot = new Grid { Background = Brushes.Transparent, SnapsToDevicePixels = true }; _ = _layoutRoot.Children.Add(InitializeChildren()); @@ -105,11 +105,10 @@ protected override Size ArrangeOverride(Size finalSize) { IconSourceElement iconSourceElement => iconSourceElement.CreateIconElement(), IconElement or null => baseValue, - _ - => throw new ArgumentException( - message: $"Expected either '{typeof(IconSourceElement)}' or '{typeof(IconElement)}' but got '{baseValue.GetType()}'.", - paramName: nameof(baseValue) - ) + _ => throw new ArgumentException( + message: $"Expected either '{typeof(IconSourceElement)}' or '{typeof(IconElement)}' but got '{baseValue.GetType()}'.", + paramName: nameof(baseValue) + ), }; } } diff --git a/src/Wpf.Ui/Controls/IconElement/IconElementConverter.cs b/src/Wpf.Ui/Controls/IconElement/IconElementConverter.cs index ab04650c9..63122f748 100644 --- a/src/Wpf.Ui/Controls/IconElement/IconElementConverter.cs +++ b/src/Wpf.Ui/Controls/IconElement/IconElementConverter.cs @@ -37,7 +37,7 @@ public override bool CanConvertFrom(ITypeDescriptorContext? context, Type source { SymbolRegular symbolRegular => new SymbolIcon(symbolRegular), SymbolFilled symbolFilled => new SymbolIcon(symbolFilled.Swap(), filled: true), - _ => null + _ => null, }; public override object ConvertTo( diff --git a/src/Wpf.Ui/Controls/InfoBadge/InfoBadgeSeverity.cs b/src/Wpf.Ui/Controls/InfoBadge/InfoBadgeSeverity.cs index 63bf4e8ec..58adb1113 100644 --- a/src/Wpf.Ui/Controls/InfoBadge/InfoBadgeSeverity.cs +++ b/src/Wpf.Ui/Controls/InfoBadge/InfoBadgeSeverity.cs @@ -31,5 +31,5 @@ public enum InfoBadgeSeverity /// /// Communicates that the InfoBadge is displaying general information that requires the user's attention. /// - Critical = 4 + Critical = 4, } diff --git a/src/Wpf.Ui/Controls/InfoBar/InfoBarSeverity.cs b/src/Wpf.Ui/Controls/InfoBar/InfoBarSeverity.cs index 1a1167511..db848b8fb 100644 --- a/src/Wpf.Ui/Controls/InfoBar/InfoBarSeverity.cs +++ b/src/Wpf.Ui/Controls/InfoBar/InfoBarSeverity.cs @@ -28,5 +28,5 @@ public enum InfoBarSeverity /// /// Communicates that the InfoBar is displaying information regarding an error or problem that has occurred. /// - Error = 3 + Error = 3, } diff --git a/src/Wpf.Ui/Controls/ListView/ListView.cs b/src/Wpf.Ui/Controls/ListView/ListView.cs index 32e8862d3..6e174dab3 100644 --- a/src/Wpf.Ui/Controls/ListView/ListView.cs +++ b/src/Wpf.Ui/Controls/ListView/ListView.cs @@ -98,7 +98,7 @@ private void UpdateViewState() { System.Windows.Controls.GridView => ListViewViewState.GridView, null => ListViewViewState.Default, - _ => ListViewViewState.Default + _ => ListViewViewState.Default, }; SetCurrentValue(ViewStateProperty, viewState); diff --git a/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs b/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs index 1da1681f2..3e712a3ee 100644 --- a/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs +++ b/src/Wpf.Ui/Controls/MessageBox/MessageBox.cs @@ -428,7 +428,7 @@ protected virtual void OnButtonClick(MessageBoxButton button) { MessageBoxButton.Primary => MessageBoxResult.Primary, MessageBoxButton.Secondary => MessageBoxResult.Secondary, - _ => MessageBoxResult.None + _ => MessageBoxResult.None, }; _ = Tcs?.TrySetResult(result); diff --git a/src/Wpf.Ui/Controls/MessageBox/MessageBoxButton.cs b/src/Wpf.Ui/Controls/MessageBox/MessageBoxButton.cs index e373b1c4d..adcba010a 100644 --- a/src/Wpf.Ui/Controls/MessageBox/MessageBoxButton.cs +++ b/src/Wpf.Ui/Controls/MessageBox/MessageBoxButton.cs @@ -24,5 +24,5 @@ public enum MessageBoxButton /// /// The close button /// - Close + Close, } diff --git a/src/Wpf.Ui/Controls/MessageBox/MessageBoxResult.cs b/src/Wpf.Ui/Controls/MessageBox/MessageBoxResult.cs index 4a6434fb8..88744a8d4 100644 --- a/src/Wpf.Ui/Controls/MessageBox/MessageBoxResult.cs +++ b/src/Wpf.Ui/Controls/MessageBox/MessageBoxResult.cs @@ -24,5 +24,5 @@ public enum MessageBoxResult /// /// The secondary button was tapped by the user. /// - Secondary + Secondary, } diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationCacheMode.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationCacheMode.cs index 2bd38c327..eb3009c8b 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationCacheMode.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationCacheMode.cs @@ -27,5 +27,5 @@ public enum NavigationCacheMode /// /// The page is cached and the cached instance is reused for every visit regardless of the cache size for the frame. /// - Required + Required, } diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewActivator.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationViewActivator.cs index c826358dc..967f387d2 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewActivator.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewActivator.cs @@ -37,8 +37,9 @@ internal static class NavigationViewActivator { Content = new TextBlock { - Text = "Pages are not rendered while using the Designer. Edit the page template directly." - } + Text = + "Pages are not rendered while using the Designer. Edit the page template directly.", + }, }; } diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewBackButtonVisible.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationViewBackButtonVisible.cs index 2b9b91c25..d73db6b6a 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewBackButtonVisible.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewBackButtonVisible.cs @@ -27,5 +27,5 @@ public enum NavigationViewBackButtonVisible /// /// The system chooses whether or not to display the back button, depending on the device/form factor. On phones, tablets, desktops, and hubs, the back button is visible. On Xbox/TV, the back button is collapsed. /// - Auto + Auto, } diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewPaneDisplayMode.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationViewPaneDisplayMode.cs index ae511fe9b..02e991315 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewPaneDisplayMode.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewPaneDisplayMode.cs @@ -38,5 +38,5 @@ public enum NavigationViewPaneDisplayMode /// /// The pane is shown at the bottom of the control. /// - Bottom + Bottom, } diff --git a/src/Wpf.Ui/Controls/NumberBox/NumberBox.cs b/src/Wpf.Ui/Controls/NumberBox/NumberBox.cs index 7accf6112..7a256da2f 100644 --- a/src/Wpf.Ui/Controls/NumberBox/NumberBox.cs +++ b/src/Wpf.Ui/Controls/NumberBox/NumberBox.cs @@ -291,7 +291,6 @@ protected override void OnPreviewKeyUp(KeyEventArgs e) UpdateTextToValue(); e.Handled = true; break; - } base.OnPreviewKeyUp(e); @@ -320,7 +319,10 @@ protected override void OnTextChanged(System.Windows.Controls.TextChangedEventAr /// public override void OnApplyTemplate() { - SubscribeToButtonClickEvent(PART_ClearButton, () => OnClearButtonClick()); + SubscribeToButtonClickEvent( + PART_ClearButton, + () => OnClearButtonClick() + ); SubscribeToButtonClickEvent(PART_InlineIncrementButton, () => StepValue(SmallChange)); SubscribeToButtonClickEvent(PART_InlineDecrementButton, () => StepValue(-SmallChange)); @@ -512,9 +514,10 @@ public static partial void InfoWriteLine(string debugLine) public static partial void InfoWriteLineForButtonClick(object sender) { - var buttonName = (sender is System.Windows.Controls.Primitives.ButtonBase element) - ? element.Name - : throw new InvalidCastException(nameof(sender)); + var buttonName = + (sender is System.Windows.Controls.Primitives.ButtonBase element) + ? element.Name + : throw new InvalidCastException(nameof(sender)); InfoWriteLine($"{typeof(NumberBox)} {buttonName} clicked"); } diff --git a/src/Wpf.Ui/Controls/NumberBox/NumberBoxSpinButtonPlacementMode.cs b/src/Wpf.Ui/Controls/NumberBox/NumberBoxSpinButtonPlacementMode.cs index 17c88f42a..0a1a21e7a 100644 --- a/src/Wpf.Ui/Controls/NumberBox/NumberBoxSpinButtonPlacementMode.cs +++ b/src/Wpf.Ui/Controls/NumberBox/NumberBoxSpinButtonPlacementMode.cs @@ -26,5 +26,5 @@ public enum NumberBoxSpinButtonPlacementMode /// /// The spin buttons are displayed in an expanded, horizontal orientation. /// - Inline + Inline, } diff --git a/src/Wpf.Ui/Controls/NumberBox/NumberBoxValidationMode.cs b/src/Wpf.Ui/Controls/NumberBox/NumberBoxValidationMode.cs index 4dfe465a1..2f8af3c42 100644 --- a/src/Wpf.Ui/Controls/NumberBox/NumberBoxValidationMode.cs +++ b/src/Wpf.Ui/Controls/NumberBox/NumberBoxValidationMode.cs @@ -21,5 +21,5 @@ public enum NumberBoxValidationMode /// /// Invalid input is replaced by PlaceholderText text. /// - Disabled + Disabled, } diff --git a/src/Wpf.Ui/Controls/RatingControl/RatingControl.cs b/src/Wpf.Ui/Controls/RatingControl/RatingControl.cs index 7f0235f85..b296b6be3 100644 --- a/src/Wpf.Ui/Controls/RatingControl/RatingControl.cs +++ b/src/Wpf.Ui/Controls/RatingControl/RatingControl.cs @@ -22,7 +22,7 @@ private enum StarValue { Empty, HalfFilled, - Filled + Filled, } private const double MaxValue = 5.0D; diff --git a/src/Wpf.Ui/Controls/ScrollDirection.cs b/src/Wpf.Ui/Controls/ScrollDirection.cs index c9008cbe9..41063031e 100644 --- a/src/Wpf.Ui/Controls/ScrollDirection.cs +++ b/src/Wpf.Ui/Controls/ScrollDirection.cs @@ -25,5 +25,5 @@ public enum ScrollDirection /// /// Horizontal scroll direction. /// - Horizontal + Horizontal, } diff --git a/src/Wpf.Ui/Controls/SpacingMode.cs b/src/Wpf.Ui/Controls/SpacingMode.cs index 154af3605..2d4fbea04 100644 --- a/src/Wpf.Ui/Controls/SpacingMode.cs +++ b/src/Wpf.Ui/Controls/SpacingMode.cs @@ -34,5 +34,5 @@ public enum SpacingMode /// /// The remaining space is evenly distributed between start and end of each row. /// - StartAndEndOnly + StartAndEndOnly, } diff --git a/src/Wpf.Ui/Controls/TextColor.cs b/src/Wpf.Ui/Controls/TextColor.cs index b235854a4..6acedf720 100644 --- a/src/Wpf.Ui/Controls/TextColor.cs +++ b/src/Wpf.Ui/Controls/TextColor.cs @@ -28,5 +28,5 @@ public enum TextColor /// /// Disabled only (not accessible) /// - Disabled + Disabled, } diff --git a/src/Wpf.Ui/Controls/ThumbRate/ThumbRateState.cs b/src/Wpf.Ui/Controls/ThumbRate/ThumbRateState.cs index c4d570640..d2c4e1c10 100644 --- a/src/Wpf.Ui/Controls/ThumbRate/ThumbRateState.cs +++ b/src/Wpf.Ui/Controls/ThumbRate/ThumbRateState.cs @@ -24,5 +24,5 @@ public enum ThumbRateState /// /// The thumb down has been clicked. /// - Disliked + Disliked, } diff --git a/src/Wpf.Ui/Controls/TimePicker/ClockIdentifier.cs b/src/Wpf.Ui/Controls/TimePicker/ClockIdentifier.cs index 7e154f2f5..9f20df28d 100644 --- a/src/Wpf.Ui/Controls/TimePicker/ClockIdentifier.cs +++ b/src/Wpf.Ui/Controls/TimePicker/ClockIdentifier.cs @@ -12,5 +12,5 @@ namespace Wpf.Ui.Controls; public enum ClockIdentifier { Clock12Hour, - Clock24Hour + Clock24Hour, } diff --git a/src/Wpf.Ui/Controls/TitleBar/TitleBar.cs b/src/Wpf.Ui/Controls/TitleBar/TitleBar.cs index 36812834c..de59bde85 100644 --- a/src/Wpf.Ui/Controls/TitleBar/TitleBar.cs +++ b/src/Wpf.Ui/Controls/TitleBar/TitleBar.cs @@ -62,7 +62,7 @@ public class TitleBar : System.Windows.Controls.Control, IThemeControl typeof(TitleBar), new PropertyMetadata(null) ); - + /// /// Property for . /// @@ -229,7 +229,7 @@ public object Header get => GetValue(HeaderProperty); set => SetValue(HeaderProperty, value); } - + /// /// Gets or sets the content displayed in right side of the . /// @@ -411,8 +411,14 @@ public TitleBar() _titleBlock = new TextBlock(); _titleBlock.VerticalAlignment = VerticalAlignment.Center; - _titleBlock.SetBinding(System.Windows.Controls.TextBlock.TextProperty, new Binding(nameof(Title)) { Source = this }); - _titleBlock.SetBinding(System.Windows.Controls.TextBlock.FontSizeProperty, new Binding(nameof(FontSize)) { Source = this }); + _titleBlock.SetBinding( + System.Windows.Controls.TextBlock.TextProperty, + new Binding(nameof(Title)) { Source = this } + ); + _titleBlock.SetBinding( + System.Windows.Controls.TextBlock.FontSizeProperty, + new Binding(nameof(FontSize)) { Source = this } + ); Header = _titleBlock; Loaded += OnLoaded; @@ -653,7 +659,9 @@ or User32.WM.NCLBUTTONUP if (headerLeftUIElement is not null && headerLeftUIElement != _titleBlock) { - isMouseOverHeaderContent = headerLeftUIElement.IsMouseOverElement(lParam) || (headerRightUiElement?.IsMouseOverElement(lParam) ?? false); + isMouseOverHeaderContent = + headerLeftUIElement.IsMouseOverElement(lParam) + || (headerRightUiElement?.IsMouseOverElement(lParam) ?? false); } else { diff --git a/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs b/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs index 235da5852..83f8ad744 100644 --- a/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs +++ b/src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs @@ -225,12 +225,11 @@ protected void OnButtonTypeChanged(DependencyPropertyChangedEventArgs e) TitleBarButtonType.Close => User32.WM_NCHITTEST.HTCLOSE, TitleBarButtonType.Restore => User32.WM_NCHITTEST.HTMAXBUTTON, TitleBarButtonType.Maximize => User32.WM_NCHITTEST.HTMAXBUTTON, - _ - => throw new ArgumentOutOfRangeException( - "e.NewValue", - buttonType, - $"Unsupported button type: {buttonType}." - ) + _ => throw new ArgumentOutOfRangeException( + "e.NewValue", + buttonType, + $"Unsupported button type: {buttonType}." + ), }; } } diff --git a/src/Wpf.Ui/Controls/TitleBar/TitleBarButtonType.cs b/src/Wpf.Ui/Controls/TitleBar/TitleBarButtonType.cs index da560e0d6..2b363cedb 100644 --- a/src/Wpf.Ui/Controls/TitleBar/TitleBarButtonType.cs +++ b/src/Wpf.Ui/Controls/TitleBar/TitleBarButtonType.cs @@ -39,5 +39,5 @@ public enum TitleBarButtonType /// /// Help button. /// - Help + Help, } diff --git a/src/Wpf.Ui/Controls/VirtualizingGridView/VirtualizingGridView.cs b/src/Wpf.Ui/Controls/VirtualizingGridView/VirtualizingGridView.cs index b3acc4f57..634ac4416 100644 --- a/src/Wpf.Ui/Controls/VirtualizingGridView/VirtualizingGridView.cs +++ b/src/Wpf.Ui/Controls/VirtualizingGridView/VirtualizingGridView.cs @@ -105,7 +105,7 @@ protected virtual void InitializeItemsPanel() { Source = this, Path = new PropertyPath(nameof(Orientation)), - Mode = BindingMode.OneWay + Mode = BindingMode.OneWay, } ); factory.SetBinding( @@ -114,7 +114,7 @@ protected virtual void InitializeItemsPanel() { Source = this, Path = new PropertyPath(nameof(SpacingMode)), - Mode = BindingMode.OneWay + Mode = BindingMode.OneWay, } ); factory.SetBinding( @@ -123,7 +123,7 @@ protected virtual void InitializeItemsPanel() { Source = this, Path = new PropertyPath(nameof(StretchItems)), - Mode = BindingMode.OneWay + Mode = BindingMode.OneWay, } ); diff --git a/src/Wpf.Ui/Controls/Window/WindowBackdrop.cs b/src/Wpf.Ui/Controls/Window/WindowBackdrop.cs index a1cc1c2d2..3b6d2261b 100644 --- a/src/Wpf.Ui/Controls/Window/WindowBackdrop.cs +++ b/src/Wpf.Ui/Controls/Window/WindowBackdrop.cs @@ -28,7 +28,7 @@ public static bool IsSupported(WindowBackdropType backdropType) WindowBackdropType.Mica => Win32.Utilities.IsOSWindows11OrNewer, WindowBackdropType.Acrylic => Win32.Utilities.IsOSWindows7OrNewer, WindowBackdropType.None => true, - _ => false + _ => false, }; } @@ -117,8 +117,10 @@ public static bool ApplyBackdrop(IntPtr hWnd, WindowBackdropType backdropType) { WindowBackdropType.Auto => ApplyDwmwWindowAttrubute(hWnd, Dwmapi.DWMSBT.DWMSBT_AUTO), WindowBackdropType.Mica => ApplyDwmwWindowAttrubute(hWnd, Dwmapi.DWMSBT.DWMSBT_MAINWINDOW), - WindowBackdropType.Acrylic - => ApplyDwmwWindowAttrubute(hWnd, Dwmapi.DWMSBT.DWMSBT_TRANSIENTWINDOW), + WindowBackdropType.Acrylic => ApplyDwmwWindowAttrubute( + hWnd, + Dwmapi.DWMSBT.DWMSBT_TRANSIENTWINDOW + ), WindowBackdropType.Tabbed => ApplyDwmwWindowAttrubute(hWnd, Dwmapi.DWMSBT.DWMSBT_TABBEDWINDOW), _ => ApplyDwmwWindowAttrubute(hWnd, Dwmapi.DWMSBT.DWMSBT_DISABLE), }; @@ -334,18 +336,17 @@ private static SolidColorBrush GetFallbackBackgroundBrush() { return ApplicationThemeManager.GetAppTheme() switch { - ApplicationTheme.HighContrast - => ApplicationThemeManager.GetSystemTheme() switch - { - SystemTheme.HC1 => new SolidColorBrush(Color.FromArgb(0xFF, 0x2D, 0x32, 0x36)), - SystemTheme.HC2 => new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)), - SystemTheme.HCBlack => new SolidColorBrush(Color.FromArgb(0xFF, 0x20, 0x20, 0x20)), - SystemTheme.HCWhite => new SolidColorBrush(Color.FromArgb(0xFF, 0x20, 0x20, 0x20)), - _ => new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0xFA, 0xEF)), - }, + ApplicationTheme.HighContrast => ApplicationThemeManager.GetSystemTheme() switch + { + SystemTheme.HC1 => new SolidColorBrush(Color.FromArgb(0xFF, 0x2D, 0x32, 0x36)), + SystemTheme.HC2 => new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)), + SystemTheme.HCBlack => new SolidColorBrush(Color.FromArgb(0xFF, 0x20, 0x20, 0x20)), + SystemTheme.HCWhite => new SolidColorBrush(Color.FromArgb(0xFF, 0x20, 0x20, 0x20)), + _ => new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0xFA, 0xEF)), + }, ApplicationTheme.Dark => new SolidColorBrush(Color.FromArgb(0xFF, 0x20, 0x20, 0x20)), ApplicationTheme.Light => new SolidColorBrush(Color.FromArgb(0xFF, 0xFA, 0xFA, 0xFA)), - _ => new SolidColorBrush(Color.FromArgb(0xFF, 0xFA, 0xFA, 0xFA)) + _ => new SolidColorBrush(Color.FromArgb(0xFF, 0xFA, 0xFA, 0xFA)), }; } } diff --git a/src/Wpf.Ui/Controls/Window/WindowBackdropType.cs b/src/Wpf.Ui/Controls/Window/WindowBackdropType.cs index df853c0ce..4f8db5c8b 100644 --- a/src/Wpf.Ui/Controls/Window/WindowBackdropType.cs +++ b/src/Wpf.Ui/Controls/Window/WindowBackdropType.cs @@ -31,5 +31,5 @@ public enum WindowBackdropType /// /// Windows 11 wallpaper blur effect. /// - Tabbed + Tabbed, } diff --git a/src/Wpf.Ui/Controls/Window/WindowCornerPreference.cs b/src/Wpf.Ui/Controls/Window/WindowCornerPreference.cs index b0395e573..cfb2311db 100644 --- a/src/Wpf.Ui/Controls/Window/WindowCornerPreference.cs +++ b/src/Wpf.Ui/Controls/Window/WindowCornerPreference.cs @@ -29,5 +29,5 @@ public enum WindowCornerPreference /// /// Round the corners slightly. /// - RoundSmall + RoundSmall, } diff --git a/src/Wpf.Ui/Converters/BackButtonVisibilityToVisibilityConverter.cs b/src/Wpf.Ui/Converters/BackButtonVisibilityToVisibilityConverter.cs index 2cd0f1d03..0309b8d93 100644 --- a/src/Wpf.Ui/Converters/BackButtonVisibilityToVisibilityConverter.cs +++ b/src/Wpf.Ui/Converters/BackButtonVisibilityToVisibilityConverter.cs @@ -18,7 +18,7 @@ public object Convert(object? value, Type targetType, object? parameter, Culture NavigationViewBackButtonVisible.Collapsed => Visibility.Collapsed, NavigationViewBackButtonVisible.Visible => Visibility.Visible, NavigationViewBackButtonVisible.Auto => Visibility.Visible, - _ => Visibility.Collapsed + _ => Visibility.Collapsed, }; } diff --git a/src/Wpf.Ui/Converters/BrushToColorConverter.cs b/src/Wpf.Ui/Converters/BrushToColorConverter.cs index a35fa002b..4790766f1 100644 --- a/src/Wpf.Ui/Converters/BrushToColorConverter.cs +++ b/src/Wpf.Ui/Converters/BrushToColorConverter.cs @@ -27,7 +27,7 @@ public object Convert(object? value, Type targetType, object? parameter, Culture A = 255, R = 255, G = 0, - B = 0 + B = 0, }; } diff --git a/src/Wpf.Ui/Converters/FallbackBrushConverter.cs b/src/Wpf.Ui/Converters/FallbackBrushConverter.cs index cec13b2be..5c2d785f0 100644 --- a/src/Wpf.Ui/Converters/FallbackBrushConverter.cs +++ b/src/Wpf.Ui/Converters/FallbackBrushConverter.cs @@ -15,7 +15,7 @@ public object Convert(object? value, Type targetType, object? parameter, Culture { SolidColorBrush brush => brush, Color color => new SolidColorBrush(color), - _ => new SolidColorBrush(Colors.Red) + _ => new SolidColorBrush(Colors.Red), }; } diff --git a/src/Wpf.Ui/Extensions/ColorExtensions.cs b/src/Wpf.Ui/Extensions/ColorExtensions.cs index 0eb71c2de..f3f5bddc9 100644 --- a/src/Wpf.Ui/Extensions/ColorExtensions.cs +++ b/src/Wpf.Ui/Extensions/ColorExtensions.cs @@ -464,7 +464,7 @@ private static float ToPercentage(float value) { > 100f => 100f, < 0f => 0f, - _ => value + _ => value, }; } diff --git a/src/Wpf.Ui/Extensions/ContentDialogServiceExtensions.cs b/src/Wpf.Ui/Extensions/ContentDialogServiceExtensions.cs index 56dfc90c7..77c562089 100644 --- a/src/Wpf.Ui/Extensions/ContentDialogServiceExtensions.cs +++ b/src/Wpf.Ui/Extensions/ContentDialogServiceExtensions.cs @@ -50,7 +50,7 @@ public static Task ShowSimpleDialogAsync( Content = options.Content, CloseButtonText = options.CloseButtonText, PrimaryButtonText = options.PrimaryButtonText, - SecondaryButtonText = options.SecondaryButtonText + SecondaryButtonText = options.SecondaryButtonText, }; return dialogService.ShowAsync(dialog, cancellationToken); diff --git a/src/Wpf.Ui/Extensions/StringExtensions.cs b/src/Wpf.Ui/Extensions/StringExtensions.cs index 89258c798..fe4341769 100644 --- a/src/Wpf.Ui/Extensions/StringExtensions.cs +++ b/src/Wpf.Ui/Extensions/StringExtensions.cs @@ -23,4 +23,4 @@ public static bool Contains(this string source, string value, StringComparison c return source.IndexOf(value, comparison) >= 0; } } -#endif \ No newline at end of file +#endif diff --git a/src/Wpf.Ui/Extensions/TextBlockFontTypographyExtensions.cs b/src/Wpf.Ui/Extensions/TextBlockFontTypographyExtensions.cs index dcd519a7f..d162a35a7 100644 --- a/src/Wpf.Ui/Extensions/TextBlockFontTypographyExtensions.cs +++ b/src/Wpf.Ui/Extensions/TextBlockFontTypographyExtensions.cs @@ -27,7 +27,7 @@ public static string ToResourceValue(this FontTypography typography) FontTypography.Title => "TitleTextBlockStyle", FontTypography.TitleLarge => "TitleLargeTextBlockStyle", FontTypography.Display => "DisplayTextBlockStyle", - _ => throw new ArgumentOutOfRangeException(nameof(typography), typography, null) + _ => throw new ArgumentOutOfRangeException(nameof(typography), typography, null), }; } } diff --git a/src/Wpf.Ui/Extensions/TextColorExtensions.cs b/src/Wpf.Ui/Extensions/TextColorExtensions.cs index 725417384..e1cb621a9 100644 --- a/src/Wpf.Ui/Extensions/TextColorExtensions.cs +++ b/src/Wpf.Ui/Extensions/TextColorExtensions.cs @@ -24,7 +24,7 @@ public static string ToResourceValue(this TextColor textColor) TextColor.Secondary => "TextFillColorSecondaryBrush", TextColor.Tertiary => "TextFillColorTertiaryBrush", TextColor.Disabled => "TextFillColorDisabledBrush", - _ => throw new ArgumentOutOfRangeException(nameof(textColor), textColor, null) + _ => throw new ArgumentOutOfRangeException(nameof(textColor), textColor, null), }; } } diff --git a/src/Wpf.Ui/GlobalUsings.cs b/src/Wpf.Ui/GlobalUsings.cs index 2ce035a12..5f3d7e047 100644 --- a/src/Wpf.Ui/GlobalUsings.cs +++ b/src/Wpf.Ui/GlobalUsings.cs @@ -13,4 +13,4 @@ global using System.Windows; global using System.Windows.Interop; global using System.Windows.Media; -global using Wpf.Ui.Extensions; \ No newline at end of file +global using Wpf.Ui.Extensions; diff --git a/src/Wpf.Ui/Hardware/RenderingTier.cs b/src/Wpf.Ui/Hardware/RenderingTier.cs index 354227d42..0af3f85fb 100644 --- a/src/Wpf.Ui/Hardware/RenderingTier.cs +++ b/src/Wpf.Ui/Hardware/RenderingTier.cs @@ -29,5 +29,5 @@ public enum RenderingTier /// necessary system resources have not been exhausted. /// This corresponds to a DirectX version that is greater than or equal to 9.0. /// - FullAcceleration = 0x2 + FullAcceleration = 0x2, } diff --git a/src/Wpf.Ui/Interop/Dwmapi.cs b/src/Wpf.Ui/Interop/Dwmapi.cs index adf6a9618..01809bf97 100644 --- a/src/Wpf.Ui/Interop/Dwmapi.cs +++ b/src/Wpf.Ui/Interop/Dwmapi.cs @@ -34,7 +34,7 @@ public enum DWM_CLOAKED { DWM_CLOAKED_APP = 0x00000001, DWM_CLOAKED_SHELL = 0x00000002, - DWM_CLOAKED_INHERITED = 0x00000004 + DWM_CLOAKED_INHERITED = 0x00000004, } /// @@ -121,7 +121,7 @@ public enum DWM_TAB_WINDOW_REQUIREMENTS /// This is set if app compat has blocked tabs for this window. Can be overridden per window by setting /// DWMWA_TABBING_ENABLED to TRUE. That does not override any other tabbing requirements. /// - DWMTWR_APP_COMPAT = 0x0200 + DWMTWR_APP_COMPAT = 0x0200, } /// @@ -133,7 +133,7 @@ public enum DWM_WINDOW_CORNER_PREFERENCE DEFAULT = 0, DONOTROUND = 1, ROUND = 2, - ROUNDSMALL = 3 + ROUNDSMALL = 3, } /// @@ -165,7 +165,7 @@ public enum DWMSBT : uint /// /// Sets blurred wallpaper effect, like Mica without tint. /// - DWMSBT_TABBEDWINDOW = 4 + DWMSBT_TABBEDWINDOW = 4, } /// @@ -191,7 +191,7 @@ public enum DWMNCRENDERINGPOLICY /// /// Sentinel value. /// - DWMNCRP_LAST + DWMNCRP_LAST, } /// @@ -217,7 +217,7 @@ public enum DWMFLIP3DWINDOWPOLICY /// /// Sentinel value. /// - DWMFLIP3D_LAST + DWMFLIP3D_LAST, } /// @@ -360,7 +360,7 @@ public enum DWMWINDOWATTRIBUTE /// Indicates whether the window should use the Mica effect. /// Windows 11 and above. /// - DWMWA_MICA_EFFECT = 1029 + DWMWA_MICA_EFFECT = 1029, } /// @@ -433,7 +433,7 @@ public enum DWM_SHOWCONTACT DWMSC_HOLD, DWMSC_PENBARREL, DWMSC_NONE, - DWMSC_ALL + DWMSC_ALL, } /// @@ -455,7 +455,7 @@ public enum DWM_SOURCE_FRAME_SAMPLING /// /// Sentinel value. /// - DWM_SOURCE_FRAME_SAMPLING_LAST + DWM_SOURCE_FRAME_SAMPLING_LAST, } /// diff --git a/src/Wpf.Ui/Interop/ShObjIdl.cs b/src/Wpf.Ui/Interop/ShObjIdl.cs index cc334f43e..c30b0d50b 100644 --- a/src/Wpf.Ui/Interop/ShObjIdl.cs +++ b/src/Wpf.Ui/Interop/ShObjIdl.cs @@ -35,7 +35,7 @@ public enum THUMBBUTTONFLAGS THBF_DISMISSONCLICK = 0x2, THBF_NOBACKGROUND = 0x4, THBF_HIDDEN = 0x8, - THBF_NONINTERACTIVE = 0x10 + THBF_NONINTERACTIVE = 0x10, } /// @@ -47,7 +47,7 @@ public enum THUMBBUTTONMASK THB_BITMAP = 0x1, THB_ICON = 0x2, THB_TOOLTIP = 0x4, - THB_FLAGS = 0x8 + THB_FLAGS = 0x8, } /// @@ -60,7 +60,7 @@ public enum TBPFLAG TBPF_INDETERMINATE = 0x1, TBPF_NORMAL = 0x2, TBPF_ERROR = 0x4, - TBPF_PAUSED = 0x8 + TBPF_PAUSED = 0x8, } /// @@ -73,7 +73,7 @@ public enum STPFLAG STPF_USEAPPTHUMBNAILALWAYS = 0x1, STPF_USEAPPTHUMBNAILWHENACTIVE = 0x2, STPF_USEAPPPEEKALWAYS = 0x4, - STPF_USEAPPPEEKWHENACTIVE = 0x8 + STPF_USEAPPPEEKWHENACTIVE = 0x8, } /// @@ -89,7 +89,7 @@ public enum EXPLORER_BROWSER_OPTIONS EBO_NOWRAPPERWINDOW = 0x10, EBO_HTMLSHAREPOINTVIEW = 0x20, EBO_NOBORDER = 0x40, - EBO_NOPERSISTVIEWSTATE = 0x80 + EBO_NOPERSISTVIEWSTATE = 0x80, } /// @@ -99,7 +99,7 @@ public enum EXPLORER_BROWSER_FILL_FLAGS { EBF_NONE = 0, EBF_SELECTFROMDATAOBJECT = 0x100, - EBF_NODROPTARGET = 0x200 + EBF_NODROPTARGET = 0x200, } /// diff --git a/src/Wpf.Ui/Interop/UnsafeNativeMethods.cs b/src/Wpf.Ui/Interop/UnsafeNativeMethods.cs index e73401cca..be8c6f217 100644 --- a/src/Wpf.Ui/Interop/UnsafeNativeMethods.cs +++ b/src/Wpf.Ui/Interop/UnsafeNativeMethods.cs @@ -325,7 +325,7 @@ public static bool ApplyWindowLegacyAcrylicEffect(IntPtr handle) var accentPolicy = new Interop.User32.ACCENT_POLICY { nAccentState = User32.ACCENT_STATE.ACCENT_ENABLE_ACRYLICBLURBEHIND, - nColor = 0x990000 & 0xFFFFFF + nColor = 0x990000 & 0xFFFFFF, }; int accentStructSize = Marshal.SizeOf(accentPolicy); @@ -337,7 +337,7 @@ public static bool ApplyWindowLegacyAcrylicEffect(IntPtr handle) { Attribute = User32.WCA.WCA_ACCENT_POLICY, SizeOfData = accentStructSize, - Data = accentPtr + Data = accentPtr, }; _ = User32.SetWindowCompositionAttribute(handle, ref data); @@ -476,7 +476,7 @@ public static bool RemoveWindowCaption(IntPtr hWnd) var wtaOptions = new UxTheme.WTA_OPTIONS() { dwFlags = UxTheme.WTNCA.NODRAWCAPTION, - dwMask = UxTheme.WTNCA.VALIDBITS + dwMask = UxTheme.WTNCA.VALIDBITS, }; UxTheme.SetWindowThemeAttribute( @@ -522,7 +522,7 @@ public static bool ExtendClientAreaIntoTitleBar(IntPtr hWnd) var wtaOptions = new UxTheme.WTA_OPTIONS() { dwFlags = UxTheme.WTNCA.NODRAWCAPTION | UxTheme.WTNCA.NODRAWICON | UxTheme.WTNCA.NOSYSMENU, - dwMask = UxTheme.WTNCA.VALIDBITS + dwMask = UxTheme.WTNCA.VALIDBITS, }; Interop.UxTheme.SetWindowThemeAttribute( diff --git a/src/Wpf.Ui/Interop/UnsafeReflection.cs b/src/Wpf.Ui/Interop/UnsafeReflection.cs index cb9ff3b05..354b9602b 100644 --- a/src/Wpf.Ui/Interop/UnsafeReflection.cs +++ b/src/Wpf.Ui/Interop/UnsafeReflection.cs @@ -28,7 +28,7 @@ public static Dwmapi.DWMSBT Cast(WindowBackdropType backgroundType) WindowBackdropType.Mica => Dwmapi.DWMSBT.DWMSBT_MAINWINDOW, WindowBackdropType.Acrylic => Dwmapi.DWMSBT.DWMSBT_TRANSIENTWINDOW, WindowBackdropType.Tabbed => Dwmapi.DWMSBT.DWMSBT_TABBEDWINDOW, - _ => Dwmapi.DWMSBT.DWMSBT_DISABLE + _ => Dwmapi.DWMSBT.DWMSBT_DISABLE, }; } @@ -42,7 +42,7 @@ public static Dwmapi.DWM_WINDOW_CORNER_PREFERENCE Cast(WindowCornerPreference co WindowCornerPreference.Round => Dwmapi.DWM_WINDOW_CORNER_PREFERENCE.ROUND, WindowCornerPreference.RoundSmall => Dwmapi.DWM_WINDOW_CORNER_PREFERENCE.ROUNDSMALL, WindowCornerPreference.DoNotRound => Dwmapi.DWM_WINDOW_CORNER_PREFERENCE.DONOTROUND, - _ => Dwmapi.DWM_WINDOW_CORNER_PREFERENCE.DEFAULT + _ => Dwmapi.DWM_WINDOW_CORNER_PREFERENCE.DEFAULT, }; } @@ -57,7 +57,7 @@ public static ShObjIdl.TBPFLAG Cast(TaskBarProgressState taskBarProgressState) TaskBarProgressState.Error => ShObjIdl.TBPFLAG.TBPF_ERROR, TaskBarProgressState.Paused => ShObjIdl.TBPFLAG.TBPF_PAUSED, TaskBarProgressState.Normal => ShObjIdl.TBPFLAG.TBPF_NORMAL, - _ => Wpf.Ui.Interop.ShObjIdl.TBPFLAG.TBPF_NOPROGRESS + _ => Wpf.Ui.Interop.ShObjIdl.TBPFLAG.TBPF_NOPROGRESS, }; } @@ -72,7 +72,7 @@ public static TaskBarProgressState Cast(ShObjIdl.TBPFLAG progressState) ShObjIdl.TBPFLAG.TBPF_ERROR => TaskBarProgressState.Error, ShObjIdl.TBPFLAG.TBPF_PAUSED => TaskBarProgressState.Paused, ShObjIdl.TBPFLAG.TBPF_NORMAL => TaskBarProgressState.Normal, - _ => TaskBarProgressState.None + _ => TaskBarProgressState.None, }; } } diff --git a/src/Wpf.Ui/Interop/User32.cs b/src/Wpf.Ui/Interop/User32.cs index d2d7e10cc..20cabd542 100644 --- a/src/Wpf.Ui/Interop/User32.cs +++ b/src/Wpf.Ui/Interop/User32.cs @@ -196,7 +196,7 @@ public enum WM_NCHITTEST HTSIZELAST = HTBOTTOMRIGHT, HTOBJECT = 19, HTCLOSE = 20, - HTHELP = 21 + HTHELP = 21, } /// @@ -256,7 +256,7 @@ public enum GWL /// /// Sets the new address of the dialog box procedure. /// - DWLP_DLGPROC = 0x4 + DWLP_DLGPROC = 0x4, } /// @@ -294,7 +294,7 @@ public enum WCA WCA_CORNER_STYLE = 27, WCA_PART_COLOR = 28, WCA_DISABLE_MOVESIZE_FEEDBACK = 29, - WCA_LAST = 30 + WCA_LAST = 30, } [Flags] @@ -304,7 +304,7 @@ public enum ACCENT_FLAGS DrawTopBorder = 0x40, DrawRightBorder = 0x80, DrawBottomBorder = 0x100, - DrawAllBorders = DrawLeftBorder | DrawTopBorder | DrawRightBorder | DrawBottomBorder + DrawAllBorders = DrawLeftBorder | DrawTopBorder | DrawRightBorder | DrawBottomBorder, } /// @@ -317,7 +317,7 @@ public enum ACCENT_STATE ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, ACCENT_ENABLE_BLURBEHIND = 3, ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, - ACCENT_INVALID_STATE = 5 + ACCENT_INVALID_STATE = 5, } /// @@ -358,7 +358,7 @@ public enum CS : uint BYTEALIGNWINDOW = 0x2000, GLOBALCLASS = 0x4000, IME = 0x00010000, - DROPSHADOW = 0x00020000 + DROPSHADOW = 0x00020000, } /// diff --git a/src/Wpf.Ui/Markup/ImageIconExtension.cs b/src/Wpf.Ui/Markup/ImageIconExtension.cs index 69ec1c134..dc5a3c093 100644 --- a/src/Wpf.Ui/Markup/ImageIconExtension.cs +++ b/src/Wpf.Ui/Markup/ImageIconExtension.cs @@ -50,7 +50,7 @@ public override object ProvideValue(IServiceProvider serviceProvider) { Source = Source, Width = Width, - Height = Height + Height = Height, }; return imageIcon; diff --git a/src/Wpf.Ui/Markup/ThemeResource.cs b/src/Wpf.Ui/Markup/ThemeResource.cs index 9229d014a..b43b272ae 100644 --- a/src/Wpf.Ui/Markup/ThemeResource.cs +++ b/src/Wpf.Ui/Markup/ThemeResource.cs @@ -263,5 +263,5 @@ public enum ThemeResource /// /// Gradient . /// - AccentControlElevationBorderBrush + AccentControlElevationBorderBrush, } diff --git a/src/Wpf.Ui/Markup/ThemesDictionary.cs b/src/Wpf.Ui/Markup/ThemesDictionary.cs index 07c05bdfe..29ec10bcb 100644 --- a/src/Wpf.Ui/Markup/ThemesDictionary.cs +++ b/src/Wpf.Ui/Markup/ThemesDictionary.cs @@ -49,7 +49,7 @@ private void SetSourceBasedOnSelectedTheme(ApplicationTheme? selectedApplication { ApplicationTheme.Dark => "Dark", ApplicationTheme.HighContrast => "HighContrast", - _ => "Light" + _ => "Light", }; Source = new Uri($"{ApplicationThemeManager.ThemesDictionaryPath}{themeName}.xaml", UriKind.Absolute); diff --git a/src/Wpf.Ui/Taskbar/TaskbarProgressState.cs b/src/Wpf.Ui/Taskbar/TaskbarProgressState.cs index b63767fcc..0da4da5f4 100644 --- a/src/Wpf.Ui/Taskbar/TaskbarProgressState.cs +++ b/src/Wpf.Ui/Taskbar/TaskbarProgressState.cs @@ -34,5 +34,5 @@ public enum TaskBarProgressState /// /// A yellow progress indicator is displayed in the task bar area. /// - Paused = 0x8 + Paused = 0x8, } diff --git a/src/Wpf.Ui/ThemeService.cs b/src/Wpf.Ui/ThemeService.cs index 713cc9440..6092a1c9b 100644 --- a/src/Wpf.Ui/ThemeService.cs +++ b/src/Wpf.Ui/ThemeService.cs @@ -35,7 +35,7 @@ public virtual ApplicationTheme GetSystemTheme() SystemTheme.HC1 => ApplicationTheme.HighContrast, SystemTheme.HC2 => ApplicationTheme.HighContrast, SystemTheme.HCWhite => ApplicationTheme.HighContrast, - _ => ApplicationTheme.Unknown + _ => ApplicationTheme.Unknown, }; } diff --git a/src/Wpf.Ui/UiApplication.cs b/src/Wpf.Ui/UiApplication.cs index 25aa4b4b5..43b1e92f2 100644 --- a/src/Wpf.Ui/UiApplication.cs +++ b/src/Wpf.Ui/UiApplication.cs @@ -132,7 +132,11 @@ private static bool ApplicationHasResources(Application application) return application .Resources.MergedDictionaries.Where(e => e.Source is not null) .Any(e => - e.Source.ToString().Contains(Appearance.ApplicationThemeManager.LibraryNamespace, StringComparison.OrdinalIgnoreCase) + e.Source.ToString() + .Contains( + Appearance.ApplicationThemeManager.LibraryNamespace, + StringComparison.OrdinalIgnoreCase + ) ); } }