Attachments.xaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <UserControl x:Class="InABox.DynamicGrid.Attachments"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. mc:Ignorable="d"
  7. d:DesignHeight="450" d:DesignWidth="800">
  8. <Grid>
  9. <Grid.RowDefinitions>
  10. <RowDefinition Height="*" />
  11. <RowDefinition Height="Auto" />
  12. </Grid.RowDefinitions>
  13. <ListBox x:Name="FileList" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Padding="5" Grid.Row="0">
  14. <ListBox.ItemTemplate>
  15. <DataTemplate>
  16. <Border>
  17. <StackPanel Orientation="Vertical">
  18. <Image Height="64" Width="64" Source="{Binding Item2}" Stretch="UniformToFill"
  19. Tag="{Binding}" MouseDown="Item_MouseDown" />
  20. <Label Content="{Binding Item1}" Tag="{Binding}" MouseDown="Item_MouseDown" />
  21. <StackPanel.ContextMenu>
  22. <ContextMenu>
  23. <MenuItem x:Name="ViewFile" Header="View File" Click="ViewFile_Click"
  24. Tag="{Binding}" />
  25. <Separator />
  26. <MenuItem x:Name="DeleteFile" Header="Delete File" Click="DeleteFile_Click"
  27. Tag="{Binding}" />
  28. </ContextMenu>
  29. </StackPanel.ContextMenu>
  30. </StackPanel>
  31. </Border>
  32. </DataTemplate>
  33. </ListBox.ItemTemplate>
  34. <ListBox.ItemsPanel>
  35. <ItemsPanelTemplate>
  36. <WrapPanel IsItemsHost="True" Orientation="Horizontal" />
  37. </ItemsPanelTemplate>
  38. </ListBox.ItemsPanel>
  39. <ListBox.ContextMenu>
  40. <ContextMenu>
  41. <MenuItem x:Name="AddFile" Header="Add File" Click="AddFile_Click" />
  42. </ContextMenu>
  43. </ListBox.ContextMenu>
  44. </ListBox>
  45. <Label Grid.Row="1" Height="40" FontSize="12" HorizontalContentAlignment="Center"
  46. VerticalContentAlignment="Center" Content="Right-click in the box above to add to this list." />
  47. </Grid>
  48. </UserControl>