diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fdbd22e5..94991546 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, macos-13] + os: [windows-latest, macos-14] steps: - name: Prepare variables on Windows @@ -26,7 +26,7 @@ jobs: echo "WORKING_DIRECTORY_PATH=C:/Projects/MauiSamples" >> $env:GITHUB_ENV - name: Prepare variables on macOS - if: ${{ matrix.os == 'macos-13' }} + if: ${{ matrix.os == 'macos-14' }} run: | echo "WORKING_DIRECTORY_PATH=/Users/runner/Projects/MauiSamples" >> $GITHUB_ENV @@ -37,15 +37,15 @@ jobs: git checkout ${{ github.head_ref || github.ref_name }} - name: Setup Xcode - if: ${{ matrix.os == 'macos-13' }} + if: ${{ matrix.os == 'macos-14' }} uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '15.1' + xcode-version: '16.0' - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 9.x - name: Install dependencies run: dotnet workload install maui @@ -60,4 +60,4 @@ jobs: run: | cd ${{ env.WORKING_DIRECTORY_PATH }} dotnet restore --configfile NuGet.config - dotnet build --tl + dotnet build diff --git a/AndroidBindableLibraries/Balloon/Balloon.csproj b/AndroidBindableLibraries/Balloon/Balloon.csproj index b7a9814d..e3778404 100644 --- a/AndroidBindableLibraries/Balloon/Balloon.csproj +++ b/AndroidBindableLibraries/Balloon/Balloon.csproj @@ -2,7 +2,7 @@ 23 VladislavAntonyuk.$(AssemblyName) - 1.6.4 + 1.6.4.1 ReadMe.md ..\..\LocalPackages\ @@ -18,22 +18,22 @@ 8.4.0 - 2.7.0.2 + 2.8.5.1 - 1.7.1.2 + 1.8.2.1 - 1.9.23.1 + 2.0.10.1 - 1.6.1.8 + 1.7.0.3 - 1.13.1 + 1.13.1.5 - 1.7.0 + 1.8.3.1 diff --git a/AndroidBindableLibraries/Directory.Build.props b/AndroidBindableLibraries/Directory.Build.props index 1ef3cd4d..a72c6e98 100644 --- a/AndroidBindableLibraries/Directory.Build.props +++ b/AndroidBindableLibraries/Directory.Build.props @@ -1,7 +1,7 @@  - net8.0-android + net9.0-android enable enable true diff --git a/AndroidBindableLibraries/MaterialCalendarView/MaterialCalendarView.csproj b/AndroidBindableLibraries/MaterialCalendarView/MaterialCalendarView.csproj index ba3d8ed4..af68a120 100644 --- a/AndroidBindableLibraries/MaterialCalendarView/MaterialCalendarView.csproj +++ b/AndroidBindableLibraries/MaterialCalendarView/MaterialCalendarView.csproj @@ -2,7 +2,7 @@ 23 VladislavAntonyuk.$(AssemblyName) - 1.9.0 + 1.9.0.1 ReadMe.md ..\..\LocalPackages\ @@ -17,28 +17,28 @@ - 1.6.1.7 + 1.7.0.3 2.1.4.10 - 1.12.0.4 + 1.13.1.5 - 1.9.23 + 2.0.10.1 1.9.23 - - - + + + - 1.6.2.2 + 1.8.3.1 diff --git a/AndroidBindableLibraries/Sample/App.xaml.cs b/AndroidBindableLibraries/Sample/App.xaml.cs index 0d0f7b65..7e3f336b 100644 --- a/AndroidBindableLibraries/Sample/App.xaml.cs +++ b/AndroidBindableLibraries/Sample/App.xaml.cs @@ -1,12 +1,14 @@ -namespace Sample +namespace Sample; + +public partial class App : Application { - public partial class App : Application + public App() { - public App() - { - InitializeComponent(); + InitializeComponent(); + } - MainPage = new AppShell(); - } + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new AppShell()); } -} +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Sample/AppShell.xaml.cs b/AndroidBindableLibraries/Sample/AppShell.xaml.cs index a3797080..198efea1 100644 --- a/AndroidBindableLibraries/Sample/AppShell.xaml.cs +++ b/AndroidBindableLibraries/Sample/AppShell.xaml.cs @@ -1,10 +1,9 @@ -namespace Sample +namespace Sample; + +public partial class AppShell : Shell { - public partial class AppShell : Shell + public AppShell() { - public AppShell() - { - InitializeComponent(); - } + InitializeComponent(); } -} +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Sample/Calendar/CalendarMaterialHandler.cs b/AndroidBindableLibraries/Sample/Calendar/CalendarMaterialHandler.cs index 3a72e6fa..7fb9751b 100644 --- a/AndroidBindableLibraries/Sample/Calendar/CalendarMaterialHandler.cs +++ b/AndroidBindableLibraries/Sample/Calendar/CalendarMaterialHandler.cs @@ -39,9 +39,8 @@ protected override void ConnectHandler(Calendar platformView) private void PlatformView_SelectedDatesChanged(object? sender, CalendarDayClickEventArgs e) { var calendar = e.CalendarDay.Calendar; - var time = TimeSpan.FromMilliseconds(calendar.TimeInMillis); - var result = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - VirtualView.SelectedDate = new DateTimeOffset(result.Add(time).Add(TimeSpan.FromMilliseconds(calendar.TimeZone.RawOffset))); + var result = new DateTimeOffset(new DateTime(1970, 1, 1, 0, 0, 0)); + VirtualView.SelectedDate = result.AddMilliseconds(calendar.TimeInMillis).Add(result.Offset); VirtualView.OnSelectedDateChanged(VirtualView.SelectedDate); } diff --git a/AndroidBindableLibraries/Sample/MainPage.xaml.cs b/AndroidBindableLibraries/Sample/MainPage.xaml.cs index 8d63a8c5..dfda529e 100644 --- a/AndroidBindableLibraries/Sample/MainPage.xaml.cs +++ b/AndroidBindableLibraries/Sample/MainPage.xaml.cs @@ -1,52 +1,51 @@ -namespace Sample -{ - using Android.Views; - using Com.Skydoves.Balloon; - using Microsoft.Maui.Platform; +namespace Sample; - public partial class MainPage : ContentPage - { - public MainPage() - { - InitializeComponent(); - } +using Android.Views; +using Com.Skydoves.Balloon; +using Microsoft.Maui.Platform; - private void OnCounterClicked(object sender, EventArgs e) - { - var balloon = new Balloon.Builder(Platform.AppContext) - .SetText("Edit your profile here!") - .SetTextSize(15f) - .SetArrowPositionRules(ArrowPositionRules.AlignAnchor) - .SetArrowSize(10) - .SetArrowPosition(0.5f) - .SetPadding(12) - .SetCornerRadius(8f) - .SetBalloonAnimation(BalloonAnimation.Elastic) - .SetOnBalloonDismissListener(new BallonDismissListener(() => - { - var balloon2 = new Balloon.Builder(Platform.AppContext) - .SetWidthRatio(1.0f) - .SetHeight(BalloonSizeSpec.Wrap) - .SetLayout(new BallonContent().ToPlatform(Handler.MauiContext)) - .SetArrowPositionRules(ArrowPositionRules.AlignAnchor) - .SetArrowSize(10) - .SetArrowPosition(0.5f) - .SetPadding(12) - .SetCornerRadius(8f) - .SetBalloonAnimation(BalloonAnimation.Fade) - .Build(); - balloon2.ShowAtCenter(MauiLabel.ToPlatform(MauiLabel.Handler.MauiContext)); - })) - .Build(); - balloon.ShowAtCenter(CounterBtn.ToPlatform(CounterBtn.Handler.MauiContext)); - } +public partial class MainPage : ContentPage +{ + public MainPage() + { + InitializeComponent(); } - internal class BallonDismissListener(Action action) : Java.Lang.Object, IOnBalloonDismissListener + private void OnCounterClicked(object sender, EventArgs e) { - public void OnBalloonDismiss() - { - action(); - } + var balloon = new Balloon.Builder(Platform.AppContext) + .SetText("Edit your profile here!") + .SetTextSize(15f) + .SetArrowPositionRules(ArrowPositionRules.AlignAnchor) + .SetArrowSize(10) + .SetArrowPosition(0.5f) + .SetPadding(12) + .SetCornerRadius(8f) + .SetBalloonAnimation(BalloonAnimation.Elastic) + .SetOnBalloonDismissListener(new BallonDismissListener(() => + { + var balloon2 = new Balloon.Builder(Platform.AppContext) + .SetWidthRatio(1.0f) + .SetHeight(BalloonSizeSpec.Wrap) + .SetLayout(new BallonContent().ToPlatform(Handler.MauiContext)) + .SetArrowPositionRules(ArrowPositionRules.AlignAnchor) + .SetArrowSize(10) + .SetArrowPosition(0.5f) + .SetPadding(12) + .SetCornerRadius(8f) + .SetBalloonAnimation(BalloonAnimation.Fade) + .Build(); + balloon2.ShowAtCenter(MauiLabel.ToPlatform(MauiLabel.Handler.MauiContext)); + })) + .Build(); + balloon.ShowAtCenter(CounterBtn.ToPlatform(CounterBtn.Handler.MauiContext)); } } + +internal class BallonDismissListener(Action action) : Java.Lang.Object, IOnBalloonDismissListener +{ + public void OnBalloonDismiss() + { + action(); + } +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Sample/MauiProgram.cs b/AndroidBindableLibraries/Sample/MauiProgram.cs index 651db428..190e02b0 100644 --- a/AndroidBindableLibraries/Sample/MauiProgram.cs +++ b/AndroidBindableLibraries/Sample/MauiProgram.cs @@ -1,26 +1,25 @@ -namespace Sample -{ - using Calendar; - using MauiBells.Calendar; +namespace Sample; + +using Calendar; +using MauiBells.Calendar; - public static class MauiProgram +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() { - public static MauiApp CreateMauiApp() - { - var builder = MauiApp.CreateBuilder(); - builder - .UseMauiApp() - .ConfigureFonts(fonts => - { - fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); - fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); - }) - .ConfigureMauiHandlers(x => - { - x.AddHandler(); - }); + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }) + .ConfigureMauiHandlers(x => + { + x.AddHandler(); + }); - return builder.Build(); - } + return builder.Build(); } -} +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Sample/Platforms/Android/MainActivity.cs b/AndroidBindableLibraries/Sample/Platforms/Android/MainActivity.cs index 0873ecd5..20841d06 100644 --- a/AndroidBindableLibraries/Sample/Platforms/Android/MainActivity.cs +++ b/AndroidBindableLibraries/Sample/Platforms/Android/MainActivity.cs @@ -1,11 +1,10 @@ -namespace Sample -{ - using Android.App; - using Android.Content.PM; - using Android.OS; +namespace Sample; + +using Android.App; +using Android.Content.PM; +using Android.OS; - [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] - public class MainActivity : MauiAppCompatActivity - { - } -} +[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] +public class MainActivity : MauiAppCompatActivity +{ +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Sample/Platforms/Android/MainApplication.cs b/AndroidBindableLibraries/Sample/Platforms/Android/MainApplication.cs index 0b3d7ab1..139582da 100644 --- a/AndroidBindableLibraries/Sample/Platforms/Android/MainApplication.cs +++ b/AndroidBindableLibraries/Sample/Platforms/Android/MainApplication.cs @@ -1,16 +1,15 @@ -namespace Sample -{ - using Android.App; - using Android.Runtime; +namespace Sample; - [Application] - public class MainApplication : MauiApplication - { - public MainApplication(IntPtr handle, JniHandleOwnership ownership) - : base(handle, ownership) - { - } +using Android.App; +using Android.Runtime; - protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { } -} + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Sample/Sample.csproj b/AndroidBindableLibraries/Sample/Sample.csproj index 4fdca70f..772b60fa 100644 --- a/AndroidBindableLibraries/Sample/Sample.csproj +++ b/AndroidBindableLibraries/Sample/Sample.csproj @@ -40,10 +40,9 @@ - - - - + + + diff --git a/Auth/AuthServices/AuthServices.csproj b/Auth/AuthServices/AuthServices.csproj index 1c8fb5f6..0cc8ca3c 100644 --- a/Auth/AuthServices/AuthServices.csproj +++ b/Auth/AuthServices/AuthServices.csproj @@ -5,7 +5,7 @@ - + diff --git a/Auth/MauiAuth/App.xaml.cs b/Auth/MauiAuth/App.xaml.cs index d6929639..a4929db2 100644 --- a/Auth/MauiAuth/App.xaml.cs +++ b/Auth/MauiAuth/App.xaml.cs @@ -3,10 +3,16 @@ public partial class App : Application { + private readonly MainPage mainPage; + public App(MainPage mainPage) { + this.mainPage = mainPage; InitializeComponent(); + } - MainPage = new NavigationPage(mainPage); + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new NavigationPage(mainPage)); } } \ No newline at end of file diff --git a/Auth/MauiAuth/MauiAuth.csproj b/Auth/MauiAuth/MauiAuth.csproj index 0618a01b..14e4265c 100644 --- a/Auth/MauiAuth/MauiAuth.csproj +++ b/Auth/MauiAuth/MauiAuth.csproj @@ -25,8 +25,8 @@ - - + + diff --git a/Auth/MauiAuthBlazor/App.xaml.cs b/Auth/MauiAuthBlazor/App.xaml.cs index 9ae5805b..c6719904 100644 --- a/Auth/MauiAuthBlazor/App.xaml.cs +++ b/Auth/MauiAuthBlazor/App.xaml.cs @@ -5,7 +5,10 @@ public partial class App : Application public App() { InitializeComponent(); + } - MainPage = new MainPage(); + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new MainPage()); } } \ No newline at end of file diff --git a/Auth/MauiAuthBlazor/MauiAuthBlazor.csproj b/Auth/MauiAuthBlazor/MauiAuthBlazor.csproj index db3e97bb..9effe18a 100644 --- a/Auth/MauiAuthBlazor/MauiAuthBlazor.csproj +++ b/Auth/MauiAuthBlazor/MauiAuthBlazor.csproj @@ -26,7 +26,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/BottomSheet/App.xaml.cs b/BottomSheet/App.xaml.cs index 08b66091..5a267e8a 100644 --- a/BottomSheet/App.xaml.cs +++ b/BottomSheet/App.xaml.cs @@ -5,7 +5,10 @@ public partial class App : Application public App() { InitializeComponent(); + } - MainPage = new AppShell(); + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new AppShell()); } } \ No newline at end of file diff --git a/CardLayout/App.xaml.cs b/CardLayout/App.xaml.cs index 0e82b80f..e7e35d85 100644 --- a/CardLayout/App.xaml.cs +++ b/CardLayout/App.xaml.cs @@ -5,7 +5,10 @@ public partial class App : Application public App() { InitializeComponent(); + } - MainPage = new AppShell(); + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new AppShell()); } } \ No newline at end of file diff --git a/CardLayout/CardLayout.csproj b/CardLayout/CardLayout.csproj index 3a17f47d..054ccb58 100644 --- a/CardLayout/CardLayout.csproj +++ b/CardLayout/CardLayout.csproj @@ -26,7 +26,7 @@ - + diff --git a/CardLayout/CardsLayout.cs b/CardLayout/CardsLayout.cs index e81b6f18..2fa969d2 100644 --- a/CardLayout/CardsLayout.cs +++ b/CardLayout/CardsLayout.cs @@ -310,7 +310,7 @@ public Size ArrangeChildren(Rect rectangle) totalHeight + Padding.VerticalThickness); } - public Size Measure(double widthConstraint, double heightConstraint) + public new Size Measure(double widthConstraint, double heightConstraint) { widthConstraint -= Padding.HorizontalThickness; heightConstraint -= Padding.VerticalThickness; diff --git a/CardLayout/MauiProgram.cs b/CardLayout/MauiProgram.cs index 2dd055f0..5c626065 100644 --- a/CardLayout/MauiProgram.cs +++ b/CardLayout/MauiProgram.cs @@ -1,13 +1,11 @@ namespace CardLayout; -using Microsoft.Maui.Controls.Compatibility.Hosting; - public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); - builder.UseMauiApp().UseMauiCompatibility(); + builder.UseMauiApp(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); diff --git a/KanbanBoard/App.xaml b/Database/KanbanBoard/KanbanBoard/App.xaml similarity index 100% rename from KanbanBoard/App.xaml rename to Database/KanbanBoard/KanbanBoard/App.xaml diff --git a/KanbanBoard/App.xaml.cs b/Database/KanbanBoard/KanbanBoard/App.xaml.cs similarity index 73% rename from KanbanBoard/App.xaml.cs rename to Database/KanbanBoard/KanbanBoard/App.xaml.cs index c68eacf4..aed3ac7d 100644 --- a/KanbanBoard/App.xaml.cs +++ b/Database/KanbanBoard/KanbanBoard/App.xaml.cs @@ -1,5 +1,6 @@ namespace KanbanBoard; using KanbanBoard.Models; +using KanbanBoardDb; using Microsoft.EntityFrameworkCore; using Application = Microsoft.Maui.Controls.Application; @@ -11,8 +12,17 @@ public App(IServiceProvider serviceProvider) { InitializeComponent(); this.serviceProvider = serviceProvider; + } + + protected override void OnStart() + { + base.OnStart(); AddTestData().Wait(); - MainPage = serviceProvider.GetRequiredService(); + } + + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(serviceProvider.GetRequiredService()); } private async Task AddTestData() @@ -24,12 +34,12 @@ private async Task AddTestData() var items = await appContext.Columns.Include(x => x.Cards).ToArrayAsync(); if (items.Length == 0) { - var todoColumn = new Column + var todoColumn = new KanbanColumn { Name = "ToDo", Order = 0 }; - var inProgressColumn = new Column + var inProgressColumn = new KanbanColumn { Name = "In Progress", Order = 1, @@ -37,27 +47,27 @@ private async Task AddTestData() }; await appContext.AddAsync(todoColumn); await appContext.AddAsync(inProgressColumn); - await appContext.AddAsync(new Column + await appContext.AddAsync(new KanbanColumn { Name = "Done", Order = 2 }); - await appContext.AddAsync(new Card + await appContext.AddAsync(new KanbanCard { Name = "Card 1", Description = "Description for card 1", Order = 0, Column = todoColumn }); - await appContext.AddAsync(new Card + await appContext.AddAsync(new KanbanCard { Name = "Card 2", Description = "Description for card 2", Order = 1, Column = todoColumn }); - await appContext.AddAsync(new Card + await appContext.AddAsync(new KanbanCard { Name = "Card 3", Description = "Description for card 3", diff --git a/KanbanBoard/BoolToColorConverter.cs b/Database/KanbanBoard/KanbanBoard/BoolToColorConverter.cs similarity index 94% rename from KanbanBoard/BoolToColorConverter.cs rename to Database/KanbanBoard/KanbanBoard/BoolToColorConverter.cs index c8376582..5cc1508a 100644 --- a/KanbanBoard/BoolToColorConverter.cs +++ b/Database/KanbanBoard/KanbanBoard/BoolToColorConverter.cs @@ -2,6 +2,7 @@ using System.Globalization; +[AcceptEmptyServiceProvider] public class BoolToColorConverter : IValueConverter { public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) diff --git a/KanbanBoard/Extensions.cs b/Database/KanbanBoard/KanbanBoard/Extensions.cs similarity index 100% rename from KanbanBoard/Extensions.cs rename to Database/KanbanBoard/KanbanBoard/Extensions.cs diff --git a/KanbanBoard/KanbanBoard.csproj b/Database/KanbanBoard/KanbanBoard/KanbanBoard.csproj similarity index 73% rename from KanbanBoard/KanbanBoard.csproj rename to Database/KanbanBoard/KanbanBoard/KanbanBoard.csproj index 6569fcbc..c174607a 100644 --- a/KanbanBoard/KanbanBoard.csproj +++ b/Database/KanbanBoard/KanbanBoard/KanbanBoard.csproj @@ -27,20 +27,19 @@ - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - - - + + + + + + + + diff --git a/KanbanBoard/MainPage.xaml b/Database/KanbanBoard/KanbanBoard/MainPage.xaml similarity index 96% rename from KanbanBoard/MainPage.xaml rename to Database/KanbanBoard/KanbanBoard/MainPage.xaml index 330e4448..ef8c1200 100644 --- a/KanbanBoard/MainPage.xaml +++ b/Database/KanbanBoard/KanbanBoard/MainPage.xaml @@ -107,7 +107,7 @@ Grid.Column="0" FontAttributes="Bold" FontSize="{StaticResource ColumnTitleSize}" - Text="{Binding Column.Name}" /> + Text="{Binding KanbanColumn.Name}" /> @@ -174,13 +174,13 @@ Grid.Column="0" FontAttributes="Bold" FontSize="{StaticResource CardTitleSize}" - Text="{Binding Card.Name}" /> + Text="{Binding KanbanCard.Name}" />