Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use HeaderedItemsControl, XAML</p> <pre><code> &lt;!-- templates --&gt; &lt;DataTemplate x:Key="itemWithDeleteButton"&gt; &lt;Grid Width="Auto"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;ColumnDefinition Width="100"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;TextBlock Grid.Column="0" Text="{Binding Path=DocumentName, Mode=OneWay}" /&gt; &lt;Button Grid.Column="1" Command="{Binding DeleteCommand}"/&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;Style TargetType="{x:Type HeaderedItemsControl}" x:Key="DeletedGrid"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="{x:Type HeaderedItemsControl}"&gt; &lt;Grid&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;ColumnDefinition Width="100"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="20"/&gt; &lt;RowDefinition Height="4*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;TextBlock Grid.Column="0" Grid.Row="0" Text="Document Name" VerticalAlignment="Center" FontWeight="Bold"/&gt; &lt;TextBlock Grid.Column="1" Grid.Row="0" Text="Actions" VerticalAlignment="Center" FontWeight="Bold"/&gt; &lt;Grid Grid.Row="1" Grid.ColumnSpan="2" Width="Auto" Height="Auto" Background="White"&gt; &lt;ItemsPresenter/&gt; &lt;/Grid&gt; &lt;/Grid&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;!-- control --&gt; &lt;HeaderedItemsControl Style="{StaticResource DeletedGrid}" Margin="0,0,0,10" Grid.Row="4" Grid.ColumnSpan="2" ItemTemplate="{StaticResource itemWithDeleteButton}" ItemsSource="{Binding GridData}"&gt; </code></pre> <p>ViewModel</p> <pre><code> public class GridItem { public string DocumentName { get; set; } public ICommand DeleteCommand { get; set; } } public class MyViewModel { public ObservableCollection&lt;GridItem&gt; GridData { get; set; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload