Person inmatning ändrad

This commit is contained in:
2025-09-26 10:07:59 +02:00
parent e9a8678244
commit f2403d5cf3
5 changed files with 146 additions and 97 deletions

View File

@ -4,6 +4,26 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Style TargetType="StackLayout" x:Key="ResponsiveStackStyle">
<Setter Property="Orientation" Value="Horizontal"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="WidthStates">
<VisualState x:Name="Wide">
<VisualState.Setters>
<Setter TargetName="ResponsiveStack" Property="StackLayout.Orientation" Value="Horizontal" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Narrow">
<VisualState.Setters>
<Setter TargetName="ResponsiveStack" Property="StackLayout.Orientation" Value="Vertical" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style x:Key="StatusLabelStyle" TargetType="Label" > <Style x:Key="StatusLabelStyle" TargetType="Label" >
<Style.Triggers> <Style.Triggers>
<DataTrigger TargetType="Label" Binding="{Binding Status}" Value="New"> <DataTrigger TargetType="Label" Binding="{Binding Status}" Value="New">

View File

@ -21,37 +21,42 @@
ViewTitle="Deltagare" ViewTitle="Deltagare"
ViewDescription="Lägg till deltagare här" /> ViewDescription="Lägg till deltagare här" />
<Border Stroke="Gold" StrokeThickness="2" BackgroundColor="LemonChiffon" Grid.Row="1"> <Border Stroke="Gold" StrokeThickness="2" BackgroundColor="LemonChiffon" Grid.Row="1">
<StackLayout Spacing="4" > <VerticalStackLayout Spacing="4" >
<FlexLayout Wrap="Wrap" >
<Label Style="{StaticResource Label}" <Label Style="{StaticResource Label}"
Text="Deltagare Förnamn:" Text="Deltagare "
FontAttributes="Bold" FontSize="Large"/>
<Grid ColumnDefinitions="Auto,Auto,*" RowDefinitions="Auto,auto,auto,auto"
Padding="10" RowSpacing="8">
<Label Grid.Row="0" Grid.Column="0" Style="{StaticResource Label}"
Text="Förnamn:"
FontAttributes="Bold"/> FontAttributes="Bold"/>
<Entry <Entry Grid.Row="0" Grid.Column="1"
x:Name="ParticipantFirstNameEntry" x:Name="ParticipantFirstNameEntry"
Placeholder="Förnamn" Placeholder="Förnamn"
Text="{Binding ParticipantObject.FirstName}" /> FontSize="15"
Text="{Binding ParticipantObject.FirstName}" TextColor="Black"/>
<Label Style="{StaticResource Label}" <Label Grid.Row="1" Grid.Column="0" Style="{StaticResource Label}"
Text="Deltagare Efternamn:" Text="Efternamn:"
FontAttributes="Bold"/> FontAttributes="Bold"/>
<Entry <Entry Grid.Row="1" Grid.Column="1"
x:Name="ParticipantLastNameEntry" x:Name="ParticipantLastNameEntry"
Placeholder="Efternamn" Placeholder="Efternamn"
Text="{Binding ParticipantObject.LastName}" /> FontSize="15"
Text="{Binding ParticipantObject.LastName}" TextColor="Black"/>
<Label Style="{StaticResource Label}" <Label Grid.Row="2" Grid.Column="0" Style="{StaticResource Label}"
Text="Deltagare Email:" Text="Email"
FontAttributes="Bold"/> FontAttributes="Bold"/>
<Entry <Entry Grid.Row="2" Grid.Column="1"
x:Name="ParticipantEmailEntry" x:Name="ParticipantEmailEntry"
Placeholder="Mail adress" Placeholder="Mail adress"
Text="{Binding ParticipantObject.Email}" /> FontSize="15"
<Button Style="{StaticResource HoverButtonBlueStyle}" Text="{Binding ParticipantObject.Email}" TextColor="Black"/>
<Button Grid.Row="3" Grid.Column="1" Style="{StaticResource HoverButtonBlueStyle}"
Text="Lägg till" Text="Lägg till"
HorizontalOptions="End" HorizontalOptions="End"
Command="{Binding SaveCommand}" /> Command="{Binding SaveCommand}" />
</FlexLayout> </Grid>
</StackLayout> </VerticalStackLayout>
</Border> </Border>
<Border Grid.Row="2" Stroke="Gold" BackgroundColor="Ivory" StrokeThickness="2" Padding="5"> <Border Grid.Row="2" Stroke="Gold" BackgroundColor="Ivory" StrokeThickness="2" Padding="5">
<CollectionView <CollectionView

View File

