Team Registration view v1
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:TournamentOrganizer.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="TournamentOrganizer.Views.HomeView"
|
||||
x:DataType="vm:HomeViewModel">
|
||||
<Design.DataContext>
|
||||
<vm:HomeViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<TextBlock Text="{Binding WelcomeMessage}"
|
||||
FontSize="24"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace TournamentOrganizer.Views;
|
||||
|
||||
public partial class HomeView : UserControl
|
||||
{
|
||||
public HomeView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,25 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:TournamentOrganizer.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="TournamentOrganizer.Views.MainView"
|
||||
x:DataType="vm:MainViewModel">
|
||||
<Design.DataContext>
|
||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
||||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||
<vm:MainViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</UserControl>
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:TournamentOrganizer.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="600"
|
||||
x:Class="TournamentOrganizer.Views.MainView"
|
||||
x:DataType="vm:MainViewModel">
|
||||
<Design.DataContext>
|
||||
<vm:MainViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<DockPanel>
|
||||
<!-- Navigation Menu -->
|
||||
<Border DockPanel.Dock="Top" Background="#2D2D30" Padding="8">
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<Button Content="Home" Command="{Binding NavigateToHomeCommand}" Padding="16,8" FontSize="14" Foreground="White" Background="Transparent" BorderThickness="0"/>
|
||||
<Button Content="Teams" Command="{Binding NavigateToTeamsCommand}" Padding="16,8" FontSize="14" Foreground="White" Background="Transparent" BorderThickness="0"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Content Area -->
|
||||
<ContentControl Content="{Binding CurrentView}" Margin="0"/>
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:TournamentOrganizer.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="600"
|
||||
x:Class="TournamentOrganizer.Views.TeamsView"
|
||||
x:DataType="vm:TeamsViewModel">
|
||||
<Design.DataContext>
|
||||
<vm:TeamsViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<Grid RowDefinitions="Auto,*,Auto" ColumnDefinitions="*,*">
|
||||
<TextBlock Grid.ColumnSpan="2" Grid.Row="0" Text="Teams Management" FontSize="20" FontWeight="Bold" Margin="16,16,16,8"/>
|
||||
|
||||
<!-- Left Panel: Team List and Filters -->
|
||||
<Border Grid.Column="0" Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Margin="8" CornerRadius="4" Padding="8">
|
||||
<DockPanel>
|
||||
<TextBlock DockPanel.Dock="Top" Text="Teams" FontSize="16" FontWeight="SemiBold" Margin="0,0,0,8"/>
|
||||
|
||||
<!-- Filters -->
|
||||
<StackPanel DockPanel.Dock="Top" Spacing="6" Margin="0,0,0,8">
|
||||
<TextBlock Text="Filters" FontWeight="SemiBold" FontSize="12"/>
|
||||
<TextBox Watermark="Filter by member name..." Text="{Binding FilterMemberName}"/>
|
||||
<TextBox Watermark="Filter by event..." Text="{Binding FilterEventName}"/>
|
||||
<TextBox Watermark="Filter by tournament..." Text="{Binding FilterTournamentName}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Team List -->
|
||||
<ListBox ItemsSource="{Binding Teams}"
|
||||
SelectedItem="{Binding SelectedTeam}"
|
||||
Margin="0,0,0,8">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:TeamDisplay">
|
||||
<StackPanel Spacing="2">
|
||||
<TextBlock Text="{Binding Name}" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding LeaderName, StringFormat='Leader: {0}'}" FontSize="11" Foreground="Gray"/>
|
||||
<TextBlock Text="{Binding Players.Count, StringFormat='{}{0} members'}" FontSize="11" Foreground="Gray"/>
|
||||
<ItemsControl ItemsSource="{Binding AssociatedEvents}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="x:String">
|
||||
<TextBlock Text="{Binding, StringFormat='Event: {0}'}" FontSize="10" Foreground="#1976D2"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ItemsControl ItemsSource="{Binding AssociatedTournaments}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="x:String">
|
||||
<TextBlock Text="{Binding, StringFormat='Tournament: {0}'}" FontSize="10" Foreground="#F57C00"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Button DockPanel.Dock="Bottom" Content="New Team" Command="{Binding CreateNewTeamCommand}" HorizontalAlignment="Stretch"/>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Right Panel: Team Editor -->
|
||||
<Border Grid.Column="1" Grid.Row="1" BorderBrush="Gray" BorderThickness="1" Margin="8" CornerRadius="4" Padding="8">
|
||||
<DockPanel>
|
||||
<TextBlock DockPanel.Dock="Top" Text="Team Details" FontSize="16" FontWeight="SemiBold" Margin="0,0,0,8"/>
|
||||
|
||||
<StackPanel DockPanel.Dock="Bottom" Spacing="6" Margin="0,8,0,0">
|
||||
<Button Content="Save Team" Command="{Binding SaveTeamCommand}" HorizontalAlignment="Stretch" IsEnabled="{Binding IsEditing}"/>
|
||||
<Button Content="Delete Team" Command="{Binding DeleteTeamCommand}" HorizontalAlignment="Stretch" IsEnabled="{Binding IsEditing}"/>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel Spacing="8" IsEnabled="{Binding IsEditing}">
|
||||
<!-- Team Name -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Team Name" FontWeight="SemiBold"/>
|
||||
<TextBox Text="{Binding TeamName}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Members Section -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Members" FontWeight="SemiBold"/>
|
||||
|
||||
<!-- Add Player Form -->
|
||||
<Grid ColumnDefinitions="*,*,Auto" RowDefinitions="Auto,Auto" RowSpacing="4" ColumnSpacing="4">
|
||||
<TextBox Grid.Row="0" Grid.Column="0" Watermark="Player name" Text="{Binding NewPlayerName}"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Watermark="Contact (optional)" Text="{Binding NewPlayerContact}"/>
|
||||
<Button Grid.Row="0" Grid.Column="2" Content="Add" Command="{Binding AddPlayerCommand}" VerticalAlignment="Center"/>
|
||||
|
||||
<Button Grid.Row="1" Grid.Column="0" Content="Remove" Command="{Binding RemovePlayerCommand}"/>
|
||||
<Button Grid.Row="1" Grid.Column="1" Content="Set as Leader" Command="{Binding SetLeaderCommand}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Players List -->
|
||||
<ListBox ItemsSource="{Binding Players}"
|
||||
SelectedItem="{Binding SelectedPlayer}"
|
||||
MinHeight="150"
|
||||
MaxHeight="250">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:PlayerEntry">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<TextBlock Text="{Binding Name}" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding Contact}" Foreground="Gray" FontSize="11"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Current Leader Display -->
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Current Leader" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding SelectedLeader.Name}" IsVisible="{Binding SelectedLeader, Converter={x:Static ObjectConverters.IsNotNull}}"/>
|
||||
<TextBlock Text="No leader set" IsVisible="{Binding SelectedLeader, Converter={x:Static ObjectConverters.IsNull}}" Foreground="Gray"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Status Bar -->
|
||||
<TextBlock Grid.ColumnSpan="2" Grid.Row="2" Text="{Binding StatusMessage}" Margin="8" Foreground="Gray" FontSize="12"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace TournamentOrganizer.Views;
|
||||
|
||||
public partial class TeamsView : UserControl
|
||||
{
|
||||
public TeamsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user