Files
BeWoPlaner/BeWo/LoginControl.xaml
2025-04-03 16:47:50 +02:00

434 lines
22 KiB
XML

<UserControl
x:Class="BeWo.LoginControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="Auto"
d:DesignHeight="600"
d:DesignWidth="800"
Background="{StaticResource LoginBackground}"
mc:Ignorable="d">
<Grid Name="grid_root">
<StackPanel HorizontalAlignment="Center">
<Grid
x:Name="gridLogin"
Width="600"
Height="400"
Margin="0,0,0,0"
Background="{x:Null}"
RenderTransformOrigin="0.5,0.5"
Visibility="Visible">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Grid.RenderTransform>
<Border
Padding="5,5,5,5"
Background="{DynamicResource LoginBackgroundColor}"
BorderBrush="#FF606060"
BorderThickness="2,2,2,2"
CornerRadius="7,7,7,7"
KeyDown="UIElement_OnKeyDown">
<Grid Opacity="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="170" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="185" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image
Grid.Row="0"
Grid.ColumnSpan="4"
Height="44"
Margin="7,7,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Source="Ressources\Icons\bewoplaner_logo_small.png" />
<Label
x:Name="lblVersion"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="4"
Margin="5,7,3,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Content="Version x.x.x"
FontSize="10"
Foreground="#FF818181" />
<StackPanel
Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="2"
Margin="0,80,0,0">
<Label
Margin="0,30,0,0"
Content="Herzlich willkommen beim BeWoPlaner!"
FontSize="12"
FontWeight="Bold"
Foreground="#FF000000" />
<Label
Content="{markup:Translate Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein.}"
FontSize="12"
Foreground="#FF000000" />
</StackPanel>
<Label
x:Name="lblPin"
Grid.Row="1"
Grid.Column="1"
VerticalAlignment="Center"
Background="#00000000"
Content="PIN:"
Foreground="#FF000000"
Visibility="Collapsed" />
<TextBox
x:Name="PINTextBox"
Grid.Row="1"
Grid.Column="2"
Height="24"
Margin="10,0,20,0"
HorizontalAlignment="Stretch"
SnapsToDevicePixels="True"
Visibility="Collapsed" />
<Label
Grid.Row="2"
Grid.Column="1"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="#00000000"
Content="{markup:Translate Benutzername:}"
Foreground="#FF000000" />
<Label
Grid.Row="3"
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="#00000000"
Content="Passwort:"
Foreground="#FF000000" />
<TextBox
x:Name="TextBox_Username"
Grid.Row="2"
Grid.Column="2"
Height="24"
Margin="10,10,20,10"
HorizontalAlignment="Stretch"
GotFocus="TextBox_Username_OnGotFocus"
SnapsToDevicePixels="True"
TabIndex="0"
Text="" />
<PasswordBox
x:Name="PasswordBox_Password"
Grid.Row="3"
Grid.Column="2"
Height="24"
Margin="10,0,20,0"
HorizontalAlignment="Stretch"
GotFocus="PasswordBox_Password_OnGotFocus"
Password=""
TabIndex="1" />
<Label
x:Name="profileLabel"
Grid.Row="5"
Grid.Column="1"
VerticalAlignment="Center"
Content="Profil:"
FontSize="12"
Foreground="#FF000000"
Visibility="Collapsed" />
<StackPanel
x:Name="profileStackPanel"
Grid.Row="5"
Grid.Column="2"
Margin="0,10,20,0"
Orientation="Horizontal"
Visibility="Collapsed">
<ComboBox
x:Name="profileSelectionComboBox"
Width="175"
Height="24"
Margin="10,0,0,0"
HorizontalAlignment="Left"
ItemsSource="{Binding Path=ProfileList}"
SelectedIndex="0" />
<Button
Width="23"
Height="23"
Margin="3,0,0,0"
Click="button_addProfile_Click"
Content="@"
FontFamily="Webdings"
FontSize="14"
ToolTip="Profile bearbeiten" />
</StackPanel>
<Label
x:Name="proxyLabel"
Grid.Row="6"
Grid.Column="1"
VerticalAlignment="Center"
Content="Proxy:"
FontSize="12"
Foreground="#FF000000"
Visibility="Collapsed" />
<StackPanel
x:Name="proxyStackPanel"
Grid.Row="6"
Grid.Column="2"
Margin="0,5,20,0"
Orientation="Horizontal"
Visibility="Collapsed">
<TextBox
x:Name="proxyTextBox"
Width="175"
Height="24"
Margin="10,0,0,0"
HorizontalAlignment="Left"
IsReadOnly="True" />
<Button
Width="23"
Height="23"
Margin="3,0,0,0"
Click="button_configureProxy_Click"
Content="@"
FontFamily="Webdings"
FontSize="14"
ToolTip="Proxy bearbeiten" />
</StackPanel>
<ToggleButton
x:Name="showProfileSelectionBtn"
Grid.Row="4"
Grid.Column="2"
Margin="0,5,20,0"
HorizontalAlignment="Right"
Click="ShowProfileStackPanel"
Content="Erweitert"
Foreground="#FF818181">
<ToggleButton.Template>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="18" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="ButtonContent" />
<Path
x:Name="Down_Arrow"
Grid.Column="1"
Margin="0,3,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 0 0 L 4 4 L 8 0 L 4 2 Z"
Fill="{TemplateBinding Foreground}" />
<Path
x:Name="Down_Arrow2"
Grid.Column="1"
Margin="0,-3,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 0 0 L 4 4 L 8 0 L 4 2 Z"
Fill="{TemplateBinding Foreground}" />
<Path
x:Name="Up_Arrow"
Grid.Column="1"
Margin="0,-3,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 0 4 L 4 0 L 8 4 L 4 2 Z"
Fill="{TemplateBinding Foreground}"
Visibility="Collapsed" />
<Path
x:Name="Up_Arrow2"
Grid.Column="1"
Margin="0,3,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 0 4 L 4 0 L 8 4 L 4 2 Z"
Fill="{TemplateBinding Foreground}"
Visibility="Collapsed" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Down_Arrow" Property="Fill" Value="#FF333333" />
<Setter TargetName="Down_Arrow2" Property="Fill" Value="#FF333333" />
<Setter TargetName="Up_Arrow" Property="Fill" Value="#FF333333" />
<Setter TargetName="Up_Arrow2" Property="Fill" Value="#FF333333" />
<Setter TargetName="ButtonContent" Property="TextBlock.Foreground" Value="#FF333333" />
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="Down_Arrow" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Down_Arrow2" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Up_Arrow" Property="Visibility" Value="Visible" />
<Setter TargetName="Up_Arrow2" Property="Visibility" Value="Visible" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
<ToggleButton.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
AutoReverse="False"
Completed="AnimationComplete"
Storyboard.TargetName="gridLogin"
Storyboard.TargetProperty="Height"
From="{Binding HeightFrom, UpdateSourceTrigger=PropertyChanged}"
To="{Binding HeightTo, UpdateSourceTrigger=PropertyChanged}"
Duration="0:0:0.1" />
<DoubleAnimation
AutoReverse="False"
Completed="Animation2Complete"
Storyboard.TargetName="linkLine"
Storyboard.TargetProperty="Y1"
From="{Binding LineYCoordFrom, UpdateSourceTrigger=PropertyChanged}"
To="{Binding LineYCoordTo, UpdateSourceTrigger=PropertyChanged}"
Duration="0:0:0.1" />
<DoubleAnimation
AutoReverse="False"
Storyboard.TargetName="linkLine"
Storyboard.TargetProperty="Y2"
From="{Binding LineYCoordFrom, UpdateSourceTrigger=PropertyChanged}"
To="{Binding LineYCoordTo, UpdateSourceTrigger=PropertyChanged}"
Duration="0:0:0.1" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ToggleButton.Triggers>
</ToggleButton>
<StackPanel
Grid.Row="7"
Grid.Column="2"
Margin="10,30,20,50"
HorizontalAlignment="Stretch"
Orientation="Vertical">
<Button
x:Name="button_login"
Height="30"
Margin="3"
HorizontalAlignment="Stretch"
Click="button_login_Click"
Content="Anmelden"
Foreground="White"
IsDefault="True" />
<TextBlock
Margin="3"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource MainGroupBoxForegroundBrush}"
Visibility="Collapsed">
<Hyperlink NavigateUri="#" RequestNavigate="PasswortVergessenLinkOnRequestNavigate">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="10"
Text="Passwort vergessen" />
</Hyperlink>
</TextBlock>
</StackPanel>
<TextBlock
x:Name="txtCopyright"
Grid.Row="7"
Grid.Column="0"
Grid.ColumnSpan="3"
Margin="10,5,0,5"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
FontSize="10"
Foreground="#FF818181"
Text="Copyright 2022 | ownSoft GmbH" />
<TextBlock
Grid.Row="7"
Grid.Column="3"
Margin="0,5,12,5"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
FontSize="10">
<Hyperlink
x:Name="hyperlink"
Foreground="#FF818181"
NavigateUri="https://www.ownsoft.de"
RequestNavigate="Hyperlink_OnRequestNavigate"
TargetName="newWindow">
www.ownsoft.de
</Hyperlink>
</TextBlock>
</Grid>
</Border>
<Line
Grid.ColumnSpan="4"
Stroke="#FFADADAD"
StrokeThickness="1"
X1="14"
X2="585"
Y1="70"
Y2="70" />
<Line
x:Name="linkLine"
Margin="0,30,0,-30"
Stroke="#FFADADAD"
StrokeThickness="1"
X1="14"
X2="585"
Y1="340"
Y2="340" />
</Grid>
<Rectangle
Width="600"
Height="400"
RenderTransformOrigin="0.5,0.5">
<Rectangle.OpacityMask>
<LinearGradientBrush StartPoint="0.5,0.418" EndPoint="0.5,1">
<GradientStop Offset="0" Color="#00000000" />
<GradientStop Offset="1" Color="#4CFFFFFF" />
</LinearGradientBrush>
</Rectangle.OpacityMask>
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="-1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Rectangle.RenderTransform>
<Rectangle.Fill>
<VisualBrush Visual="{Binding ElementName=gridLogin}" />
</Rectangle.Fill>
</Rectangle>
</StackPanel>
<Border x:Name="profileEditPopUp" />
</Grid>
</UserControl>