GradientBGDialog.xaml 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <Border x:Class="GeekDesk.Control.Other.GradientBGDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:hc="https://handyorg.github.io/handycontrol"
  5. CornerRadius="4"
  6. >
  7. <Grid>
  8. <StackPanel>
  9. <Grid Width="750"
  10. Height="550"
  11. Panel.ZIndex="0"
  12. MouseDown="DragMove"
  13. >
  14. <Grid.Background>
  15. <SolidColorBrush Color="Black" Opacity="0.01"/>
  16. </Grid.Background>
  17. </Grid>
  18. <hc:TransitioningContentControl TransitionMode="Fade"
  19. Panel.ZIndex="99"
  20. Width="600"
  21. Height="400"
  22. Margin="0,-620,0,0">
  23. <Border Style="{StaticResource BorderBG}">
  24. <Grid>
  25. <TextBlock Text="提示: 右键点击可以删除自定义的背景颜色哦" Foreground="Gray" HorizontalAlignment="Center" Margin="0,5,0,0"/>
  26. <ListBox x:Name="GradientBGs"
  27. ItemsSource="{Binding}"
  28. Background="Transparent"
  29. Margin="20,20,20,50"
  30. BorderThickness="0"
  31. >
  32. <ListBox.Resources>
  33. <ContextMenu x:Key="CMDialog" Width="200">
  34. <MenuItem Header="删除" Click="Delete" Tag="{Binding}"/>
  35. </ContextMenu>
  36. </ListBox.Resources>
  37. <ListBox.ItemContainerStyle>
  38. <Style TargetType="ListBoxItem">
  39. <Setter Property="ContextMenu" Value="{StaticResource CMDialog}"/>
  40. <Setter Property="Margin" Value="10"/>
  41. <Setter Property="Effect" Value="{StaticResource EffectShadow2}"/>
  42. </Style>
  43. </ListBox.ItemContainerStyle>
  44. <ListBox.ItemsPanel>
  45. <ItemsPanelTemplate>
  46. <WrapPanel Background="Transparent"/>
  47. </ItemsPanelTemplate>
  48. </ListBox.ItemsPanel>
  49. <ListBox.ItemTemplate>
  50. <DataTemplate>
  51. <Border CornerRadius="4" Width="100" Height="100"
  52. MouseLeftButtonDown="BGBorder_MouseLeftButtonDown"
  53. Tag="{Binding}">
  54. <Border.Background>
  55. <LinearGradientBrush>
  56. <GradientStop Offset="0" Color="{Binding Color1}"/>
  57. <GradientStop Offset="1" Color="{Binding Color2}"/>
  58. </LinearGradientBrush>
  59. </Border.Background>
  60. <Border Width="100" Height="30" VerticalAlignment="Bottom">
  61. <Border.Background>
  62. <SolidColorBrush Color="Gray" Opacity="0.4"/>
  63. </Border.Background>
  64. <TextBlock Text="{Binding Name}" TextAlignment="Center" VerticalAlignment="Center" FontSize="17" FontWeight="Bold" Foreground="White"/>
  65. </Border>
  66. </Border>
  67. </DataTemplate>
  68. </ListBox.ItemTemplate>
  69. </ListBox>
  70. <hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
  71. <Button Content="关闭" Style="{StaticResource MyBtnStyle}" Click="Close_Click" HorizontalAlignment="Stretch" Margin="524,360,-524,10" VerticalAlignment="Stretch"/>
  72. </hc:UniformSpacingPanel>
  73. </Grid>
  74. </Border>
  75. </hc:TransitioningContentControl>
  76. </StackPanel>
  77. </Grid>
  78. </Border>