Explorar o código

Я создал словарь стилей

Kirill Baibarak %!s(int64=4) %!d(string=hai) anos
pai
achega
ce8a21f2ec

+ 5 - 1
Kovalev1App/App.xaml

@@ -4,6 +4,10 @@
              xmlns:local="clr-namespace:Kovalev1App"
              StartupUri="MainWindow.xaml">
     <Application.Resources>
-         
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="Dictionary.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>   
     </Application.Resources>
 </Application>

+ 8 - 0
Kovalev1App/Dictionary.xaml

@@ -0,0 +1,8 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:local="clr-namespace:Kovalev1App">
+    <Style TargetType="{x:Type Label}">
+        <Setter Property="Background" Value="AntiqueWhite"/>
+        <Setter Property="Padding" Value="0"/>
+    </Style>
+</ResourceDictionary>

+ 4 - 0
Kovalev1App/Kovalev1App.csproj

@@ -58,6 +58,10 @@
     <Compile Include="Window1.xaml.cs">
       <DependentUpon>Window1.xaml</DependentUpon>
     </Compile>
+    <Page Include="Dictionary.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="MainWindow.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>

+ 0 - 8
Kovalev1App/MainWindow.xaml

@@ -7,13 +7,5 @@
         mc:Ignorable="d"
         Title="MainWindow" Height="450" Width="800">
     <Grid Margin="-2,0,0,-10" HorizontalAlignment="Left" Width="792" Height="419" VerticalAlignment="Bottom">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="42"/>
-            <RowDefinition/>
-            <RowDefinition Height="42"/>
-        </Grid.RowDefinitions>
-        <Rectangle Fill="#FFF4F4F5" Grid.Row="2" StrokeThickness="0" Height="42" VerticalAlignment="Bottom"/>
-        <Button Content="Назад" HorizontalAlignment="Left" Margin="10,10,0,10" Width="75"/>
-        <Frame x:Name="MainFrame" Content="Frame" Grid.Row="1"/>
     </Grid>
 </Window>