diff --git a/Demo/App.xaml.cs b/Demo/App.xaml.cs index ab11eef..0e3efdf 100644 --- a/Demo/App.xaml.cs +++ b/Demo/App.xaml.cs @@ -7,5 +7,5 @@ public App() InitializeComponent(); } - protected override Window CreateWindow(IActivationState? activationState) => new Window(new AppShell()); + protected override Window CreateWindow(IActivationState? activationState) => new(new AppShell()); } \ No newline at end of file diff --git a/Demo/Pages/AccessibilityTestPage.xaml.cs b/Demo/Pages/AccessibilityTestPage.xaml.cs index 06f6a09..a11a168 100644 --- a/Demo/Pages/AccessibilityTestPage.xaml.cs +++ b/Demo/Pages/AccessibilityTestPage.xaml.cs @@ -9,16 +9,16 @@ public AccessibilityTestPage() async void Button_Clicked(object sender, EventArgs e) { - await DisplayAlert("Clicked", string.Empty, "OK"); + await DisplayAlertAsync("Clicked", string.Empty, "OK"); } async void Example6_Pressed(object sender, EventArgs e) { - await DisplayAlert("Pressed", string.Empty, "OK"); + await DisplayAlertAsync("Pressed", string.Empty, "OK"); } async void Example6_Released(object sender, EventArgs e) { - await DisplayAlert("Release", string.Empty, "OK"); + await DisplayAlertAsync("Release", string.Empty, "OK"); } } \ No newline at end of file diff --git a/Demo/Pages/ButtonNotInScrollViewPage.xaml.cs b/Demo/Pages/ButtonNotInScrollViewPage.xaml.cs index 46b6015..37b6604 100644 --- a/Demo/Pages/ButtonNotInScrollViewPage.xaml.cs +++ b/Demo/Pages/ButtonNotInScrollViewPage.xaml.cs @@ -9,11 +9,11 @@ public ButtonNotInScrollViewPage() async void StateButton_Clicked(object sender, EventArgs e) { - await DisplayAlert("Clicked", string.Empty, "OK"); + await DisplayAlertAsync("Clicked", string.Empty, "OK"); } async void StateButton_Released(object sender, EventArgs e) { - await DisplayAlert("Release", string.Empty, "OK"); + await DisplayAlertAsync("Release", string.Empty, "OK"); } } \ No newline at end of file diff --git a/Demo/Pages/EventCommandPage.xaml.cs b/Demo/Pages/EventCommandPage.xaml.cs index eed0225..f0c2799 100644 --- a/Demo/Pages/EventCommandPage.xaml.cs +++ b/Demo/Pages/EventCommandPage.xaml.cs @@ -9,53 +9,47 @@ public EventCommandPage() async void StateButton_OnClicked(object sender, EventArgs e) { - await DisplayAlert("Clicked event", "Button clicked", "OK"); + await DisplayAlertAsync("Clicked event", "Button clicked", "OK"); } async void StateButton_OnPressed(object sender, EventArgs e) { - await DisplayAlert("Pressed event", "Button pressed", "OK"); + await DisplayAlertAsync("Pressed event", "Button pressed", "OK"); } async void StateButton_OnReleased(object sender, EventArgs e) { - await DisplayAlert("Released event", "Button released", "OK"); + await DisplayAlertAsync("Released event", "Button released", "OK"); } void TapGestureRecognizer_OnTapped(object sender, EventArgs e) { Label? textExtender = sender as Label; - if(Description.MaxLines == int.MaxValue) + if (Description.MaxLines == int.MaxValue) { Description.MaxLines = 3; - if(textExtender is not null) - { - textExtender.Text = "See more.."; - } + textExtender?.Text = "See more.."; } else { Description.MaxLines = int.MaxValue; - if(textExtender is not null) - { - textExtender.Text = "See less..."; - } + textExtender?.Text = "See less..."; } } async void Card_OnClicked(object sender, EventArgs e) { - await DisplayAlert("Card click", string.Empty, "OK"); + await DisplayAlertAsync("Card click", string.Empty, "OK"); } async void Button_OnClicked(object sender, EventArgs e) { - await DisplayAlert("XF button clicked", string.Empty, "OK"); + await DisplayAlertAsync("XF button clicked", string.Empty, "OK"); } async void NestButton_OnClicked(object sender, EventArgs e) { - await DisplayAlert("Nested state button clicked", string.Empty, "OK"); + await DisplayAlertAsync("Nested state button clicked", string.Empty, "OK"); } } \ No newline at end of file diff --git a/Demo/Platforms/Android/MainActivity.cs b/Demo/Platforms/Android/MainActivity.cs index 5e48da2..f8b587b 100644 --- a/Demo/Platforms/Android/MainActivity.cs +++ b/Demo/Platforms/Android/MainActivity.cs @@ -4,6 +4,4 @@ namespace App; [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] -public class MainActivity : MauiAppCompatActivity -{ -} \ No newline at end of file +public class MainActivity : MauiAppCompatActivity; \ No newline at end of file diff --git a/Demo/Platforms/Android/MainApplication.cs b/Demo/Platforms/Android/MainApplication.cs index f4a2ba0..622bcd7 100644 --- a/Demo/Platforms/Android/MainApplication.cs +++ b/Demo/Platforms/Android/MainApplication.cs @@ -4,11 +4,7 @@ namespace App; [Application] -public class MainApplication : MauiApplication +public class MainApplication(IntPtr handle, JniHandleOwnership ownership) : MauiApplication(handle, ownership) { - public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership) - { - } - protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); } \ No newline at end of file diff --git a/Demo/ViewModels/TestViewModel.cs b/Demo/ViewModels/TestViewModel.cs index cc68e16..b41a5a8 100644 --- a/Demo/ViewModels/TestViewModel.cs +++ b/Demo/ViewModels/TestViewModel.cs @@ -1,9 +1,7 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; +using CommunityToolkit.Mvvm.Input; namespace App.ViewModels; -[INotifyPropertyChanged] public partial class TestViewModel { [RelayCommand] @@ -27,9 +25,9 @@ static async Task Released() static async Task Alert(string title, string message) { Page? mainPage = Application.Current?.Windows[0].Page; - if(mainPage is not null) + if (mainPage is not null) { - await mainPage.DisplayAlert(title, message, "OK"); + await mainPage.DisplayAlertAsync(title, message, "OK"); } } } \ No newline at end of file diff --git a/Scr/Handler/IStateButtonHandler.cs b/Scr/Handler/IStateButtonHandler.cs index 95cce0f..7bfb72c 100644 --- a/Scr/Handler/IStateButtonHandler.cs +++ b/Scr/Handler/IStateButtonHandler.cs @@ -2,6 +2,4 @@ namespace IeuanWalker.Maui.StateButton.Handler; -public interface IStateButtonHandler : IBorderHandler -{ -} \ No newline at end of file +public interface IStateButtonHandler : IBorderHandler; \ No newline at end of file diff --git a/Scr/Handler/StateButtonHandler.cs b/Scr/Handler/StateButtonHandler.cs index 6052a2e..af4e081 100644 --- a/Scr/Handler/StateButtonHandler.cs +++ b/Scr/Handler/StateButtonHandler.cs @@ -2,6 +2,4 @@ namespace IeuanWalker.Maui.StateButton.Handler; -public partial class StateButtonHandler : BorderHandler, IStateButtonHandler -{ -} \ No newline at end of file +public partial class StateButtonHandler : BorderHandler, IStateButtonHandler; \ No newline at end of file