Quellcode durchsuchen

Микро приколы

Danila Alekseev vor 1 Jahr
Ursprung
Commit
c72886c721

+ 66 - 0
ROGOZ/Dictionary.xaml

@@ -152,4 +152,70 @@
         <Setter Property="HorizontalAlignment" Value="Center"/>
     </Style>
 
+    <Style x:Key="PanelButtonX" TargetType="Button">
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="Width" Value="30"/>
+        <Setter Property="Height" Value="30"/>
+        <Setter Property="HorizontalAlignment" Value="Right"/>
+        <Setter Property="VerticalAlignment" Value="Top"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Padding" Value="5"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
+                        <Grid>
+                            <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" ContentSource="{TemplateBinding ContentStringFormat}"/>
+                        </Grid>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        
+        <Style.Resources>
+        <Style TargetType ="Border">
+            <Setter Property="CornerRadius" Value="10"/>
+        </Style>
+        </Style.Resources>
+        <Style.Triggers>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="Background" Value="#FF9C9C"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+
+    <Style x:Key="PanelButtonMin" TargetType="Button">
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="Width" Value="30"/>
+        <Setter Property="Height" Value="30"/>
+        <Setter Property="HorizontalAlignment" Value="Right"/>
+        <Setter Property="VerticalAlignment" Value="Top"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Padding" Value="3"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
+                        <Grid>
+                            <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" ContentSource="{TemplateBinding ContentStringFormat}"/>
+                        </Grid>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+
+        <Style.Resources>
+            <Style TargetType ="Border">
+                <Setter Property="CornerRadius" Value="10"/>
+            </Style>
+        </Style.Resources>
+        <Style.Triggers>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="Background" Value="Gray"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+
 </ResourceDictionary>

+ 44 - 23
ROGOZ/Pages/Authorization.xaml

@@ -6,32 +6,53 @@
       xmlns:local="clr-namespace:ROGOZ.Pages"
       mc:Ignorable="d" 
       Height="445" Width="720"
+        WindowStartupLocation="CenterScreen"
         ResizeMode="NoResize"
-      
-      Title="Авторизация в 𝖊𝖘𝖔𝖋𝖙" Background="#b3deff">
+        WindowStyle="None"
+        Background="Transparent"
+        AllowsTransparency="True"
+        MouseDown="Page_MouseDown">
+    <Border CornerRadius="15">
+        <Border.Background>
+            <ImageBrush ImageSource="/Resources/Cotton Candy Clouds Mural Wallpaper - Murals Your Way.jpg" Stretch="Fill"/>
+        </Border.Background>
+        <Border CornerRadius="15">
+            <Border.Background>
+                <LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,3" Opacity="0.4">
+                    <GradientStop Color="#00BFFF" Offset="0"/>
+                    <GradientStop Color="#00416A" Offset="0.75"/>
+                </LinearGradientBrush>
+            </Border.Background>
+            <Grid x:Name="grid" Cursor="">
 
-    <Grid x:Name="grid" Cursor="">
-        
-        <Label Style="{StaticResource LabelStyle}" Margin="0,45,0,0" VerticalAlignment="Top" Width="320" Height="65">
-            АВТОРИЗАЦИЯ
-        </Label>
-
-        <Image Source="/Resources/logo.png" Width="160" Height="60" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="25,10,10,25"/>
-        <Image Source="/Resources/HatsuneMiku.png" Height="200" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
+                <Label Style="{StaticResource LabelStyle}" Foreground="#E3FDFD" Margin="0,45,0,0" VerticalAlignment="Top" Width="320" Height="65">
+                    АВТОРИЗАЦИЯ
+                </Label>
 
-        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,80,10,10">
+                <Image Source="/Resources/logo.png" Width="160" Height="60" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="25,10,10,25"/>
+                <Image Source="/Resources/HatsuneMiku.png" Height="200" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
 
