Selaa lähdekoodia

Кнопочки

Danila Alekseev 1 vuosi sitten
vanhempi
commit
27f79ad43a
2 muutettua tiedostoa jossa 41 lisäystä ja 2 poistoa
  1. 39 0
      ROGOZ/Dictionary.xaml
  2. 2 2
      ROGOZ/Pages/TaskList.xaml

+ 39 - 0
ROGOZ/Dictionary.xaml

@@ -934,4 +934,43 @@
             </Trigger>
         </Style.Triggers>
     </Style>
+    
+    
+    <!--Кнопки добавить и удалить для задач-->
+
+    <Style x:Key="AddDeleteBtn" TargetType="Button">
+        <Setter Property="FontSize" Value="20"/>
+        <Setter Property="FontFamily" Value="Comic Sans MS"/>
+        <Setter Property="FontWeight" Value="Bold"/>
+        <Setter Property="Foreground" Value="#f8f8ff"/>
+        <Setter Property="Background" Value="#52a8ff"/>
+        <Setter Property="Height" Value="35"/>
+        <Setter Property="Width" Value="200"/>
+        <Setter Property="BorderThickness" Value="3"/>
+        <Setter Property="BorderBrush" Value="#1f8fff"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
+                        <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="#1f8fff"/>
+                <Setter Property="BorderBrush" Value="#0075eb"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
 </ResourceDictionary>

+ 2 - 2
ROGOZ/Pages/TaskList.xaml

@@ -44,8 +44,8 @@
             </DataGrid.Columns>
         </DataGrid>
 
-        <Button Content="Добавить" Grid.Row="2" Width="150" Height="30" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="100,5" Click="BtnAdd_Click"/>
-        <Button Content="Удалить" Name="BtnDelTask" Grid.Row="2" Width="150" Height="30" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,5" Click="BtnDelTask_Click"/>
+        <Button Content="Добавить" Grid.Row="2" Style="{DynamicResource AddDeleteBtn}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="100,5" Click="BtnAdd_Click"/>
+        <Button Content="Удалить" Name="BtnDelTask" Grid.Row="2" Style="{DynamicResource AddDeleteBtn}"  HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="100,5" Click="BtnDelTask_Click"/>
 
     </Grid>
 </Page>