日期:2014-05-17 浏览次数:20942 次
<UserControl x:Class="WPF1.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid Background="Red">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"></ContentPresenter>
</Grid>
</UserControl>
<Window x:Class="WPF1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WPF1" Height="350" Width="600" Name="ddd">
<Grid>
<local:UserControl1 HorizontalAlignment="Left" Content="张三" Height="100" Margin="119,77,0,0" VerticalAlignment="Top" Width="100"/>
</Grid>
</Window>
<m:UserControl1 Width="100" Height="100" Background="Blue" >
<Grid>
</Grid>
</m:UserControl1>
<Grid Background="Red">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"></ContentPresenter>
</Grid>