-            <StackPanel Orientation="Vertical">
-                <TextBox Name="TBoxLogin" Tag="Логин" Style="{DynamicResource TextBoxStyle}"/>
-                <Separator Height="15" Visibility="Hidden"/>
-                <PasswordBox Name="PBoxPassword"  Style="{DynamicResource PasswordBoxStyle}" PasswordChar="♥" PasswordChanged="PBoxPassword_PasswordChanged"/>
-            </StackPanel>
-            <Separator Height="15" Visibility="Hidden"/>
-            <StackPanel>
-                <Button Name="BtnLogin" Content="Войти" Style="{DynamicResource AuthoButtons}" Click="BtnLogin_Click"/>
-            </StackPanel>
+                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,80,10,10">
 
-        </StackPanel>
-        <TextBlock x:Name="WaterMarkerLabel" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,70,185,0" Text="Пароль" FontSize="25" FontFamily="Comic Sans MS" Foreground="Gray"/>
-    </Grid>
+                    <StackPanel Orientation="Vertical">
+                        <TextBox Name="TBoxLogin" Tag="Логин" Style="{DynamicResource TextBoxStyle}"/>
+                        <Separator Height="15" Visibility="Hidden"/>
+                        <PasswordBox Name="PBoxPassword"  Style="{DynamicResource PasswordBoxStyle}" PasswordChar="♥" PasswordChanged="PBoxPassword_PasswordChanged"/>
+                    </StackPanel>
+                    <Separator Height="15" Visibility="Hidden"/>
+                    <StackPanel>
+                        <Button Name="BtnLogin" Content="Войти" Style="{DynamicResource AuthoButtons}" Click="BtnLogin_Click"/>
+                    </StackPanel>
+                </StackPanel>
+                <TextBlock x:Name="WaterMarkerLabel" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,70,185,0" Text="Пароль" FontSize="25" FontFamily="Comic Sans MS" Foreground="Gray"/>
+                <Button x:Name="btnClose" Style="{DynamicResource PanelButtonX}" Margin="5" Click="btnClose_Click">
+                    <Image Source="/Resources/Cross.png"  IsHitTestVisible="False"/>
+                </Button>
+                <Button x:Name="btnMinimize" Style="{DynamicResource PanelButtonMin}" Margin="0,5,40,0" Click="btnMinimize_Click">
+                    <Image Source="/Resources/Minimize.png" IsHitTestVisible="False" />
+                </Button>
+            </Grid>
+        </Border>
+        
+    </Border>
 </Window>

+ 15 - 0
ROGOZ/Pages/Authorization.xaml.cs

@@ -53,5 +53,20 @@ namespace ROGOZ.Pages
                 WaterMarkerLabel.Visibility = Visibility.Visible;
             }
         }
+
+        private void Page_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if (e.LeftButton == MouseButtonState.Pressed) { DragMove(); }
+        }
+
+        private void btnClose_Click(object sender, RoutedEventArgs e)
+        {
+            this.Close();
+        }
+
+        private void btnMinimize_Click(object sender, RoutedEventArgs e)
+        {
+            Application.Current.MainWindow.WindowState = WindowState.Minimized;
+        }
     }
 }

+ 3 - 0
ROGOZ/ROGOZ.csproj

@@ -215,6 +215,9 @@
       <DependentUpon>Model1.edmx</DependentUpon>
       <LastGenOutput>Model1.cs</LastGenOutput>
     </Content>
+    <Resource Include="Resources\Minimize.png" />
+    <Resource Include="Resources\Cross.png" />
+    <Resource Include="Resources\Cotton Candy Clouds Mural Wallpaper - Murals Your Way.jpg" />
   </ItemGroup>
   <ItemGroup>
     <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />

BIN
ROGOZ/Resources/Cotton Candy Clouds Mural Wallpaper - Murals Your Way.jpg


BIN
ROGOZ/Resources/Cross.png


BIN
ROGOZ/Resources/Minimize.png