Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all you need to decide between WPF or Windows Forms. It really depends on which ui engine you are using. If you are using Windows Forms the only control that comes to my mind, which has all the features you want would be the DataGridView, since you are able to display a whole set of data in each row (filename, format, size, etc.). With WPF you have several different ways of doing this. If you want to have the equivalent to the DataGridView, you might want to have a look at the DataGrid (which is not contained in WPF, but comes with the great WPF Toolkit, which you can download at CodePlex). On the other hand you could use the ListBox of WPF and use a data template to organize your data within the list. Assuming you store all the data concerning the movie files in a class like this:</p> <pre><code>public class MovieData { public BitmapImage Cover { get; set; } public string FileName { get; set; } public string Format { get; set; } public int Size { get; set; } } </code></pre> <p>the code for the ListBox (XAML) would look like this:</p> <pre><code>&lt;ListBox x:Name="Movies"&gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;Grid Margin="4"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="50" /&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition /&gt; &lt;RowDefinition /&gt; &lt;RowDefinition /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Image Source="{Binding Cover}" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" /&gt; &lt;TextBlock Text="{Binding FileName}" FontWeight="Bold" Grid.Column="1" Grid.Row="0" /&gt; &lt;TextBlock Text="{Binding Format}" Grid.Column="1" Grid.Row="1" /&gt; &lt;TextBlock Text="{Binding Size}" Grid.Column="1" Grid.Row="2" /&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; </code></pre> <p>In your code behind file you need to load the data and then bind it to the control like this:</p> <pre><code>ObservableCollection&lt;MovieData&gt; movies = new ObeservableCollection&lt;MovieData&gt;(); // Load your movie data here MyWindow.Movies.DataContext = movies; // Assuming that the window is called MyWindow </code></pre> <p>If you have any more questions then just ask.</p> <p>David.</p>
 

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