From 72e7728e8fcfb53d42995ece9d9f8240c067f32f Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 26 Feb 2026 00:03:07 +0000 Subject: [PATCH] rename UKLotto to Lotto to match the national-lottery website update the launch size of the app window to match the new layout. --- Lottery/App.xaml.cs | 6 +++++- Lottery/AppShell.xaml | 2 +- Lottery/Generator.cs | 2 +- Lottery/KindOfLottery.cs | 2 +- Lottery/Lottery.cs | 4 ++-- Lottery/MainPage.xaml.cs | 6 +++--- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Lottery/App.xaml.cs b/Lottery/App.xaml.cs index 696618c..f6f3235 100644 --- a/Lottery/App.xaml.cs +++ b/Lottery/App.xaml.cs @@ -14,11 +14,15 @@ var window = base.CreateWindow(activationState); const int newWidth = 600; - const int newHeight = 300; + const int newHeight = 750; window.Width = newWidth; window.Height = newHeight; + // Optional: Set minimum size to prevent window from being too small + window.MinimumWidth = 400; + window.MinimumHeight = 600; + return window; } } diff --git a/Lottery/AppShell.xaml b/Lottery/AppShell.xaml index a1c7318..e277700 100644 --- a/Lottery/AppShell.xaml +++ b/Lottery/AppShell.xaml @@ -5,7 +5,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:Lottery" Shell.FlyoutBehavior="Disabled" - Title="Lottery Number Generator"> + Title=""> Numbers are returned as a sorted set. public static SortedSet Generate(Limits limits) { - List candidates = Enumerable.Range(limits.Lower, limits.Upper).ToList(); + List candidates = [.. Enumerable.Range(limits.Lower, limits.Upper)]; SortedSet numbers = []; for (int i = 0; i < limits.Count; i++) diff --git a/Lottery/KindOfLottery.cs b/Lottery/KindOfLottery.cs index e0e8ac5..f2cd386 100644 --- a/Lottery/KindOfLottery.cs +++ b/Lottery/KindOfLottery.cs @@ -5,7 +5,7 @@ /// enum KindOfLottery : int { - Uk, + Lotto, Euro, SetForLife, Thunderball, diff --git a/Lottery/Lottery.cs b/Lottery/Lottery.cs index 15f7c0b..e61ad26 100644 --- a/Lottery/Lottery.cs +++ b/Lottery/Lottery.cs @@ -13,10 +13,10 @@ } /// - /// Concrete UKLotto Lottery class. + /// Concrete Lotto Lottery class. /// Generates six balls from 1 to 59. /// - internal class UKLottoLottery : Lottery + internal class LottoLottery : Lottery { protected override Limits Limits { get; } = new(Count: 6, Lower: 1, Upper: 59); } diff --git a/Lottery/MainPage.xaml.cs b/Lottery/MainPage.xaml.cs index e619e51..ba7e13f 100644 --- a/Lottery/MainPage.xaml.cs +++ b/Lottery/MainPage.xaml.cs @@ -3,19 +3,19 @@ public partial class MainPage : ContentPage { readonly List Lotteries = [ - new UKLottoLottery(), + new LottoLottery(), new EuroMillionsLottery(), new SetForLifeLottery(), new ThunderballLottery() ]; - const KindOfLottery DefaultLottery = KindOfLottery.Uk; + const KindOfLottery DefaultLottery = KindOfLottery.Lotto; Lottery Lottery; public MainPage() { InitializeComponent(); - List lottos = ["UK Lotto", "EuroMillions", "Set For Life", "Thunderball"]; + List lottos = ["Lotto", "EuroMillions", "Set For Life", "Thunderball"]; LotteryPicker.ItemsSource = lottos; LotteryPicker.SelectedIndex = (int)DefaultLottery;