Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ah, was busy mocking up an example :) I'll post it anyway: I added a drop shadow but you can easily change it to a glow., and the C# part just populates a list of file names from a folder next to the .exe.</p> <p>XAML:</p> <pre><code>&lt;Window x:Class="pic_viewer.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:pic_viewer" Title="MainWindow" Height="350" Width="525"&gt; &lt;Window.Resources&gt; &lt;DataTemplate x:Key="item_template" DataType="Item"&gt; &lt;Image Source="{Binding}" Width="64" Height="64"/&gt; &lt;DataTemplate.Triggers&gt; &lt;Trigger Property="IsMouseOver" Value="True"&gt; &lt;Setter Property="BitmapEffect"&gt; &lt;Setter.Value&gt; &lt;DropShadowBitmapEffect ShadowDepth="3" Color="Black"/&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Trigger&gt; &lt;/DataTemplate.Triggers&gt; &lt;/DataTemplate&gt; &lt;ObjectDataProvider x:Key="pic_list" ObjectType="{x:Type local:Pic}" MethodName="get_pics"/&gt; &lt;/Window.Resources&gt; &lt;ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" x:Name="item_listbox" ItemsSource="{Binding Source={StaticResource pic_list}}" ItemTemplate="{StaticResource item_template}"&gt; &lt;ListView.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;WrapPanel/&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ListView.ItemsPanel&gt; &lt;/ListView&gt; &lt;/Window&gt; </code></pre> <p>C#:</p> <pre><code>using System.Collections.Generic; using System.Windows; using System.Windows.Documents; namespace pic_viewer { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } public class Pic { public List&lt;string&gt; get_pics() { List&lt;string&gt; p = new List&lt;string&gt;(); p.Add(@"pack://siteoforigin:,,,/Images/black.png"); p.Add(@"pack://siteoforigin:,,,/Images/blu.png"); p.Add(@"pack://siteoforigin:,,,/Images/empty.png"); p.Add(@"pack://siteoforigin:,,,/Images/red.png"); return p; } } } </code></pre>
    singulars
    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.
 

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