SukiDialog.axaml 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <ResourceDictionary xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:suki="https://github.com/kikipoulet/SukiUI"
  4. xmlns:dialogs="clr-namespace:SukiUI.Dialogs">
  5. <ControlTheme TargetType="suki:SukiDialog" x:Key="SukiDialogTheme">
  6. <Setter Property="ClipToBounds" Value="False"/>
  7. <Setter Property="Template">
  8. <ControlTemplate>
  9. <Panel>
  10. <Border Padding="0" Margin="0,55,0,0"
  11. ClipToBounds="True" MinWidth="450"
  12. CornerRadius="25">
  13. <Panel>
  14. <Border IsVisible="{TemplateBinding ShowCardBackground}" CornerRadius="25" Background="{DynamicResource SukiCardBackground}">
  15. <Panel Background="{DynamicResource PopupGradientBrush}" Margin="-5">
  16. </Panel>
  17. </Border>
  18. <StackPanel Margin="30,30,30,5" IsVisible="{Binding !IsViewModelOnly, RelativeSource={RelativeSource TemplatedParent}}" Spacing="24">
  19. <Border Margin="0,10,0,0" IsVisible="{TemplateBinding IconColor, Converter={x:Static ObjectConverters.IsNotNull}}"></Border>
  20. <TextBlock Margin="0,0,0,0" IsVisible="{TemplateBinding Title,Converter={x:Static StringConverters.IsNotNullOrEmpty}}" HorizontalAlignment="Center" FontSize="22" FontWeight="DemiBold" Text="{TemplateBinding Title}" />
  21. <ContentControl MaxWidth="{TemplateBinding Content, Converter={x:Static dialogs:DialogContentMaxWidthValueConverter.Instance}}" Content="{TemplateBinding Content}" >
  22. <ContentControl.Styles>
  23. <Style Selector="TextBlock">
  24. <Setter Property="FontSize" Value="14" />
  25. <Setter Property="TextWrapping" Value="Wrap" />
  26. </Style>
  27. </ContentControl.Styles>
  28. </ContentControl>
  29. <ItemsControl Margin="0,2,0,0" ItemsSource="{TemplateBinding ActionButtons}">
  30. <ItemsControl.Styles>
  31. <Style Selector="Button">
  32. <Setter Property="Margin" Value="15,0,0,25" />
  33. </Style>
  34. </ItemsControl.Styles>
  35. <ItemsControl.ItemsPanel>
  36. <ItemsPanelTemplate>
  37. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"/>
  38. </ItemsPanelTemplate>
  39. </ItemsControl.ItemsPanel>
  40. </ItemsControl>
  41. </StackPanel>
  42. <ContentControl Content="{TemplateBinding ViewModel}" Margin="15"
  43. IsVisible="{TemplateBinding IsViewModelOnly}" />
  44. </Panel>
  45. </Border>
  46. <Border CornerRadius="50" HorizontalAlignment="Center"
  47. VerticalAlignment="Top"
  48. Margin="-15,-15,0,0" Width="100" Height="100">
  49. <Panel >
  50. <Border Width="90" HorizontalAlignment="Center"
  51. Height="100"
  52. IsVisible="{TemplateBinding IconColor, Converter={x:Static ObjectConverters.IsNotNull}}"
  53. BoxShadow="{DynamicResource SukiBigPopupShadow}"
  54. CornerRadius="50" />
  55. <Ellipse HorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Height="100" Fill="{TemplateBinding IconColor}"/>
  56. <PathIcon HorizontalAlignment="Center" VerticalAlignment="Center" Data="{TemplateBinding Icon}"
  57. Foreground="White"
  58. Width="28"
  59. Height="28" />
  60. </Panel>
  61. </Border>
  62. </Panel>
  63. </ControlTemplate>
  64. </Setter>
  65. </ControlTheme>
  66. <ControlTheme TargetType="suki:SukiDialog"
  67. BasedOn="{StaticResource SukiDialogTheme}"
  68. x:Key="{x:Type suki:SukiDialog}" />
  69. </ResourceDictionary>