@ -87,7 +87,7 @@
Command="{Binding StoreAndHandlePointsCommand}"/> Command="{Binding StoreAndHandlePointsCommand}"/>
</HorizontalStackLayout> </HorizontalStackLayout>
</Border> </Border>
<ScrollView Grid.Row="4"> <ScrollView Grid.Row="4" Orientation="Horizontal">
<Grid <Grid
x:Name="ScoreGrid" x:Name="ScoreGrid"
ColumnSpacing="5" ColumnSpacing="5"

View File

@ -9,6 +9,9 @@
x:DataType="vm:RoundStartingViewModelCommands" x:DataType="vm:RoundStartingViewModelCommands"
x:Name="GameRoundStartingPage" x:Name="GameRoundStartingPage"
Title="Starta ny Runda"> Title="Starta ny Runda">
<Border Style="{StaticResource Border.Page}" StrokeThickness="4"> <Border Style="{StaticResource Border.Page}" StrokeThickness="4">
<Grid Style="{StaticResource Grid.Page}"> <Grid Style="{StaticResource Grid.Page}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
@ -21,13 +24,14 @@
ViewTitle="Starta en Spelrunda" ViewTitle="Starta en Spelrunda"
ViewDescription="Välj deltagare och initiera spel" /> ViewDescription="Välj deltagare och initiera spel" />
<Border Grid.Row="1" Stroke="Gold" StrokeThickness="2" BackgroundColor="LemonChiffon" > <Border Grid.Row="1" Stroke="Gold" StrokeThickness="2" BackgroundColor="LemonChiffon" >
<HorizontalStackLayout> <ScrollView Orientation="Horizontal">
<StackLayout x:Name="ResponsiveStack" Spacing="5" Style="{StaticResource ResponsiveStackStyle}" >
<Border Stroke="Gray" <Border Stroke="Gray"
StrokeThickness="2" StrokeThickness="2"
BackgroundColor="LightGray" BackgroundColor="LightGray"
Padding="10" Padding="10"
Margin="2" Margin="2"
HorizontalOptions="Center" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
WidthRequest="250"> WidthRequest="250">
<Picker ItemsSource="{Binding ParticipantList}" <Picker ItemsSource="{Binding ParticipantList}"
@ -36,7 +40,10 @@
TextColor="Black" TextColor="Black"
Title="Välj deltagare"/> Title="Välj deltagare"/>
</Border> </Border>
<Border Stroke="Gold" StrokeThickness="2" BackgroundColor="LightCyan" > <Border Stroke="Gold"
StrokeThickness="2"
BackgroundColor="LightCyan" >
<!--WidthRequest="100">-->
<CollectionView <CollectionView
ItemsSource="{Binding RoundElements}" ItemsSource="{Binding RoundElements}"
ItemsLayout="HorizontalList" ItemsLayout="HorizontalList"
@ -73,7 +80,7 @@
</CollectionView> </CollectionView>
</Border> </Border>
<Border <Border
HorizontalOptions="End" HorizontalOptions="Start"
Padding="2" Padding="2"
Margin="5" Margin="5"
WidthRequest="150" WidthRequest="150"
@ -92,9 +99,11 @@
Command="{Binding RensaCommand}" /> Command="{Binding RensaCommand}" />
</VerticalStackLayout> </VerticalStackLayout>
</Border> </Border>
</HorizontalStackLayout> </StackLayout>
</ScrollView>
</Border> </Border>
<Border Grid.Row="2" Stroke="Gold" BackgroundColor="Ivory" StrokeThickness="2" Padding="5"> <Border Grid.Row="2" Stroke="Gold" BackgroundColor="Ivory" StrokeThickness="2" Padding="5">
<ScrollView Orientation="Horizontal">
<CollectionView ItemsSource="{Binding GameRoundList}" x:Name="OuterList"> <CollectionView ItemsSource="{Binding GameRoundList}" x:Name="OuterList">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate x:DataType="model:RoundBuilderGroup"> <DataTemplate x:DataType="model:RoundBuilderGroup">
@ -138,7 +147,7 @@
</CollectionView.ItemTemplate> </CollectionView.ItemTemplate>
</CollectionView> </CollectionView>
</ScrollView>
</Border> </Border>
</Grid> </Grid>
</Border> </Border>

View File

@ -23,6 +23,21 @@ public partial class RoundStartingView : ContentPage
ViewModel.GetParticipants(); ViewModel.GetParticipants();
} }
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
if (width < 500)
{
VisualStateManager.GoToState(ResponsiveStack, "Narrow");
System.Diagnostics.Debug.WriteLine($"width={width} ResponsiveStack=Narrow ");
}
else
{
VisualStateManager.GoToState(ResponsiveStack, "Wide");
System.Diagnostics.Debug.WriteLine($"width={width} ResponsiveStack=Wide ");
}
}
} }