I define my own control – NameInfoControl, which are based on UserControl thorough XAML:
<UserControl x:Class="AcadLoadManager.NameInfoControl"
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>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ToolBar>
<Button x:Name="btnAdd" x:FieldModifier="public" ToolTip="Add record" >
<Image Source="/AcadLoadManager;component/Icons/bullet_sparkle.png" Width="16"/>
</Button>
<Button x:Name="btnEdit" x:FieldModifier="public" ToolTip="Edit record">
<Image Source="/AcadLoadManager;component/Icons/bullet_edit.png" Width="16"/>
</Button>
<Button x:Name="btnRemove" x:FieldModifier="public" ToolTip="Remove record">
<Image Source="/AcadLoadManager;component/Icons/bullet_cross.png" Width="16"/>
</Button>
</ToolBar>
<ListView x:Name="myListView" x:FieldModifier="public" Margin="3" Grid.Row="1">
<ListView.View>
<GridView>
<GridViewColumn Width="100" Header="Global name"
DisplayMemberBinding="{Binding GlobalName}"/>
<GridViewColumn Width="100" Header="Local name"
DisplayMemberBinding="{Binding LocalName}"/>
</GridView>
</ListView.View>
</ListView>
</Grid>
</Grid>
</UserControl>
It looks so:

My control has ListView item, named as myListView. How can I set value for ItemsSource property of myListView through XAML for NameInfoControl instance? I need it in the next code:
<GroupBox Header="Command groups:" Grid.Column="0" Grid.Row="1" Margin="5">
<local:NameInfoControl/>
</GroupBox>
In your XAML of your
NameInfoControlbind the items of yourmyListViewto theDataContextof your control:And then in the parent XAML where you use that control bind the
DataContextto the list that contain the items that should be displayed:<local:NameInfoControl DataContext="{Binding MyCollectionOfItems}" />