diff --git a/Lottery/App.xaml.cs b/Lottery/App.xaml.cs
index f6f3235..a54a681 100644
--- a/Lottery/App.xaml.cs
+++ b/Lottery/App.xaml.cs
@@ -5,13 +5,11 @@
public App()
{
InitializeComponent();
-
- MainPage = new AppShell();
}
protected override Window CreateWindow(IActivationState? activationState)
{
- var window = base.CreateWindow(activationState);
+ var window = new Window(new AppShell());
const int newWidth = 600;
const int newHeight = 750;
@@ -19,7 +17,6 @@
window.Width = newWidth;
window.Height = newHeight;
- // Optional: Set minimum size to prevent window from being too small
window.MinimumWidth = 400;
window.MinimumHeight = 600;
diff --git a/Lottery/Lottery.cs b/Lottery/Lottery.cs
index 6721639..d2cca7d 100644
--- a/Lottery/Lottery.cs
+++ b/Lottery/Lottery.cs
@@ -72,4 +72,15 @@
protected override Sample SpecialSample { get; } = new(Lower: 1, Upper: 14, Count: 1);
protected override string SpecialIdentifier => "Thunderball";
}
+
+ ///
+ /// Concrete class for PowerballLottery lottery.
+ /// Generates five balls from 1 to 69 and one powerball from 1 to 26.
+ ///
+ internal class PowerballLottery : LotteryWithSpecial
+ {
+ protected override Sample Sample { get; } = new(Lower: 1, Upper: 69, Count: 5);
+ protected override Sample SpecialSample { get; } = new(Lower: 1, Upper: 26, Count: 1);
+ protected override string SpecialIdentifier => "Powerball";
+ }
}
diff --git a/Lottery/Lottery.csproj b/Lottery/Lottery.csproj
index dea6831..39accb5 100644
--- a/Lottery/Lottery.csproj
+++ b/Lottery/Lottery.csproj
@@ -1,8 +1,8 @@
- net8.0-android;net8.0-ios;net8.0-maccatalyst
- $(TargetFrameworks);net8.0-windows10.0.19041.0
+ net9.0-android;net9.0-ios;net8.0-maccatalyst
+ $(TargetFrameworks);net9.0-windows10.0.19041.0
diff --git a/Lottery/MainPage.xaml.cs b/Lottery/MainPage.xaml.cs
index ba7e13f..f6a627f 100644
--- a/Lottery/MainPage.xaml.cs
+++ b/Lottery/MainPage.xaml.cs
@@ -6,7 +6,8 @@
new LottoLottery(),
new EuroMillionsLottery(),
new SetForLifeLottery(),
- new ThunderballLottery()
+ new ThunderballLottery(),
+ new PowerballLottery()
];
const KindOfLottery DefaultLottery = KindOfLottery.Lotto;
Lottery Lottery;
@@ -15,7 +16,7 @@
{
InitializeComponent();
- List lottos = ["Lotto", "EuroMillions", "Set For Life", "Thunderball"];
+ List lottos = ["Lotto", "EuroMillions", "Set For Life", "Thunderball", "Powerball"];
LotteryPicker.ItemsSource = lottos;
LotteryPicker.SelectedIndex = (int)DefaultLottery;