SlotsList.xaml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <UserControl x:Class="FurnaceUI.Controls.SlotsList"
  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. xmlns:local="clr-namespace:FurnaceUI.Controls"
  7. mc:Ignorable="d" Height="643" Width="1232">
  8. <Grid>
  9. <ListBox x:Name="list">
  10. <ListBox.ItemTemplate>
  11. <DataTemplate>
  12. <WrapPanel Orientation="Horizontal" Margin="0,0,0,5">
  13. <Button VerticalAlignment="Center" Tag="{Binding Slot}" IsHitTestVisible="{Binding RelativeSource={RelativeSource FindAncestor,
  14. AncestorType={x:Type UserControl}}, Path=IsListEnable}" Background="{Binding BkColor}" Width="115" Height="32" Click="Button_Click_1" Margin="2">
  15. <Button.Content>
  16. <Grid>
  17. <Grid.ColumnDefinitions>
  18. <ColumnDefinition Width="35"/>
  19. <ColumnDefinition/>
  20. </Grid.ColumnDefinitions>
  21. <TextBlock Text="{Binding Slot,StringFormat={}0:}" TextAlignment="Left" VerticalAlignment="Center" Width="33" ></TextBlock>
  22. <TextBlock Grid.Column="1" Text="{Binding Description}" VerticalAlignment="Center"/>
  23. </Grid>
  24. </Button.Content>
  25. </Button>
  26. </WrapPanel>
  27. </DataTemplate>
  28. </ListBox.ItemTemplate>
  29. <ListBox.ItemsPanel>
  30. <ItemsPanelTemplate>
  31. <WrapPanel Orientation="Vertical" Height="670" IsItemsHost="True" Margin="4"></WrapPanel>
  32. </ItemsPanelTemplate>
  33. </ListBox.ItemsPanel>
  34. </ListBox>
  35. </Grid>
  36. </UserControl>