diff --git a/.github/workflows/build-validation.yml b/.github/workflows/build-validation.yml
index 9b362c16..5aa17ec9 100644
--- a/.github/workflows/build-validation.yml
+++ b/.github/workflows/build-validation.yml
@@ -17,7 +17,7 @@ on:
- '**.props'
env:
- DOTNET_VERSION: '9.0.x' # The .NET SDK version to use
+ DOTNET_VERSION: '10.0.x' # The .NET SDK version to use
jobs:
build:
diff --git a/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/MonkeyFinder.csproj b/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/MonkeyFinder.csproj
index 2721a537..bd0fea27 100644
--- a/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/MonkeyFinder.csproj
+++ b/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,7 +45,7 @@
-
+
diff --git a/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs b/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 52afb8ea..3b087628 100644
--- a/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -10,7 +10,7 @@ public MonkeyDetailsViewModel(IMap map)
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
[RelayCommand]
async Task OpenMap()
@@ -26,7 +26,7 @@ async Task OpenMap()
catch (Exception ex)
{
Debug.WriteLine($"Unable to launch maps: {ex.Message}");
- await Shell.Current.DisplayAlert("Error, no Maps app!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error, no Maps app!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 605386ec..8b8a9adc 100644
--- a/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Community Modules/XAML/Part 1 - Fundamentals/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -29,7 +29,7 @@ async Task GoToDetails(Monkey monkey)
}
[ObservableProperty]
- bool isRefreshing;
+ public partial bool IsRefreshing { get; set; }
[RelayCommand]
async Task GetMonkeysAsync()
@@ -41,7 +41,7 @@ async Task GetMonkeysAsync()
{
if (connectivity.NetworkAccess != NetworkAccess.Internet)
{
- await Shell.Current.DisplayAlert("No connectivity!",
+ await Shell.Current.DisplayAlertAsync("No connectivity!",
$"Please check internet and try again.", "OK");
return;
}
@@ -59,7 +59,7 @@ await Shell.Current.DisplayAlert("No connectivity!",
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
@@ -93,14 +93,14 @@ async Task GetClosestMonkey()
new Location(m.Latitude, m.Longitude), DistanceUnits.Miles))
.FirstOrDefault();
- await Shell.Current.DisplayAlert("", first.Name + " " +
+ await Shell.Current.DisplayAlertAsync("", first.Name + " " +
first.Location, "OK");
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to query location: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/MonkeyFinder.csproj b/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/MonkeyFinder.csproj
index 69ff8423..a7571faf 100644
--- a/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/MonkeyFinder.csproj
+++ b/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,6 +45,6 @@
-
+
diff --git a/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs b/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 52afb8ea..3b087628 100644
--- a/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -10,7 +10,7 @@ public MonkeyDetailsViewModel(IMap map)
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
[RelayCommand]
async Task OpenMap()
@@ -26,7 +26,7 @@ async Task OpenMap()
catch (Exception ex)
{
Debug.WriteLine($"Unable to launch maps: {ex.Message}");
- await Shell.Current.DisplayAlert("Error, no Maps app!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error, no Maps app!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 605386ec..8b8a9adc 100644
--- a/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Community Modules/XAML/Part 2 - Responsibility/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -29,7 +29,7 @@ async Task GoToDetails(Monkey monkey)
}
[ObservableProperty]
- bool isRefreshing;
+ public partial bool IsRefreshing { get; set; }
[RelayCommand]
async Task GetMonkeysAsync()
@@ -41,7 +41,7 @@ async Task GetMonkeysAsync()
{
if (connectivity.NetworkAccess != NetworkAccess.Internet)
{
- await Shell.Current.DisplayAlert("No connectivity!",
+ await Shell.Current.DisplayAlertAsync("No connectivity!",
$"Please check internet and try again.", "OK");
return;
}
@@ -59,7 +59,7 @@ await Shell.Current.DisplayAlert("No connectivity!",
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
@@ -93,14 +93,14 @@ async Task GetClosestMonkey()
new Location(m.Latitude, m.Longitude), DistanceUnits.Miles))
.FirstOrDefault();
- await Shell.Current.DisplayAlert("", first.Name + " " +
+ await Shell.Current.DisplayAlertAsync("", first.Name + " " +
first.Location, "OK");
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to query location: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/MonkeyFinder.csproj b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/MonkeyFinder.csproj
index c90e1601..96f517ab 100644
--- a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/MonkeyFinder.csproj
+++ b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,7 +45,7 @@
-
+
diff --git a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/Resources/Styles/Styles.cs b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/Resources/Styles/Styles.cs
index f7c77a3b..0759725d 100644
--- a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/Resources/Styles/Styles.cs
+++ b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/Resources/Styles/Styles.cs
@@ -73,7 +73,7 @@ public ButtonOutline()
}
}
- public class CardView : Frame
+ public class CardView : Border
{
public CardView()
{
diff --git a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 52afb8ea..3b087628 100644
--- a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -10,7 +10,7 @@ public MonkeyDetailsViewModel(IMap map)
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
[RelayCommand]
async Task OpenMap()
@@ -26,7 +26,7 @@ async Task OpenMap()
catch (Exception ex)
{
Debug.WriteLine($"Unable to launch maps: {ex.Message}");
- await Shell.Current.DisplayAlert("Error, no Maps app!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error, no Maps app!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 605386ec..8b8a9adc 100644
--- a/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Community Modules/XAML/Part 3 - Magic Values/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -29,7 +29,7 @@ async Task GoToDetails(Monkey monkey)
}
[ObservableProperty]
- bool isRefreshing;
+ public partial bool IsRefreshing { get; set; }
[RelayCommand]
async Task GetMonkeysAsync()
@@ -41,7 +41,7 @@ async Task GetMonkeysAsync()
{
if (connectivity.NetworkAccess != NetworkAccess.Internet)
{
- await Shell.Current.DisplayAlert("No connectivity!",
+ await Shell.Current.DisplayAlertAsync("No connectivity!",
$"Please check internet and try again.", "OK");
return;
}
@@ -59,7 +59,7 @@ await Shell.Current.DisplayAlert("No connectivity!",
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
@@ -93,14 +93,14 @@ async Task GetClosestMonkey()
new Location(m.Latitude, m.Longitude), DistanceUnits.Miles))
.FirstOrDefault();
- await Shell.Current.DisplayAlert("", first.Name + " " +
+ await Shell.Current.DisplayAlertAsync("", first.Name + " " +
first.Location, "OK");
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to query location: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/MonkeyFinder.csproj b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/MonkeyFinder.csproj
index fd7c1b94..7de4899c 100644
--- a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/MonkeyFinder.csproj
+++ b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,7 +45,7 @@
-
+
diff --git a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/Resources/Styles/Styles.cs b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/Resources/Styles/Styles.cs
index 3ff1112e..99a69688 100644
--- a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/Resources/Styles/Styles.cs
+++ b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/Resources/Styles/Styles.cs
@@ -73,7 +73,7 @@ public StandardButton()
}
}
- public class CardView : Frame
+ public class CardView : Border
{
public CardView()
{
diff --git a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 52afb8ea..3b087628 100644
--- a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -10,7 +10,7 @@ public MonkeyDetailsViewModel(IMap map)
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
[RelayCommand]
async Task OpenMap()
@@ -26,7 +26,7 @@ async Task OpenMap()
catch (Exception ex)
{
Debug.WriteLine($"Unable to launch maps: {ex.Message}");
- await Shell.Current.DisplayAlert("Error, no Maps app!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error, no Maps app!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 605386ec..8b8a9adc 100644
--- a/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Community Modules/XAML/Part 4 - Naming/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -29,7 +29,7 @@ async Task GoToDetails(Monkey monkey)
}
[ObservableProperty]
- bool isRefreshing;
+ public partial bool IsRefreshing { get; set; }
[RelayCommand]
async Task GetMonkeysAsync()
@@ -41,7 +41,7 @@ async Task GetMonkeysAsync()
{
if (connectivity.NetworkAccess != NetworkAccess.Internet)
{
- await Shell.Current.DisplayAlert("No connectivity!",
+ await Shell.Current.DisplayAlertAsync("No connectivity!",
$"Please check internet and try again.", "OK");
return;
}
@@ -59,7 +59,7 @@ await Shell.Current.DisplayAlert("No connectivity!",
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
@@ -93,14 +93,14 @@ async Task GetClosestMonkey()
new Location(m.Latitude, m.Longitude), DistanceUnits.Miles))
.FirstOrDefault();
- await Shell.Current.DisplayAlert("", first.Name + " " +
+ await Shell.Current.DisplayAlertAsync("", first.Name + " " +
first.Location, "OK");
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to query location: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/MonkeyFinder.csproj b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/MonkeyFinder.csproj
index e1dfa5d7..7808b821 100644
--- a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/MonkeyFinder.csproj
+++ b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -26,7 +27,7 @@
-
+
diff --git a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/Resources/Styles/Styles.cs b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/Resources/Styles/Styles.cs
index 3ff1112e..99a69688 100644
--- a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/Resources/Styles/Styles.cs
+++ b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/Resources/Styles/Styles.cs
@@ -73,7 +73,7 @@ public StandardButton()
}
}
- public class CardView : Frame
+ public class CardView : Border
{
public CardView()
{
diff --git a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 52afb8ea..3b087628 100644
--- a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -10,7 +10,7 @@ public MonkeyDetailsViewModel(IMap map)
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
[RelayCommand]
async Task OpenMap()
@@ -26,7 +26,7 @@ async Task OpenMap()
catch (Exception ex)
{
Debug.WriteLine($"Unable to launch maps: {ex.Message}");
- await Shell.Current.DisplayAlert("Error, no Maps app!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error, no Maps app!", ex.Message, "OK");
}
}
}
diff --git a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 605386ec..8b8a9adc 100644
--- a/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Community Modules/XAML/Part 5 - Custom Types/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -29,7 +29,7 @@ async Task GoToDetails(Monkey monkey)
}
[ObservableProperty]
- bool isRefreshing;
+ public partial bool IsRefreshing { get; set; }
[RelayCommand]
async Task GetMonkeysAsync()
@@ -41,7 +41,7 @@ async Task GetMonkeysAsync()
{
if (connectivity.NetworkAccess != NetworkAccess.Internet)
{
- await Shell.Current.DisplayAlert("No connectivity!",
+ await Shell.Current.DisplayAlertAsync("No connectivity!",
$"Please check internet and try again.", "OK");
return;
}
@@ -59,7 +59,7 @@ await Shell.Current.DisplayAlert("No connectivity!",
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
@@ -93,14 +93,14 @@ async Task GetClosestMonkey()
new Location(m.Latitude, m.Longitude), DistanceUnits.Miles))
.FirstOrDefault();
- await Shell.Current.DisplayAlert("", first.Name + " " +
+ await Shell.Current.DisplayAlertAsync("", first.Name + " " +
first.Location, "OK");
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to query location: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
}
}
diff --git a/Directory.Build.props b/Directory.Build.props
index fa82de7e..4258b68a 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,8 +1,8 @@
- 15.0
- 15.0
- 21.0
+ 15.0
+ 15.0
+ 21.0
10.0.17763.0
10.0.17763.0
6.5
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 39deecbb..0d3ced34 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -1,7 +1,7 @@
-
-
+
+
@@ -11,7 +11,7 @@
-
+
MonkeyFinder
@@ -43,6 +44,6 @@
-
+
diff --git a/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs b/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Finish/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 52afb8ea..3b087628 100644
--- a/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Finish/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -10,7 +10,7 @@ public MonkeyDetailsViewModel(IMap map)
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
[RelayCommand]
async Task OpenMap()
@@ -26,7 +26,7 @@ async Task OpenMap()
catch (Exception ex)
{
Debug.WriteLine($"Unable to launch maps: {ex.Message}");
- await Shell.Current.DisplayAlert("Error, no Maps app!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error, no Maps app!", ex.Message, "OK");
}
}
}
diff --git a/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 605386ec..8b8a9adc 100644
--- a/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Finish/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -29,7 +29,7 @@ async Task GoToDetails(Monkey monkey)
}
[ObservableProperty]
- bool isRefreshing;
+ public partial bool IsRefreshing { get; set; }
[RelayCommand]
async Task GetMonkeysAsync()
@@ -41,7 +41,7 @@ async Task GetMonkeysAsync()
{
if (connectivity.NetworkAccess != NetworkAccess.Internet)
{
- await Shell.Current.DisplayAlert("No connectivity!",
+ await Shell.Current.DisplayAlertAsync("No connectivity!",
$"Please check internet and try again.", "OK");
return;
}
@@ -59,7 +59,7 @@ await Shell.Current.DisplayAlert("No connectivity!",
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
@@ -93,14 +93,14 @@ async Task GetClosestMonkey()
new Location(m.Latitude, m.Longitude), DistanceUnits.Miles))
.FirstOrDefault();
- await Shell.Current.DisplayAlert("", first.Name + " " +
+ await Shell.Current.DisplayAlertAsync("", first.Name + " " +
first.Location, "OK");
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to query location: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
}
}
diff --git a/Part 1 - Displaying Data/MonkeyFinder/MonkeyFinder.csproj b/Part 1 - Displaying Data/MonkeyFinder/MonkeyFinder.csproj
index 29a721fc..ca6136de 100644
--- a/Part 1 - Displaying Data/MonkeyFinder/MonkeyFinder.csproj
+++ b/Part 1 - Displaying Data/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,6 +45,6 @@
-
+
diff --git a/Part 1 - Displaying Data/MonkeyFinder/ViewModel/BaseViewModel.cs b/Part 1 - Displaying Data/MonkeyFinder/ViewModel/BaseViewModel.cs
index 0205f46e..e7316cef 100644
--- a/Part 1 - Displaying Data/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Part 1 - Displaying Data/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -1,5 +1,13 @@
namespace MonkeyFinder.ViewModel;
-public class BaseViewModel
+public partial class BaseViewModel : ObservableObject
{
+ [ObservableProperty]
+ [NotifyPropertyChangedFor(nameof(IsNotBusy))]
+ public partial bool IsBusy { get; set; }
+
+ [ObservableProperty]
+ public partial string Title { get; set; }
+
+ public bool IsNotBusy => !IsBusy;
}
diff --git a/Part 2 - MVVM/MonkeyFinder/MonkeyFinder.csproj b/Part 2 - MVVM/MonkeyFinder/MonkeyFinder.csproj
index e052d9f5..4fc55286 100644
--- a/Part 2 - MVVM/MonkeyFinder/MonkeyFinder.csproj
+++ b/Part 2 - MVVM/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,6 +45,6 @@
-
+
diff --git a/Part 2 - MVVM/MonkeyFinder/ViewModel/BaseViewModel.cs b/Part 2 - MVVM/MonkeyFinder/ViewModel/BaseViewModel.cs
index 0205f46e..e7316cef 100644
--- a/Part 2 - MVVM/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Part 2 - MVVM/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -1,5 +1,13 @@
namespace MonkeyFinder.ViewModel;
-public class BaseViewModel
+public partial class BaseViewModel : ObservableObject
{
+ [ObservableProperty]
+ [NotifyPropertyChangedFor(nameof(IsNotBusy))]
+ public partial bool IsBusy { get; set; }
+
+ [ObservableProperty]
+ public partial string Title { get; set; }
+
+ public bool IsNotBusy => !IsBusy;
}
diff --git a/Part 2 - MVVM/README.md b/Part 2 - MVVM/README.md
index 68bc9403..e921b557 100644
--- a/Part 2 - MVVM/README.md
+++ b/Part 2 - MVVM/README.md
@@ -134,10 +134,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
@@ -145,24 +145,24 @@ public partial class BaseViewModel : ObservableObject
Here, we can see that our code has been greatly simplified with an `ObservableObject` base class that implements `INotifyPropertyChanged` and also attributes to expose our properties.
-Note that both isBusy and title have the `[ObservableProperty]` attribute attached to it. The code that is generated looks nearly identical to what we manually wrote. Additionally, the isBusy property has `[NotifyPropertyChangedFor(nameof(IsNotBusy))]`, which will also notify `IsNotBusy` when the value changes. To see the generated code head to the project and then expand **Dependencies -> net9.0-android -> Analyzers -> CommunityToolkit.Mvvm.SourceGenerators -> CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator** and open `MonkeyFinder.ViewModel.BaseViewModel.cs`:
+Note that both IsBusy and Title have the `[ObservableProperty]` attribute attached to them. With CommunityToolkit.Mvvm 8.4.0, we now use **partial properties** instead of fields. This provides better AOT (Ahead-of-Time) compilation support and is the recommended approach. The code generator will create the backing field and property implementation automatically. Additionally, the IsBusy property has `[NotifyPropertyChangedFor(nameof(IsNotBusy))]`, which will also notify `IsNotBusy` when the value changes. To see the generated code head to the project and then expand **Dependencies -> net10.0-android -> Analyzers -> CommunityToolkit.Mvvm.SourceGenerators -> CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator** and open `MonkeyFinder.ViewModel.BaseViewModel.cs`:
Here is what our `IsBusy` looks like:
```csharp
-[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "8.3.0.0")]
+[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "8.4.0.0")]
[global::System.Diagnostics.DebuggerNonUserCode]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public bool IsBusy
{
- get => isBusy;
+ get => field;
set
{
- if (!global::System.Collections.Generic.EqualityComparer.Default.Equals(isBusy, value))
+ if (!global::System.Collections.Generic.EqualityComparer.Default.Equals(field, value))
{
OnPropertyChanging(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangingArgs.IsBusy);
- isBusy = value;
+ field = value;
OnPropertyChanged(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangedArgs.IsBusy);
OnPropertyChanged(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangedArgs.IsNotBusy);
}
@@ -170,7 +170,7 @@ public bool IsBusy
}
```
-This code may look a bit scary, but since it is auto-generated it adds additional attributes to avoid conflicts. It is also highly optimized with caching as well.
+This code may look a bit scary, but since it is auto-generated it adds additional attributes to avoid conflicts. It is also highly optimized with caching as well. Note the use of the `field` keyword, which is a C# 14 feature that provides direct access to the compiler-generated backing field.
The same library will also help us handle click events aka `Commands` in the future.
diff --git a/Part 2 - MVVM/README.zh-cn.md b/Part 2 - MVVM/README.zh-cn.md
index 2a6386bf..c4902bd7 100644
--- a/Part 2 - MVVM/README.zh-cn.md
+++ b/Part 2 - MVVM/README.zh-cn.md
@@ -131,10 +131,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
@@ -142,23 +142,23 @@ public partial class BaseViewModel : ObservableObject
在这里,我们可以看到我们的代码已经大大简化成了一个 `ObservableObject` 基类,它实现了 `INotifyPropertyChanged` 以及绑定相关属性。
-请注意,isBusy 和 title 都附加了 `[ObservableProperty]` 属性。 生成的代码看起来几乎与我们手动编写的相同。 另外,isBusy 属性有 `[NotifyPropertyChangedFor(nameof(IsNotBusy))]`,当值改变时也会通知 `IsNotBusy`。 要查看生成的代码,请转到项目,然后展开 **Dependencies -> net9.0-android -> Analyzers -> CommunityToolkit.Mvvm.SourceGenerators -> CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator** 并打开`MonkeyFinder.ViewModel。 BaseViewModel.cs`:
+请注意,isBusy 和 title 都附加了 `[ObservableProperty]` 属性。 生成的代码看起来几乎与我们手动编写的相同。 另外,isBusy 属性有 `[NotifyPropertyChangedFor(nameof(IsNotBusy))]`,当值改变时也会通知 `IsNotBusy`。 要查看生成的代码,请转到项目,然后展开 **Dependencies -> net10.0-android -> Analyzers -> CommunityToolkit.Mvvm.SourceGenerators -> CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator** 并打开`MonkeyFinder.ViewModel。 BaseViewModel.cs`:
这是我们的 `IsBusy` 属性:
```csharp
-[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "8.3.0.0")]
+[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "8.4.0.0")]
[global::System.Diagnostics.DebuggerNonUserCode]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public bool IsBusy
{
- get => isBusy;
+ get => field;
set
{
- if (!global::System.Collections.Generic.EqualityComparer.Default.Equals(isBusy, value))
+ if (!global::System.Collections.Generic.EqualityComparer.Default.Equals(field, value))
{
OnPropertyChanging(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangingArgs.IsBusy);
- isBusy = value;
+ field = value;
OnPropertyChanged(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangedArgs.IsBusy);
OnPropertyChanged(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangedArgs.IsNotBusy);
}
diff --git a/Part 2 - MVVM/README.zh-tw.md b/Part 2 - MVVM/README.zh-tw.md
index e1937490..f74c66d0 100644
--- a/Part 2 - MVVM/README.zh-tw.md
+++ b/Part 2 - MVVM/README.zh-tw.md
@@ -131,10 +131,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
@@ -142,23 +142,23 @@ public partial class BaseViewModel : ObservableObject
在這邊,可以看到目前的程式碼已變成透過繼承 `ObservableObject` 類別為基底類別的設計,由於它已經完成實作 `INotifyPropertyChanged` 及其相關繫結屬性的設計,並提供了 AOP 的模式供以掛載到在 `BaseViewModel` 中所設計的欄位。
-所以可以注意到 isBusy 和 title 欄位都附掛了 `[ObservableProperty]` 的設計。所編譯後的程式碼看起來幾乎和先前設計撰寫的程式碼相同。另外,isBusy 欄位有額外掛上 `[NotifyPropertyChangedFor(nameof(IsNotBusy))]`,當欄位值有改變時也會通知 `IsNotBusy` 屬性。要查看編譯後的程式碼,請到透過方案總管的專案當中,並展開 **Dependencies -> net9.0-android -> Analyzers -> CommunityToolkit.Mvvm.SourceGenerators -> CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator** 並開啟 `MonkeyFinder.ViewModel. BaseViewModel.cs`:
+所以可以注意到 isBusy 和 title 欄位都附掛了 `[ObservableProperty]` 的設計。所編譯後的程式碼看起來幾乎和先前設計撰寫的程式碼相同。另外,isBusy 欄位有額外掛上 `[NotifyPropertyChangedFor(nameof(IsNotBusy))]`,當欄位值有改變時也會通知 `IsNotBusy` 屬性。要查看編譯後的程式碼,請到透過方案總管的專案當中,並展開 **Dependencies -> net10.0-android -> Analyzers -> CommunityToolkit.Mvvm.SourceGenerators -> CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator** 並開啟 `MonkeyFinder.ViewModel. BaseViewModel.cs`:
以下是在編譯時期自動產生的 `IsBusy` 屬性:
```csharp
-[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "8.3.0.0")]
+[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "8.4.0.0")]
[global::System.Diagnostics.DebuggerNonUserCode]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public bool IsBusy
{
- get => isBusy;
+ get => field;
set
{
- if (!global::System.Collections.Generic.EqualityComparer.Default.Equals(isBusy, value))
+ if (!global::System.Collections.Generic.EqualityComparer.Default.Equals(field, value))
{
OnPropertyChanging(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangingArgs.IsBusy);
- isBusy = value;
+ field = value;
OnPropertyChanged(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangedArgs.IsBusy);
OnPropertyChanged(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangedArgs.IsNotBusy);
}
diff --git a/Part 3 - Navigation/MonkeyFinder/MonkeyFinder.csproj b/Part 3 - Navigation/MonkeyFinder/MonkeyFinder.csproj
index e052d9f5..4fc55286 100644
--- a/Part 3 - Navigation/MonkeyFinder/MonkeyFinder.csproj
+++ b/Part 3 - Navigation/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,6 +45,6 @@
-
+
diff --git a/Part 3 - Navigation/MonkeyFinder/ViewModel/BaseViewModel.cs b/Part 3 - Navigation/MonkeyFinder/ViewModel/BaseViewModel.cs
index e78dc9a6..7f1a7aa3 100644
--- a/Part 3 - Navigation/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Part 3 - Navigation/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Part 3 - Navigation/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Part 3 - Navigation/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index c013157c..209c7335 100644
--- a/Part 3 - Navigation/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Part 3 - Navigation/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -33,7 +33,7 @@ async Task GetMonkeysAsync()
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
diff --git a/Part 3 - Navigation/README.md b/Part 3 - Navigation/README.md
index e73f340d..c2700d4b 100644
--- a/Part 3 - Navigation/README.md
+++ b/Part 3 - Navigation/README.md
@@ -195,7 +195,7 @@ Now that we have our details page in place, we need to register it for routing.
```
-> Starting in .NET 9 you no longer need to register Pages with the dependency service for constructor injection to work. By default when we navigate to a new page it will be created an the `MonkeyDetailsViewModel` will be injected as well.
+> Starting in .NET 10 you no longer need to register Pages with the dependency service for constructor injection to work. By default when we navigate to a new page it will be created an the `MonkeyDetailsViewModel` will be injected as well.
1. Finally, we must inject the view model into our `DetailsPage`. Open the code behind for the page in `DetailsPage.xaml.cs` and change the constructor to the following:
diff --git a/Part 3 - Navigation/README.zh-cn.md b/Part 3 - Navigation/README.zh-cn.md
index de0d21fc..a00b8deb 100644
--- a/Part 3 - Navigation/README.zh-cn.md
+++ b/Part 3 - Navigation/README.zh-cn.md
@@ -189,7 +189,7 @@ public partial class DetailsPage : ContentPage
```
-> Starting in .NET 9 you no longer need to register Pages with the dependency service for constructor injection to work. By default when we navigate to a new page it will be created an the `MonkeyDetailsViewModel` will be injected as well.
+> Starting in .NET 10 you no longer need to register Pages with the dependency service for constructor injection to work. By default when we navigate to a new page it will be created an the `MonkeyDetailsViewModel` will be injected as well.
3. 最后,我们必须将视图模型注入到我们的 `DetailsPage` 中。 在 `DetailsPage.xaml.cs` 中打开页面背后的代码,并将构造函数更改为以下内容:
diff --git a/Part 3 - Navigation/README.zh-tw.md b/Part 3 - Navigation/README.zh-tw.md
index a482d7d1..f9c8a850 100644
--- a/Part 3 - Navigation/README.zh-tw.md
+++ b/Part 3 - Navigation/README.zh-tw.md
@@ -188,7 +188,7 @@ public partial class DetailsPage : ContentPage
builder.Services.AddTransient();
```
-> Starting in .NET 9 you no longer need to register Pages with the dependency service for constructor injection to work. By default when we navigate to a new page it will be created an the `MonkeyDetailsViewModel` will be injected as well.
+> Starting in .NET 10 you no longer need to register Pages with the dependency service for constructor injection to work. By default when we navigate to a new page it will be created an the `MonkeyDetailsViewModel` will be injected as well.
3. 最後,開啟 `DetailsPage.xaml.cs` 這個 DetailPage.xaml 所對應的後置程式碼檔案,並將 DetailPage 的建構方法改為如下內容:
diff --git a/Part 4 - Platform Features/MonkeyFinder/MonkeyFinder.csproj b/Part 4 - Platform Features/MonkeyFinder/MonkeyFinder.csproj
index e052d9f5..4fc55286 100644
--- a/Part 4 - Platform Features/MonkeyFinder/MonkeyFinder.csproj
+++ b/Part 4 - Platform Features/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,6 +45,6 @@
-
+
diff --git a/Part 4 - Platform Features/MonkeyFinder/ViewModel/BaseViewModel.cs b/Part 4 - Platform Features/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Part 4 - Platform Features/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Part 4 - Platform Features/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Part 4 - Platform Features/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Part 4 - Platform Features/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 165eeab9..46065d10 100644
--- a/Part 4 - Platform Features/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Part 4 - Platform Features/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -8,5 +8,5 @@ public MonkeyDetailsViewModel()
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
}
diff --git a/Part 4 - Platform Features/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Part 4 - Platform Features/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 99620d41..ecdb75c2 100644
--- a/Part 4 - Platform Features/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Part 4 - Platform Features/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -45,7 +45,7 @@ async Task GetMonkeysAsync()
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
diff --git a/Part 5 - CollectionView/MonkeyFinder/MonkeyFinder.csproj b/Part 5 - CollectionView/MonkeyFinder/MonkeyFinder.csproj
index 312e7791..7ca3a15a 100644
--- a/Part 5 - CollectionView/MonkeyFinder/MonkeyFinder.csproj
+++ b/Part 5 - CollectionView/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -45,6 +46,6 @@
-
+
diff --git a/Part 5 - CollectionView/MonkeyFinder/ViewModel/BaseViewModel.cs b/Part 5 - CollectionView/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Part 5 - CollectionView/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Part 5 - CollectionView/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Part 5 - CollectionView/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Part 5 - CollectionView/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 52afb8ea..3b087628 100644
--- a/Part 5 - CollectionView/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Part 5 - CollectionView/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -10,7 +10,7 @@ public MonkeyDetailsViewModel(IMap map)
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
[RelayCommand]
async Task OpenMap()
@@ -26,7 +26,7 @@ async Task OpenMap()
catch (Exception ex)
{
Debug.WriteLine($"Unable to launch maps: {ex.Message}");
- await Shell.Current.DisplayAlert("Error, no Maps app!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error, no Maps app!", ex.Message, "OK");
}
}
}
diff --git a/Part 5 - CollectionView/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Part 5 - CollectionView/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 2ea3551b..cb1e32ca 100644
--- a/Part 5 - CollectionView/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Part 5 - CollectionView/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -38,7 +38,7 @@ async Task GetMonkeysAsync()
{
if (connectivity.NetworkAccess != NetworkAccess.Internet)
{
- await Shell.Current.DisplayAlert("No connectivity!",
+ await Shell.Current.DisplayAlertAsync("No connectivity!",
$"Please check internet and try again.", "OK");
return;
}
@@ -56,7 +56,7 @@ await Shell.Current.DisplayAlert("No connectivity!",
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
@@ -89,14 +89,14 @@ async Task GetClosestMonkey()
new Location(m.Latitude, m.Longitude), DistanceUnits.Miles))
.FirstOrDefault();
- await Shell.Current.DisplayAlert("", first.Name + " " +
+ await Shell.Current.DisplayAlertAsync("", first.Name + " " +
first.Location, "OK");
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to query location: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
}
}
diff --git a/Part 6 - AppThemes/MonkeyFinder/MonkeyFinder.csproj b/Part 6 - AppThemes/MonkeyFinder/MonkeyFinder.csproj
index e052d9f5..4fc55286 100644
--- a/Part 6 - AppThemes/MonkeyFinder/MonkeyFinder.csproj
+++ b/Part 6 - AppThemes/MonkeyFinder/MonkeyFinder.csproj
@@ -1,14 +1,15 @@
- net9.0-android
- $(TargetFrameworks);net9.0-ios;net9.0-maccatalyst
- $(TargetFrameworks);net9.0-windows10.0.19041
+ net10.0-android
+ $(TargetFrameworks);net10.0-ios;net10.0-maccatalyst
+ $(TargetFrameworks);net10.0-windows10.0.19041
Exe
MonkeyFinder
true
true
enable
+ preview
MonkeyFinder
@@ -44,6 +45,6 @@
-
+
diff --git a/Part 6 - AppThemes/MonkeyFinder/ViewModel/BaseViewModel.cs b/Part 6 - AppThemes/MonkeyFinder/ViewModel/BaseViewModel.cs
index 4d3c5ead..e7316cef 100644
--- a/Part 6 - AppThemes/MonkeyFinder/ViewModel/BaseViewModel.cs
+++ b/Part 6 - AppThemes/MonkeyFinder/ViewModel/BaseViewModel.cs
@@ -4,10 +4,10 @@ public partial class BaseViewModel : ObservableObject
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsNotBusy))]
- bool isBusy;
+ public partial bool IsBusy { get; set; }
[ObservableProperty]
- string title;
+ public partial string Title { get; set; }
public bool IsNotBusy => !IsBusy;
}
diff --git a/Part 6 - AppThemes/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs b/Part 6 - AppThemes/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
index 52afb8ea..3b087628 100644
--- a/Part 6 - AppThemes/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
+++ b/Part 6 - AppThemes/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
@@ -10,7 +10,7 @@ public MonkeyDetailsViewModel(IMap map)
}
[ObservableProperty]
- Monkey monkey;
+ public partial Monkey Monkey { get; set; }
[RelayCommand]
async Task OpenMap()
@@ -26,7 +26,7 @@ async Task OpenMap()
catch (Exception ex)
{
Debug.WriteLine($"Unable to launch maps: {ex.Message}");
- await Shell.Current.DisplayAlert("Error, no Maps app!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error, no Maps app!", ex.Message, "OK");
}
}
}
diff --git a/Part 6 - AppThemes/MonkeyFinder/ViewModel/MonkeysViewModel.cs b/Part 6 - AppThemes/MonkeyFinder/ViewModel/MonkeysViewModel.cs
index 9616df00..a41221f1 100644
--- a/Part 6 - AppThemes/MonkeyFinder/ViewModel/MonkeysViewModel.cs
+++ b/Part 6 - AppThemes/MonkeyFinder/ViewModel/MonkeysViewModel.cs
@@ -17,7 +17,7 @@ public MonkeysViewModel(MonkeyService monkeyService, IConnectivity connectivity,
}
[ObservableProperty]
- bool isRefreshing;
+ public partial bool IsRefreshing { get; set; }
[RelayCommand]
async Task GetMonkeysAsync()
@@ -29,7 +29,7 @@ async Task GetMonkeysAsync()
{
if (connectivity.NetworkAccess != NetworkAccess.Internet)
{
- await Shell.Current.DisplayAlert("No connectivity!",
+ await Shell.Current.DisplayAlertAsync("No connectivity!",
$"Please check internet and try again.", "OK");
return;
}
@@ -47,7 +47,7 @@ await Shell.Current.DisplayAlert("No connectivity!",
catch (Exception ex)
{
Debug.WriteLine($"Unable to get monkeys: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
finally
{
@@ -93,14 +93,14 @@ async Task GetClosestMonkey()
new Location(m.Latitude, m.Longitude), DistanceUnits.Miles))
.FirstOrDefault();
- await Shell.Current.DisplayAlert("", first.Name + " " +
+ await Shell.Current.DisplayAlertAsync("", first.Name + " " +
first.Location, "OK");
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to query location: {ex.Message}");
- await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
+ await Shell.Current.DisplayAlertAsync("Error!", ex.Message, "OK");
}
}
}
diff --git a/README.md b/README.md
index b58803f3..ab4516a9 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ This workshop is available in the following languages:
* [Chinese (Traditional)](README.zh-tw.md) - README filed ending with .zh-tw.md (Translated by [James Tsai](https://github.com/JamestsaiTW))
## Setup Guide
-Hey there! This workshop will be a hands on and a bring your own device workshop. You can develop on PC, Mac, or Linux and all you will need to do is install Visual Studio 2022 with the .NET MAUI Workshop or Visual Studio Code with the .NET MAUI extension. It is built on .NET 9, which means you will need version 17.12 of Visual Studio 2022 or newer. See [full installation guide for .NET MAUI](https://learn.microsoft.com/dotnet/maui/get-started/installation?view=net-maui-9.0) for more information.
+Hey there! This workshop will be a hands on and a bring your own device workshop. You can develop on PC, Mac, or Linux and all you will need to do is install Visual Studio 2026 or Visual Studio Code with the C# Dev Kit extension. It is built on .NET 10. See [full installation guide for .NET MAUI](https://learn.microsoft.com/dotnet/maui/get-started/installation?view=net-maui-10.0) for more information.
Before starting the workshop, I recommend going through the quick 10 minute [.NET MAUI Tutorial](https://docs.microsoft.com/dotnet/maui/get-started/first-app?WT.mc_id=friends-mauiworkshop-jamont) that will guide you through installation and also ensuring everything is configured correct.