Skip to content

Commit

Permalink
removed tinycommand for maui
Browse files Browse the repository at this point in the history
  • Loading branch information
dhindrik committed Aug 25, 2022
1 parent 410dfc4 commit 4cc5f74
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 100 deletions.
93 changes: 0 additions & 93 deletions src/MAUI/TinyMvvm.Maui/TinyCommand.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/MAUI/TinyMvvm.Maui/TinyMvvm.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
<None Remove="CommunityToolkit.Mvvm" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/MAUI/TinyMvvm.Maui/TinyViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public INavigation Navigation
}

[ObservableProperty]
[AlsoNotifyChangeFor(nameof(IsNotBusy))]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
private bool _isBusy;


Expand All @@ -102,7 +102,7 @@ public bool IsNotBusy
}

[ObservableProperty]
[AlsoNotifyChangeFor(nameof(IsNotInitialized))]
[NotifyPropertyChangedFor(nameof(IsNotInitialized))]
private bool _isInitialized;


Expand Down
3 changes: 2 additions & 1 deletion src/MAUI/TinyMvvm.Sample/ViewModels/ListViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using TinyMvvm.Sample.Models;
using TinyMvvm.Sample.Services;

Expand Down Expand Up @@ -29,7 +30,7 @@ public override async Task Initialize()
private ObservableCollection<City> cities = new ObservableCollection<City>();

private ICommand show;
public ICommand Show => show ??= new TinyCommand<City>(async (city) =>
public ICommand Show => show ??= new RelayCommand<City>(async (city) =>
{
await Navigation.NavigateTo($"{nameof(DetailsViewModel)}?city={city.Name}");
});
Expand Down
7 changes: 4 additions & 3 deletions src/MAUI/TinyMvvm.Sample/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.ObjectModel;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using TinyMvvm.Sample.Models;
using TinyMvvm.Sample.Services;

Expand All @@ -20,7 +21,7 @@ public MainViewModel(ICityService cityService)
private string text;

private ICommand search;
public ICommand Search => search ??= new TinyCommand(async () =>
public ICommand Search => search ??= new RelayCommand(async () =>
{
IsBusy = true;

Expand All @@ -34,9 +35,9 @@ public MainViewModel(ICityService cityService)
});

private ICommand show;
public ICommand Show => show ??= new TinyCommand<City>(async (city) =>
public ICommand Show => show ??= new RelayCommand<City>(async (city) =>
{
await Navigation.NavigateTo($"{nameof(DetailsViewModel)}?id=1", city);
await Navigation.NavigateTo($"{nameof(DetailsViewModel)}", city.Country);
});

[ObservableProperty]
Expand Down

0 comments on commit 4cc5f74

Please sign in to comment.