Files
MCCAD/MCCAD/Views/LoginView.axaml
T
2026-04-12 22:13:00 +03:00

41 lines
2.1 KiB
XML

<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:viewModels="clr-namespace:MCCAD.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="MCCAD.Views.LoginView"
x:DataType="viewModels:LoginViewModel">
<UserControl.Styles>
<Style Selector="Button.LoginButton">
<Setter Property="Margin" Value="20, 5" />
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Height" Duration="0:0:0.3" />
</Transitions>
</Setter>
</Style>
<Style Selector="TextBlock.AnimateHeight">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Height" Duration="0:0:0.3" />
</Transitions>
</Setter>
</Style>
</UserControl.Styles>
<StackPanel Width="250" Classes="Centred" HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="10">
<TextBlock FontSize="24">Авторизация</TextBlock>
<TextBlock>Введите ваш логин и пароль</TextBlock>
<TextBlock Classes="AnimateHeight" Foreground="Red" IsVisible="{Binding InvalidData}">Логин или пароль неверны</TextBlock>
<TextBox TextChanged="UpdateLoginVisibility" Text="{Binding Login}" Name="LoginText" Watermark="Логин"
HorizontalAlignment="Stretch" />
<TextBox TextChanged="UpdateLoginVisibility" Text="{Binding Password}" Name="PasswordText"
HorizontalAlignment="Stretch" PasswordChar="~"
Watermark="Пароль" />
<Button Height="0" Name="LoginButton" VerticalAlignment="Top" Command="{Binding TryAuth}"
Classes="Long LoginButton" HorizontalAlignment="Center">
Войти
</Button>
</StackPanel>
</UserControl>