Set a default app size

update the window title
This commit is contained in:
onyx-and-iris 2024-09-26 04:17:13 +01:00
parent a32b1a65a4
commit 7d1525804e
5 changed files with 20 additions and 4 deletions

View File

@ -8,5 +8,18 @@
MainPage = new AppShell(); MainPage = new AppShell();
} }
protected override Window CreateWindow(IActivationState? activationState)
{
var window = base.CreateWindow(activationState);
const int newWidth = 800;
const int newHeight = 300;
window.Width = newWidth;
window.Height = newHeight;
return window;
}
} }
} }

View File

@ -5,10 +5,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Lottery" xmlns:local="clr-namespace:Lottery"
Shell.FlyoutBehavior="Disabled" Shell.FlyoutBehavior="Disabled"
Title="Lottery"> Title="">
<ShellContent <ShellContent
Title="Home" Title="Lottery Number Picker"
ContentTemplate="{DataTemplate local:MainPage}" ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" /> Route="MainPage" />

View File

@ -36,6 +36,9 @@
} }
} }
/// <summary>
///
/// </summary>
class SetForLifeGenerator : IGenerator class SetForLifeGenerator : IGenerator
{ {
public int Count { get; } = 10; public int Count { get; } = 10;

View File

@ -9,7 +9,7 @@
Spacing="25"> Spacing="25">
<Picker x:Name="LottoPicker" Title="Kind of Lotto" SelectedIndexChanged="LottoPicker_SelectedIndexChanged" /> <Picker x:Name="LottoPicker" Title="Kind of Lotto" SelectedIndexChanged="LottoPicker_SelectedIndexChanged" />
<Label x:Name="Numbers" Text="Numbers:" /> <Label x:Name="Numbers" Text="Numbers: (Click Spin button to generate)" />
<Button x:Name="SpinButton" Text="Spin" Clicked="SpinButton_Clicked"/> <Button x:Name="SpinButton" Text="Spin" Clicked="SpinButton_Clicked"/>
</VerticalStackLayout> </VerticalStackLayout>

View File

@ -2,7 +2,7 @@
{ {
public partial class MainPage : ContentPage public partial class MainPage : ContentPage
{ {
List<IGenerator> generators = [new UKGenerator(), new EuroGenerator(), new SetForLifeGenerator()]; readonly List<IGenerator> generators = [new UKGenerator(), new EuroGenerator(), new SetForLifeGenerator()];
IGenerator generator; IGenerator generator;
const KindOfLotto DEFAULT_GENERATOR = KindOfLotto.Uk; const KindOfLotto DEFAULT_GENERATOR = KindOfLotto.Uk;