You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DialogContainer.xaml 9.4 KiB

пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:bpa="clr-namespace:BPA.UIControl">
  4. <ResourceDictionary.MergedDictionaries>
  5. <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/Button.xaml" />
  6. </ResourceDictionary.MergedDictionaries>
  7. <Style x:Key="RubyerDialogContainer" TargetType="bpa:DialogContainer">
  8. <Setter Property="Background" Value="{DynamicResource FloatBackground}" />
  9. <Setter Property="MaskBackground" Value="{DynamicResource DialogBackground}" />
  10. <Setter Property="BorderThickness" Value="0" />
  11. <Setter Property="BorderBrush" Value="Transparent" />
  12. <Setter Property="CornerRadius" Value="{DynamicResource AllContainerCornerRadius}" />
  13. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  14. <Setter Property="HorizontalContentAlignment" Value="Center" />
  15. <Setter Property="IsTabStop" Value="False" />
  16. <Setter Property="Margin" Value="0" />
  17. <Setter Property="Padding" Value="10" />
  18. <Setter Property="SnapsToDevicePixels" Value="True" />
  19. <Setter Property="VerticalContentAlignment" Value="Center" />
  20. <Setter Property="IsEscKeyToClose" Value="False" />
  21. <Setter Property="IsShowCloseButton" Value="True" />
  22. <Setter Property="IsShow" Value="False" />
  23. <Setter Property="IsClosed" Value="True" />
  24. <Setter Property="bpa:HeaderHelper.FontSize" Value="{Binding FontSize, RelativeSource={RelativeSource Self}}" />
  25. <Setter Property="bpa:HeaderHelper.FontWeight" Value="Normal" />
  26. <Setter Property="bpa:HeaderHelper.Background" Value="{Binding Background, RelativeSource={RelativeSource Self}}" />
  27. <Setter Property="bpa:HeaderHelper.Foreground" Value="{DynamicResource DefaultForeground}" />
  28. <Setter Property="bpa:HeaderHelper.HorizontalAlignment" Value="Left" />
  29. <Setter Property="bpa:HeaderHelper.VerticalAlignment" Value="Center" />
  30. <Setter Property="bpa:HeaderHelper.Margin" Value="0" />
  31. <Setter Property="bpa:HeaderHelper.Padding" Value="10 5" />
  32. <Setter Property="bpa:HeaderHelper.CornerRadius" Value="{DynamicResource TopContainerCornerRadius}" />
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="bpa:DialogContainer">
  36. <Grid>
  37. <ContentPresenter x:Name="PART_ContentPresenter"
  38. Panel.ZIndex="1"
  39. Focusable="False"
  40. RecognizesAccessKey="True"
  41. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  42. <Grid x:Name="cardRoot" Panel.ZIndex="100">
  43. <bpa:Transition x:Name="Path_Transition" IsShow="{TemplateBinding IsShow}">
  44. <Border x:Name="PART_BackgroundBorder" Background="{TemplateBinding MaskBackground}" />
  45. </bpa:Transition>
  46. <bpa:Transition InitialScale="0.5"
  47. IsShow="{TemplateBinding IsShow}"
  48. Type="Zoom">
  49. <Border x:Name="PART_CardBorder"
  50. Margin="5"
  51. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  52. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  53. Background="{TemplateBinding Background}"
  54. BorderBrush="{TemplateBinding BorderBrush}"
  55. BorderThickness="{TemplateBinding BorderThickness}"
  56. CornerRadius="{TemplateBinding CornerRadius}"
  57. Effect="{DynamicResource AllDirectionEffect3}">
  58. <Grid>
  59. <Grid.RowDefinitions>
  60. <RowDefinition Height="Auto" />
  61. <RowDefinition Height="*" />
  62. </Grid.RowDefinitions>
  63. <Border x:Name="titleBar"
  64. Background="{Binding Path=(bpa:HeaderHelper.Background), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  65. CornerRadius="{Binding Path=(bpa:HeaderHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}">
  66. <DockPanel Margin="{Binding Path=(bpa:HeaderHelper.Margin), RelativeSource={RelativeSource Mode=TemplatedParent}}">
  67. <Button x:Name="PART_CloseButton"
  68. Style="{StaticResource TextButton}"
  69. Height="Auto"
  70. Padding="5"
  71. bpa:ControlHelper.CornerRadius="{TemplateBinding CornerRadius}"
  72. DockPanel.Dock="Right"
  73. Foreground="{Binding Path=(bpa:HeaderHelper.Foreground), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  74. Visibility="{TemplateBinding IsShowCloseButton, Converter={StaticResource BooleanToVisibleConverter}}">
  75. <bpa:Icon Type="CloseLine" />
  76. </Button>
  77. <TextBlock Margin="{Binding Path=(bpa:HeaderHelper.Padding), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  78. HorizontalAlignment="{Binding Path=(bpa:HeaderHelper.HorizontalAlignment), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  79. VerticalAlignment="{Binding Path=(bpa:HeaderHelper.VerticalAlignment), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  80. FontFamily="{Binding Path=(bpa:HeaderHelper.FontFamily), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  81. FontSize="{Binding Path=(bpa:HeaderHelper.FontSize), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  82. FontWeight="{Binding Path=(bpa:HeaderHelper.FontWeight), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  83. Foreground="{Binding Path=(bpa:HeaderHelper.Foreground), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  84. Text="{TemplateBinding Title}" />
  85. </DockPanel>
  86. </Border>
  87. <Border x:Name="contentBorder" Grid.Row="1">
  88. <ContentPresenter x:Name="dialogContent"
  89. Margin="{TemplateBinding Padding}"
  90. Content="{TemplateBinding DialogContent}"
  91. Focusable="False"
  92. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  93. </Border>
  94. </Grid>
  95. </Border>
  96. </bpa:Transition>
  97. </Grid>
  98. </Grid>
  99. <ControlTemplate.Triggers>
  100. <MultiTrigger>
  101. <MultiTrigger.Conditions>
  102. <Condition Property="Title" Value="{x:Null}" />
  103. <Condition Property="IsShowCloseButton" Value="False" />
  104. </MultiTrigger.Conditions>
  105. <Setter TargetName="titleBar" Property="Visibility" Value="Collapsed" />
  106. <Setter TargetName="contentBorder" Property="CornerRadius" Value="{DynamicResource AllContainerCornerRadius}" />
  107. </MultiTrigger>
  108. <MultiTrigger>
  109. <MultiTrigger.Conditions>
  110. <Condition Property="IsShow" Value="False" />
  111. <Condition Property="IsClosed" Value="True" />
  112. </MultiTrigger.Conditions>
  113. <Setter TargetName="cardRoot" Property="Panel.ZIndex" Value="0" />
  114. <Setter TargetName="cardRoot" Property="Visibility" Value="Collapsed" />
  115. </MultiTrigger>
  116. </ControlTemplate.Triggers>
  117. </ControlTemplate>
  118. </Setter.Value>
  119. </Setter>
  120. </Style>
  121. </ResourceDictionary>