Guest User

Untitled

a guest
Apr 27th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <UserControl
  2. x:Class="ExperimentsWpf.UserControl1"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. Width="100"
  8. Height="100"
  9. d:DesignHeight="450"
  10. d:DesignWidth="800"
  11. Background="Red"
  12. mc:Ignorable="d" />
  13.  
  14. <Window
  15. x:Class="ExperimentsWpf.MainWindow"
  16. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  17. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  18. xmlns:local="clr-namespace:ExperimentsWpf">
  19. <Window.Resources>
  20. <Style x:Key="StyleUserControl1" TargetType="{x:Type local:UserControl1}">
  21. <Setter Property="Width" Value="10" />
  22. <Setter Property="Height" Value="10" />
  23. <Setter Property="Background" Value="Green" />
  24. </Style>
  25. </Window.Resources>
  26. <Grid VerticalAlignment="Center">
  27. <local:UserControl1 Style="{StaticResource StyleUserControl1}" />
  28. </Grid>
  29. </Window>
  30.  
  31. <UserControl
  32. x:Class="ExperimentsWpf.UserControl1"
  33. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  34. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  35. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  36. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  37. d:DesignHeight="450"
  38. d:DesignWidth="800"
  39. mc:Ignorable="d">
  40. <UserControl.Style>
  41. <Style TargetType="UserControl">
  42. <Setter Property="Width" Value="100"/>
  43. <Setter Property="Height" Value="100"/>
  44. <Setter Property="Background" Value="Red"/>
  45. </Style>
  46. </UserControl.Style>
  47. </UserControl>
Add Comment
Please, Sign In to add comment