diff --git a/src/DateCalculator/DateCalculator.Shared/DateCalculator.Shared.csproj b/src/DateCalculator/DateCalculator.Shared/DateCalculator.Shared.csproj index 765a8c9..04f8c6a 100644 --- a/src/DateCalculator/DateCalculator.Shared/DateCalculator.Shared.csproj +++ b/src/DateCalculator/DateCalculator.Shared/DateCalculator.Shared.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard2.0;net6.0 enable latest enable @@ -9,7 +9,7 @@ - + diff --git a/src/DateCalculator/DateCalculator.Shared/ViewModels/BaseViewModel.cs b/src/DateCalculator/DateCalculator.Shared/ViewModels/BaseViewModel.cs index 28f954c..6581f5c 100644 --- a/src/DateCalculator/DateCalculator.Shared/ViewModels/BaseViewModel.cs +++ b/src/DateCalculator/DateCalculator.Shared/ViewModels/BaseViewModel.cs @@ -7,7 +7,7 @@ namespace VijayAnand.Toolkit.ObjectModel public partial class BaseViewModel : ObservableValidator, IDisposable { [ObservableProperty] - [AlsoNotifyChangeFor(nameof(IsNotBusy))] + [NotifyPropertyChangedFor(nameof(IsNotBusy))] private bool isBusy; [ObservableProperty] @@ -32,7 +32,7 @@ public partial class BaseViewModel : ObservableValidator, IDisposable private bool isValid = true; [ObservableProperty] - private List errors = new(); + private List errors = new(); public BaseViewModel() { diff --git a/src/DateCalculator/DateCalculator.Shared/ViewModels/DateViewModel.cs b/src/DateCalculator/DateCalculator.Shared/ViewModels/DateViewModel.cs index a77c3d7..cb87fa7 100644 --- a/src/DateCalculator/DateCalculator.Shared/ViewModels/DateViewModel.cs +++ b/src/DateCalculator/DateCalculator.Shared/ViewModels/DateViewModel.cs @@ -16,7 +16,7 @@ public partial class DateViewModel : BaseViewModel private DateTime endDate; [ObservableProperty] - [AlsoNotifyChangeFor(nameof(DiffModeInverse))] + [NotifyPropertyChangedFor(nameof(DiffModeInverse))] private bool diffMode; [ObservableProperty] @@ -177,7 +177,7 @@ partial void OnDiffModeChanged(bool value) partial void OnSelectedDayChanged(int value) => FindTheDate(); - [ICommand] + [RelayCommand] private void DateDiff() => FindTheDate(); private void FindTheDate() diff --git a/src/MauiAppCS/MauiAppCS/App.cs b/src/MauiAppCS/MauiAppCS/App.cs index cd01776..a0a06c5 100644 --- a/src/MauiAppCS/MauiAppCS/App.cs +++ b/src/MauiAppCS/MauiAppCS/App.cs @@ -1,12 +1,13 @@ -namespace MauiAppCS +using VijayAnand.MauiToolkit.Services; + +namespace MauiAppCS { public partial class App : Application { public App() { Build(); - - MainPage = new MainPage(); + MainPage = AppService.GetService(); } private void Build() diff --git a/src/MauiAppCS/MauiAppCS/Imports.cs b/src/MauiAppCS/MauiAppCS/Imports.cs index fb169d3..bf6c061 100644 --- a/src/MauiAppCS/MauiAppCS/Imports.cs +++ b/src/MauiAppCS/MauiAppCS/Imports.cs @@ -4,4 +4,4 @@ global using static CommunityToolkit.Maui.Markup.GridRowsColumns; // Static global using static Microsoft.Maui.Graphics.Colors; -global using static VijayAnand.MauiToolkit.Markup.Utility; \ No newline at end of file +global using static VijayAnand.MauiToolkit.Markup.Utility; diff --git a/src/MauiAppCS/MauiAppCS/MainPage.cs b/src/MauiAppCS/MauiAppCS/MainPage.cs index 3eb4dc4..a366eee 100644 --- a/src/MauiAppCS/MauiAppCS/MainPage.cs +++ b/src/MauiAppCS/MauiAppCS/MainPage.cs @@ -2,12 +2,10 @@ { public partial class MainPage : ContentPage { - int count; - Label counter; - - public MainPage() + public MainPage(MainViewModel viewModel) { Build(); + BindingContext = viewModel; } private void Build() @@ -23,38 +21,41 @@ private void Build() { Style = AppResource