GradientBGDialog.xaml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. <ListBox x:Name="GradientBGs"
  26. ItemsSource="{Binding}"
  27. Background="Transparent"
  28. Margin="20,20,20,50"
  29. BorderThickness="0"
  30. >
  31. <ListBox.ItemContainerStyle>
  32. <Style TargetType="ListBoxItem">
  33. <Setter Property="Margin" Value="10"/>
  34. <Setter Property="Effect" Value="{StaticResource EffectShadow2}"/>
  35. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  36. </Style>
  37. </ListBox.ItemContainerStyle>
  38. <ListBox.ItemsPanel>
  39. <ItemsPanelTemplate>
  40. <WrapPanel Background="Transparent"/>
  41. </ItemsPanelTemplate>
  42. </ListBox.ItemsPanel>
  43. <ListBox.ItemTemplate>
  44. <DataTemplate>
  45. <Border CornerRadius="4" Width="100" Height="100"
  46. MouseLeftButtonDown="BGBorder_MouseLeftButtonDown"
  47. Tag="{Binding}">
  48. <Border.Background>
  49. <LinearGradientBrush>
  50. <GradientStop Offset="0" Color="{Binding Color1}"/>
  51. <GradientStop Offset="1" Color="{Binding Color2}"/>
  52. </LinearGradientBrush>
  53. </Border.Background>
  54. <Border Width="100" Height="30" VerticalAlignment="Bottom">
  55. <Border.Background>
  56. <SolidColorBrush Color="Gray" Opacity="0.4"/>
  57. </Border.Background>
  58. <TextBlock Text="{Binding Name}" TextAlignment="Center" VerticalAlignment="Center" FontSize="17" FontWeight="Bold" Foreground="White"/>
  59. </Border>
  60. </Border>
  61. </DataTemplate>
  62. </ListBox.ItemTemplate>
  63. </ListBox>
  64. <hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
  65. <Button Content="关闭" Style="{StaticResource MyBtnStyle}" Click="Close_Click" HorizontalAlignment="Stretch" Margin="524,360,-524,10" VerticalAlignment="Stretch"/>
  66. </hc:UniformSpacingPanel>
  67. </Grid>
  68. </Border>
  69. </hc:TransitioningContentControl>
  70. </StackPanel>
  71. </Grid>
  72. </Border>