Display AddModal

This commit is contained in:
Natlinux81
2022-08-13 23:07:43 +02:00
parent 2de986f5b8
commit 311cd83b70
10 changed files with 172 additions and 81 deletions

View File

@@ -3,7 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Apollon.WPF" xmlns:views="clr-namespace:Apollon.WPF.Views" xmlns:local="clr-namespace:Apollon.WPF"
xmlns:views="clr-namespace:Apollon.WPF.Views"
xmlns:vms="clr-namespace:Apollon.WPF.ViewModels"
xmlns:custom="clr-namespace:ModalControl;assembly=ModalControl"
mc:Ignorable="d" mc:Ignorable="d"
Title="Apollon Auswertung Bogen" Title="Apollon Auswertung Bogen"
Height="680" Height="680"
@@ -13,6 +16,11 @@
AllowsTransparency="True" AllowsTransparency="True"
WindowStyle="None" WindowStyle="None"
ResizeMode="CanResizeWithGrip"> ResizeMode="CanResizeWithGrip">
<Window.Resources>
<DataTemplate DataType="{x:Type vms:AddTournametViewModel}">
<views:AddTournamentView/>
</DataTemplate>
</Window.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Auto" <ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"> VerticalScrollBarVisibility="Auto">
<Grid> <Grid>
@@ -21,6 +29,11 @@
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<custom:Modal Grid.RowSpan="2" Panel.ZIndex="1" IsOpen="{Binding IsModalOpen}">
<ContentControl Margin="100 50 100 50" Content="{Binding CurrentModalViewModel}"/>
</custom:Modal>
<views:OverviewView Grid.RowSpan="2" <views:OverviewView Grid.RowSpan="2"
DataContext="{Binding OverviewViewModel}" DataContext="{Binding OverviewViewModel}"
MouseDown="Window_MouseDown"/> MouseDown="Window_MouseDown"/>

View File

@@ -4,7 +4,8 @@
x:Key="ModalTextBlock"> x:Key="ModalTextBlock">
<Setter Property="FontFamily" Value="Arial"/> <Setter Property="FontFamily" Value="Arial"/>
<Setter Property="FontWeight" Value="Bold"/> <Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="14"/> <Setter Property="FontSize" Value="18"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground" Value="#0000a0"/> <Setter Property="Foreground" Value="#0000a0"/>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -21,6 +21,8 @@ namespace Apollon.WPF.ViewModels
OverviewViewModel = overviewViewModel; OverviewViewModel = overviewViewModel;
_modalNavigationStore.CurrentViewModelChanged += ModalNavigationStore_CurrentViewModelChanged; _modalNavigationStore.CurrentViewModelChanged += ModalNavigationStore_CurrentViewModelChanged;
//_modalNavigationStore.CurrentViewModel = new AddTournametViewModel();
} }
protected override void Dispose() protected override void Dispose()

View File

@@ -3,17 +3,16 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Apollon.WPF.Views" xmlns:components="clr-namespace:Apollon.WPF.Views.Components" xmlns:local="clr-namespace:Apollon.WPF.Views"
mc:Ignorable="d" xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
d:DesignHeight="450" d:DesignWidth="800"> mc:Ignorable="d">
<Grid> <Grid>
<TextBlock Text="Erstellen eines Tourniers" <TextBlock Text="Turniers erstellen"
TextAlignment="Center" TextAlignment="Center"
FontFamily="Arial" FontFamily="Arial"
FontWeight="Bold" FontWeight="Bold"
FontSize="25" FontSize="25"
Foreground="#0000a0" Foreground="#0000a0"/>
Margin="10"/> <components:AddEditDetails Margin="0 50 0 0"/>
<components:AddEditDetails Margin="20 40"/>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -24,5 +24,6 @@ namespace Apollon.WPF.Views
{ {
InitializeComponent(); InitializeComponent();
} }
} }
} }

View File

