From 4ccd7d0fc02ca4c48e8400e445aeec9bb1f0803a Mon Sep 17 00:00:00 2001 From: Edward Miller Date: Sun, 20 Oct 2024 19:10:18 -0500 Subject: [PATCH] make sample classes internal and sealed --- Maui.DataGrid.Sample/Models/Streak.cs | 4 ++-- Maui.DataGrid.Sample/Models/Team.cs | 2 +- Maui.DataGrid.Sample/SettingsPopup.xaml.cs | 2 +- Maui.DataGrid.Sample/ViewModels/MainViewModel.cs | 2 +- Maui.DataGrid.Sample/ViewModels/ViewModelBase.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Maui.DataGrid.Sample/Models/Streak.cs b/Maui.DataGrid.Sample/Models/Streak.cs index c17d066..d1b7c68 100644 --- a/Maui.DataGrid.Sample/Models/Streak.cs +++ b/Maui.DataGrid.Sample/Models/Streak.cs @@ -1,6 +1,6 @@ namespace Maui.DataGrid.Sample.Models; -public class Streak : IComparable +internal sealed class Streak : IComparable { public GameResult Result { get; set; } @@ -64,7 +64,7 @@ public int CompareTo(object? obj) /// public override string ToString() { - return $"{Enum.GetName(typeof(GameResult), Result)} {NumStreak}"; + return $"{Enum.GetName(Result)} {NumStreak}"; } /// diff --git a/Maui.DataGrid.Sample/Models/Team.cs b/Maui.DataGrid.Sample/Models/Team.cs index 5779f1d..3c6c2e1 100644 --- a/Maui.DataGrid.Sample/Models/Team.cs +++ b/Maui.DataGrid.Sample/Models/Team.cs @@ -1,6 +1,6 @@ namespace Maui.DataGrid.Sample.Models; -public class Team +internal sealed class Team { public required string Name { get; set; } diff --git a/Maui.DataGrid.Sample/SettingsPopup.xaml.cs b/Maui.DataGrid.Sample/SettingsPopup.xaml.cs index a6a3819..8d38ae2 100644 --- a/Maui.DataGrid.Sample/SettingsPopup.xaml.cs +++ b/Maui.DataGrid.Sample/SettingsPopup.xaml.cs @@ -9,7 +9,7 @@ public partial class SettingsPopup { private readonly MainViewModel _viewModel; - public SettingsPopup(MainViewModel viewModel) + internal SettingsPopup(MainViewModel viewModel) { InitializeComponent(); _viewModel = viewModel; diff --git a/Maui.DataGrid.Sample/ViewModels/MainViewModel.cs b/Maui.DataGrid.Sample/ViewModels/MainViewModel.cs index 830e702..5044a68 100644 --- a/Maui.DataGrid.Sample/ViewModels/MainViewModel.cs +++ b/Maui.DataGrid.Sample/ViewModels/MainViewModel.cs @@ -7,7 +7,7 @@ namespace Maui.DataGrid.Sample.ViewModels; using Maui.DataGrid.Sample.Models; using Maui.DataGrid.Sample.Utils; -public class MainViewModel : ViewModelBase +internal sealed class MainViewModel : ViewModelBase { public MainViewModel() { diff --git a/Maui.DataGrid.Sample/ViewModels/ViewModelBase.cs b/Maui.DataGrid.Sample/ViewModels/ViewModelBase.cs index 26653e3..56d1fb5 100644 --- a/Maui.DataGrid.Sample/ViewModels/ViewModelBase.cs +++ b/Maui.DataGrid.Sample/ViewModels/ViewModelBase.cs @@ -5,7 +5,7 @@ namespace Maui.DataGrid.Sample.ViewModels; using System.Runtime.CompilerServices; using System.Windows.Input; -public abstract class ViewModelBase : INotifyPropertyChanged +internal abstract class ViewModelBase : INotifyPropertyChanged { private readonly Dictionary _properties = [];