Я создал UserControl, теперь я его могу использовать в MainWindow.xaml:
<local:UserControl1 Margin="731,757,10,232" Height="40" />
Подскажите как при использовании UserControl1 в MainWindow.xaml передать?:
1. Текст в TextBlock
2. Событие MouseLeftButtonDown = "MouseLeftButtonDown"
UserControl<UserControl x:Class="Boots.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"
xmlns:local="clr-namespace:Boots"
mc:Ignorable="d" >
<local:MyGrid x:Name="Objx" HorizontalAlignment="Left" VerticalAlignment="Top" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
<ColumnDefinition Width="40" />
<ColumnDefinition Width="40" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="40" />
<ColumnDefinition Width="40" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" Margin="1" Text="" HorizontalAlignment="Center" VerticalAlignment="Center" />
<local:Cell Grid.Column="1" Grid.Row="0" Content="" />
<local:Cell Grid.Column="2" Grid.Row="0" Content="" />
<TextBox Grid.Column="3" Grid.Row="0" Margin="10"/>
<local:Cell Grid.Column="4" Grid.Row="0" Content="" />
<local:Cell Grid.Column="5" Grid.Row="0" Content="" />
</local:MyGrid>
</UserControl>