@@ -4,85 +4,113 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Apollon.WPF.Views.Components" xmlns:local="clr-namespace:Apollon.WPF.Views.Components"
mc:Ignorable="d" mc:Ignorable="d">
d:DesignHeight="450" d:DesignWidth="800"> <Grid>
<Grid Height="450">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*" MaxWidth="250"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition Height="55"/>
<RowDefinition/> <RowDefinition Height="55"/>
<RowDefinition Height="55"/>
<RowDefinition Height="55"/>
<RowDefinition Height="55"/>
<RowDefinition Height="55"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Grid.Row="0"> <Grid.ColumnDefinitions>
<ColumnDefinition Width="180"/>
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Veranstalter: " <TextBlock Text="Veranstalter: "
Style="{StaticResource ModalTextBlock}" Style="{StaticResource ModalTextBlock}"/>
Margin="0 20 0 0"/> <TextBlock Grid.Row="1"
<TextBlock Text="Tourniername: " Text="Turniername: "
Style="{StaticResource ModalTextBlock}" Style="{StaticResource ModalTextBlock}"/>
Margin="0 20 0 0"/> <TextBlock Grid.Row="2"
<TextBlock Text="Kategorie: " Text="Kategorie: "
Style="{StaticResource ModalTextBlock}" Style="{StaticResource ModalTextBlock}"/>
Margin="0 20 0 0"/> <TextBlock Grid.Row="3"
<TextBlock Text="Startdatum: " Text="Startdatum: "
Style="{StaticResource ModalTextBlock}" Style="{StaticResource ModalTextBlock}"/>
Margin="0 20 0 0"/> <TextBlock Grid.Row="4"
<TextBlock Text="Enddatum: " Text="Enddatum: "
Style="{StaticResource ModalTextBlock}" Style="{StaticResource ModalTextBlock}"/>
Margin="0 20 0 0"/> <TextBlock Grid.Row="5"
<TextBlock Text="Veranstaltungsort: " Text="Veranstaltungsort: "
Style="{StaticResource ModalTextBlock}" Style="{StaticResource ModalTextBlock}"/>
Margin="0 20 0 0"/>
</StackPanel>
<StackPanel Grid.Column="1"> <TextBox Grid.Column="1"
<TextBox Text="{Binding Organisation}" Text="{Binding Organisation}"
FontFamily="Arial" FontFamily="Arial"
FontSize="14" FontSize="16"
Margin="0 15 0 0" Height="30"
Padding="2"/> Background="LightGray"
<TextBox Text="{Binding Tournamentname}" VerticalContentAlignment="Center"/>
TextAlignment="Center" <TextBox Grid.Row="1"
Grid.Column="1"
Text="{Binding Tournamentname}"
FontFamily="Arial" FontFamily="Arial"
FontSize="14" FontSize="16"
Margin="0 20 0 0" Height="30"
Padding="2" VerticalContentAlignment="Center"
/> Background="LightGray"/>
<ComboBox ItemsSource="{Binding Category}" <ComboBox Grid.Row="2"
Margin="0 20 0 15"/> Grid.Column="1"
ItemsSource="{Binding Category}"
Height="30"
FontSize="16"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
<DatePicker MaxWidth="150" <DatePicker Grid.Row="3"
HorizontalAlignment="Center"/> Grid.Column="1"
Height="30"
FontSize="16"
Width="160"
HorizontalAlignment="Left"/>
<DatePicker MaxWidth="150" <DatePicker Grid.Row="4"
HorizontalAlignment="Center"/> Grid.Column="1"
Height="30"
FontSize="16"
Width="160"
HorizontalAlignment="Left"/>
<TextBox Text="{Binding Location}" <TextBox Grid.Row="5"
TextAlignment="Center" Grid.Column="1"
Text="{Binding Location}"
FontFamily="Arial" FontFamily="Arial"
FontSize="14" FontSize="16"
Margin="0 20 0 0"/> Height="30"
</StackPanel> VerticalContentAlignment="Center"
<WrapPanel Grid.Row="1" Background="LightGray"/>
<Grid Grid.Row="6"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
HorizontalAlignment="Center" Margin="0 30 0 0"
Margin="20"> Width="450"
HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="Speichern" <Button Content="Speichern"
Command="{Binding SubmitCommand}" Command="{Binding SubmitCommand}"
Style="{StaticResource ModernButton}" Style="{StaticResource ModernButton}"
Width="100" Width="120"
Height="25" Height="35"
HorizontalAlignment="Left" FontSize="16"
Margin="0 0 80 0"
IsEnabled="{Binding CanSubmit}"> IsEnabled="{Binding CanSubmit}">
</Button> </Button>
<Button Content="Abbrechen" <Button Content="Abbrechen"
Command="{Binding CancelCommand}" Command="{Binding CancelCommand}"
Style="{StaticResource ModernButton}" Style="{StaticResource ModernButton}"
Width="100" Width="120"
Height="25"/> Height="35"
</WrapPanel> FontSize="16"
Grid.Column="1"/>
</Grid>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -37,6 +37,7 @@
Background="Transparent" Background="Transparent"
BorderThickness="0" BorderThickness="0"
Cursor="Hand" Cursor="Hand"
ToolTip="Löschen"
Command="{Binding DeleteCommand}"> Command="{Binding DeleteCommand}">
<iconPacks:PackIconMaterial Kind="TrashCan" <iconPacks:PackIconMaterial Kind="TrashCan"
VerticalAlignment="Center" VerticalAlignment="Center"

View File

@@ -12,7 +12,7 @@
CornerRadius="10"> CornerRadius="10">
</Border> </Border>
<TextBlock Text="erstelle eine neues Tournier oder wähle ein vorhandenes Tournier um es zu bearbeiten!" <TextBlock Text="klicke auf neues Turnier erstellen oder wähle ein vorhandenes Turnier um es zu bearbeiten!"
TextAlignment="Center" TextAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
FontFamily="Arial" FontFamily="Arial"

View File

@@ -0,0 +1,18 @@
<UserControl x:Class="Apollon.WPF.Views.EditTournamentView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Apollon.WPF.Views"
xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
mc:Ignorable="d">
<Grid>
<TextBlock Text="Turniers Bearbeiten"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="25"
Foreground="#0000a0"/>
<components:AddEditDetails Margin="0 50 0 0"/>
</Grid>
</UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Apollon.WPF.Views
{
/// <summary>
/// Interaction logic for EditTournamentView.xaml
/// </summary>
public partial class EditTournamentView : UserControl
{
public EditTournamentView()
{
InitializeComponent();
}
}
}