mekasu0124

Untitled

Feb 24th, 2024
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 4.56 KB | None | 0 0
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2.             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3.             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4.             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5.              xmlns:vm="using:Diary.ViewModels"
  6.             mc:Ignorable="d" d:DesignWidth="1500" d:DesignHeight="850"
  7.             x:Class="Diary.Views.LoginView"
  8.              x:DataType="vm:LoginViewModel"
  9.              Background="{Binding Background}">
  10.  
  11.     <Design.DataContext>
  12.         <vm:LoginViewModel />
  13.     </Design.DataContext>
  14.  
  15.     <UserControl.Styles>
  16.         <Style Selector="Border">
  17.             <Setter Property="BorderBrush" Value="{Binding Border}" />
  18.             <Setter Property="BorderThickness" Value="2" />
  19.             <Setter Property="CornerRadius" Value="10" />
  20.             <Setter Property="Padding" Value="10" />
  21.         </Style>
  22.  
  23.         <Style Selector="Label">
  24.             <Setter Property="Foreground" Value="{Binding Foreground}" />
  25.             <Setter Property="FontSize" Value="{Binding FontSize}" />
  26.             <Setter Property="FontFamily" Value="{Binding FontFamily}" />
  27.             <Setter Property="FontStyle" Value="{Binding FontStyle}" />
  28.             <Setter Property="HorizontalAlignment" Value="Center" />
  29.             <Setter Property="VerticalAlignment" Value="Center" />
  30.         </Style>
  31.  
  32.         <Style Selector="Label.Error">
  33.             <Setter Property="Foreground" Value="DarkRed" />
  34.             <Setter Property="FontSize" Value="12" />
  35.             <Setter Property="FontFamily" Value="Times New Roman" />
  36.             <Setter Property="FontStyle" Value="Normal" />
  37.             <Setter Property="HorizontalAlignment" Value="Center" />
  38.             <Setter Property="VerticalAlignment" Value="Center" />
  39.             <Setter Property="BorderBrush" Value="DarkRed" />
  40.             <Setter Property="BorderThickness" Value="2" />
  41.             <Setter Property="CornerRadius" Value="20" />
  42.             <Setter Property="Background" Value="Red" />
  43.         </Style>
  44.  
  45.         <Style Selector="MaskedTextBox">
  46.             <Setter Property="Foreground" Value="{Binding Foreground}" />
  47.             <Setter Property="Background" Value="{Binding Background}" />
  48.             <Setter Property="FontSize" Value="{Binding FontSize}" />
  49.             <Setter Property="FontFamily" Value="{Binding FontFamily}" />
  50.             <Setter Property="FontStyle" Value="{Binding FontStyle}" />
  51.             <Setter Property="HorizontalAlignment" Value="Center" />
  52.             <Setter Property="VerticalAlignment" Value="Center" />
  53.             <Setter Property="HorizontalContentAlignment" Value="Center" />
  54.             <Setter Property="VerticalContentAlignment" Value="Center" />
  55.         </Style>
  56.  
  57.         <Style Selector="Button">
  58.             <Setter Property="Foreground" Value="{Binding Foreground}" />
  59.             <Setter Property="Background" Value="{Binding Background}" />
  60.             <Setter Property="BorderBrush" Value="{Binding Border}" />
  61.             <Setter Property="FontSize" Value="{Binding FontSize}" />
  62.             <Setter Property="FontFamily" Value="{Binding FontFamily}" />
  63.             <Setter Property="FontStyle" Value="{Binding FontStyle}" />
  64.             <Setter Property="HorizontalAlignment" Value="Center" />
  65.             <Setter Property="VerticalAlignment" Value="Center" />
  66.             <Setter Property="HorizontalContentAlignment" Value="Center" />
  67.             <Setter Property="VerticalContentAlignment" Value="Center" />
  68.             <Setter Property="CornerRadius" Value="20" />
  69.             <Setter Property="BorderThickness" Value="1" />
  70.             <Setter Property="Width" Value="300" />
  71.             <Setter Property="Height" Value="70" />
  72.             <Setter Property="Margin" Value="0,0,0,10" />
  73.  
  74.             <Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
  75.                 <Setter Property="Foreground" Value="{Binding Foreground}" />
  76.                 <Setter Property="Background" Value="{Binding Background}" />
  77.                 <Setter Property="BorderBrush" Value="{Binding Border}" />
  78.                 <Setter Property="CornerRadius" Value="20" />
  79.                 <Setter Property="BorderThickness" Value="1" />
  80.             </Style>
  81.         </Style>
  82.     </UserControl.Styles>
  83.  
  84.     <Border>
  85.         <Grid RowDefinitions="*,*,*">
  86.             <Grid Grid.Row="0" ColumnDefinitions="Auto, *">
  87.                 <Label Grid.Column="0" Content="Username" />
  88.                 <TextBox Grid.Column="1" Text="{Binding Username}" />
  89.             </Grid>
  90.            
  91.             <Grid Grid.Row="1" ColumnDefinitions="Auto, *">
  92.                 <Label Grid.Column="0" Content="Password" />
  93.                 <MaskedTextBox Grid.Column="1" Text="{Binding Password}" />
  94.             </Grid>
  95.            
  96.             <Grid Grid.Row="2" RowDefinitions="*, Auto">
  97.                 <Label Classes="Error" Grid.Row="0" Content="{Binding ErrorText}" IsVisible="{Binding IsVisible}" />
  98.                 <Grid Grid.Row="1" ColumnDefinitions="*, *">
  99.                     <Button Grid.Column="0" Content="Exit" Command="{Binding Exit}" />
  100.                     <Button Grid.Column="1" Content="Login" Command="{Binding Login}" />
  101.                 </Grid>
  102.             </Grid>
  103.         </Grid>
  104.     </Border>
  105. </UserControl>
  106.  
Advertisement
Add Comment
Please, Sign In to add comment