Add project files.

This commit is contained in:
2024-04-22 16:48:36 +02:00
parent 35c4a91ec6
commit 086cb833f6
45 changed files with 1330 additions and 0 deletions

View File

@ -0,0 +1,43 @@
namespace MonkeyFinder.ViewModel;
[QueryProperty("Monkey", "Monkey")]
public partial class MonkeyDetailsViewModel : BaseViewModel
{
IMap map;
public MonkeyDetailsViewModel(IMap map)
{
this.map = map;
}
[ObservableProperty]
Monkey monkey;
//[RelayCommand]
//async Task GoBackAsync()
//{
// await Shell.Current.GoToAsync("..");
//}
[RelayCommand]
async Task OpenMapAsync()
{
try
{
await map.OpenAsync(Monkey.Latitude, Monkey.Longitude,
new MapLaunchOptions
{
Name = Monkey.Name,
NavigationMode = NavigationMode.None
});
}
catch (Exception ex)
{
Debug.WriteLine(ex);
await Shell.Current.DisplayAlert("Error!",
$"Unable to open map: {ex.Message}", "OK");
}
}
}