Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <UserControl
- x:Class="ExperimentsWpf.UserControl1"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- 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"
- Width="100"
- Height="100"
- d:DesignHeight="450"
- d:DesignWidth="800"
- Background="Red"
- mc:Ignorable="d" />
- <Window
- x:Class="ExperimentsWpf.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:ExperimentsWpf">
- <Window.Resources>
- <Style x:Key="StyleUserControl1" TargetType="{x:Type local:UserControl1}">
- <Setter Property="Width" Value="10" />
- <Setter Property="Height" Value="10" />
- <Setter Property="Background" Value="Green" />
- </Style>
- </Window.Resources>
- <Grid VerticalAlignment="Center">
- <local:UserControl1 Style="{StaticResource StyleUserControl1}" />
- </Grid>
- </Window>
- <UserControl
- x:Class="ExperimentsWpf.UserControl1"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- 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"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
- <UserControl.Style>
- <Style TargetType="UserControl">
- <Setter Property="Width" Value="100"/>
- <Setter Property="Height" Value="100"/>
- <Setter Property="Background" Value="Red"/>
- </Style>
- </UserControl.Style>
- </UserControl>
Add Comment
Please, Sign In to add comment