diff --git a/Demo/App.csproj b/Demo/App.csproj index 89dbdf8..3772ef2 100644 --- a/Demo/App.csproj +++ b/Demo/App.csproj @@ -17,6 +17,8 @@ 1 14.2 21.0 + + true @@ -36,8 +38,9 @@ - - + + + diff --git a/Demo/App.xaml.cs b/Demo/App.xaml.cs index f5edcc0..ab11eef 100644 --- a/Demo/App.xaml.cs +++ b/Demo/App.xaml.cs @@ -5,7 +5,7 @@ public partial class App : Application public App() { InitializeComponent(); - - MainPage = new AppShell(); } + + protected override Window CreateWindow(IActivationState? activationState) => new Window(new AppShell()); } \ No newline at end of file diff --git a/Demo/Controls/Examples/CustomButton.xaml b/Demo/Controls/Examples/CustomButton.xaml index 601a890..1ee0cf0 100644 --- a/Demo/Controls/Examples/CustomButton.xaml +++ b/Demo/Controls/Examples/CustomButton.xaml @@ -2,9 +2,10 @@ - + - diff --git a/Demo/Controls/Examples/Example5.xaml b/Demo/Controls/Examples/Example5.xaml index 6696710..a4ae642 100644 --- a/Demo/Controls/Examples/Example5.xaml +++ b/Demo/Controls/Examples/Example5.xaml @@ -31,7 +31,8 @@ TextColor="#FF0071" TextTransform="Uppercase"> - diff --git a/Demo/Controls/Examples/Example6.xaml b/Demo/Controls/Examples/Example6.xaml index 0fd1937..a8541a8 100644 --- a/Demo/Controls/Examples/Example6.xaml +++ b/Demo/Controls/Examples/Example6.xaml @@ -2,9 +2,10 @@ - + - + + Title="Event command page" + x:DataType="app:TestViewModel"> @@ -74,7 +75,8 @@ Text="Test" TextColor="Black"> - diff --git a/Demo/Pages/EventCommandPage.xaml.cs b/Demo/Pages/EventCommandPage.xaml.cs index fa22d59..eed0225 100644 --- a/Demo/Pages/EventCommandPage.xaml.cs +++ b/Demo/Pages/EventCommandPage.xaml.cs @@ -26,10 +26,10 @@ 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) + if(textExtender is not null) { textExtender.Text = "See more.."; } @@ -37,7 +37,7 @@ void TapGestureRecognizer_OnTapped(object sender, EventArgs e) else { Description.MaxLines = int.MaxValue; - if (textExtender is not null) + if(textExtender is not null) { textExtender.Text = "See less..."; } diff --git a/Demo/Platforms/Android/AndroidManifest.xml b/Demo/Platforms/Android/AndroidManifest.xml index e9937ad..bdeb5f8 100644 --- a/Demo/Platforms/Android/AndroidManifest.xml +++ b/Demo/Platforms/Android/AndroidManifest.xml @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/Demo/Platforms/Android/MainActivity.cs b/Demo/Platforms/Android/MainActivity.cs index c6ff6e4..5e48da2 100644 --- a/Demo/Platforms/Android/MainActivity.cs +++ b/Demo/Platforms/Android/MainActivity.cs @@ -1,6 +1,5 @@ using Android.App; using Android.Content.PM; -using Microsoft.Maui; namespace App; diff --git a/Demo/Platforms/iOS/AppDelegate.cs b/Demo/Platforms/iOS/AppDelegate.cs index c68523c..1510449 100644 --- a/Demo/Platforms/iOS/AppDelegate.cs +++ b/Demo/Platforms/iOS/AppDelegate.cs @@ -1,5 +1,4 @@ using Foundation; -using Microsoft.Maui; namespace App; diff --git a/Demo/Resources/AppIcon/appicon.svg b/Demo/Resources/AppIcon/appicon.svg index 9d63b65..3a4c176 100644 --- a/Demo/Resources/AppIcon/appicon.svg +++ b/Demo/Resources/AppIcon/appicon.svg @@ -1,4 +1,4 @@ - + - + \ No newline at end of file diff --git a/Demo/Resources/AppIcon/appiconfg.svg b/Demo/Resources/AppIcon/appiconfg.svg index 21dfb25..b27682e 100644 --- a/Demo/Resources/AppIcon/appiconfg.svg +++ b/Demo/Resources/AppIcon/appiconfg.svg @@ -1,8 +1,8 @@ - + - - - - + + + + \ No newline at end of file diff --git a/Demo/Resources/Images/dotnet_bot.svg b/Demo/Resources/Images/dotnet_bot.svg index abfaff2..dffd9b7 100644 --- a/Demo/Resources/Images/dotnet_bot.svg +++ b/Demo/Resources/Images/dotnet_bot.svg @@ -1,93 +1,93 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demo/Resources/Splash/splash.svg b/Demo/Resources/Splash/splash.svg index 21dfb25..b27682e 100644 --- a/Demo/Resources/Splash/splash.svg +++ b/Demo/Resources/Splash/splash.svg @@ -1,8 +1,8 @@ - + - - - - + + + + \ No newline at end of file diff --git a/Demo/ViewModels/TestViewModel.cs b/Demo/ViewModels/TestViewModel.cs index 461e61d..cc68e16 100644 --- a/Demo/ViewModels/TestViewModel.cs +++ b/Demo/ViewModels/TestViewModel.cs @@ -26,10 +26,10 @@ static async Task Released() static async Task Alert(string title, string message) { - Page? mainpage = Application.Current?.MainPage; - if (mainpage is not null) + Page? mainPage = Application.Current?.Windows[0].Page; + if(mainPage is not null) { - await mainpage.DisplayAlert(title, message, "OK"); + await mainPage.DisplayAlert(title, message, "OK"); } } } \ No newline at end of file diff --git a/Scr/IeuanWalker.Maui.StateButton.csproj b/Scr/IeuanWalker.Maui.StateButton.csproj index ae70700..30f3b54 100644 --- a/Scr/IeuanWalker.Maui.StateButton.csproj +++ b/Scr/IeuanWalker.Maui.StateButton.csproj @@ -42,12 +42,6 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - @@ -66,4 +60,11 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + \ No newline at end of file diff --git a/Scr/Platform/CustomContentViewGroup.Android.cs b/Scr/Platform/CustomContentViewGroup.Android.cs index baf907b..363cd5d 100644 --- a/Scr/Platform/CustomContentViewGroup.Android.cs +++ b/Scr/Platform/CustomContentViewGroup.Android.cs @@ -20,12 +20,12 @@ public CustomContentViewGroup(Context context, IBorderView virtualView) : base(c Touch += (sender, te) => { - if (sender is not Android.Views.View view) + if(sender is not Android.Views.View view) { return; } - switch (te?.Event?.Action) + switch(te?.Event?.Action) { case MotionEventActions.Down: _rect = new Rect(view.Left, view.Top, view.Right, view.Bottom); @@ -34,7 +34,7 @@ public CustomContentViewGroup(Context context, IBorderView virtualView) : base(c break; case MotionEventActions.Up: - if (_rect.Contains(view.Left + (int)te.Event.GetX(), view.Top + (int)te.Event.GetY())) + if(_rect.Contains(view.Left + (int)te.Event.GetX(), view.Top + (int)te.Event.GetY())) { _stateButton.InvokeReleased(); _stateButton.InvokeClicked(); @@ -51,7 +51,7 @@ public CustomContentViewGroup(Context context, IBorderView virtualView) : base(c break; case MotionEventActions.Move: - if (!_rect.Contains(view.Left + (int)te.Event.GetX(), view.Top + (int)te.Event.GetY())) + if(!_rect.Contains(view.Left + (int)te.Event.GetX(), view.Top + (int)te.Event.GetY())) { _stateButton.InvokeReleased(); } diff --git a/Scr/StateButton.xaml.cs b/Scr/StateButton.xaml.cs index 3ed691a..02f8631 100644 --- a/Scr/StateButton.xaml.cs +++ b/Scr/StateButton.xaml.cs @@ -137,7 +137,7 @@ public StateButton() internal void InvokePressed() { - if (!IsEnabled) + if(!IsEnabled) { return; } @@ -150,12 +150,12 @@ internal void InvokePressed() internal void InvokeReleased() { - if (!IsEnabled) + if(!IsEnabled) { return; } - if (State.Equals(ButtonState.NotPressed)) + if(State.Equals(ButtonState.NotPressed)) { return; } @@ -168,7 +168,7 @@ internal void InvokeReleased() internal void InvokeClicked() { - if (!IsEnabled) + if(!IsEnabled) { return; }