Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.91 KB | None | 0 0
  1. <TextBox.Resources>
  2. <Style x:Key="RundeKanter" TargetType="TextBox">
  3. <Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}"/>
  4. <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}"/>
  5. <Setter Property="Foreground" Value="{ThemeResource TextControlForeground}"/>
  6. <Setter Property="Background" Value="{ThemeResource TextControlBackground}"/>
  7. <Setter Property="BorderBrush" Value="{ThemeResource TextControlBorderBrush}"/>
  8. <Setter Property="SelectionHighlightColor" Value="{ThemeResource TextControlSelectionHighlightColor}"/>
  9. <Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}"/>
  10. <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
  11. <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
  12. <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto"/>
  13. <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto"/>
  14. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
  15. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
  16. <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
  17. <Setter Property="Padding" Value="{ThemeResource TextControlThemePadding}"/>
  18. <Setter Property="Template">
  19. <Setter.Value>
  20. <ControlTemplate TargetType="TextBox">
  21. <Grid CornerRadius="17" BorderThickness="2" BorderBrush="#66fcf1">
  22. <Grid.Resources>
  23. <Style x:Name="DeleteButtonStyle" TargetType="Button">
  24. <Setter Property="Template">
  25. <Setter.Value>
  26. <ControlTemplate TargetType="Button">
  27. <Grid x:Name="ButtonLayoutGrid" BorderBrush="{ThemeResource TextControlButtonBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{ThemeResource TextControlButtonBackground}">
  28. <VisualStateManager.VisualStateGroups>
  29. <VisualStateGroup x:Name="CommonStates">
  30. <VisualState x:Name="Normal"/>
  31. <VisualState x:Name="PointerOver">
  32. <Storyboard>
  33. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonLayoutGrid">
  34. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBackgroundPointerOver}"/>
  35. </ObjectAnimationUsingKeyFrames>
  36. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonLayoutGrid">
  37. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPointerOver}"/>
  38. </ObjectAnimationUsingKeyFrames>
  39. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
  40. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonForegroundPointerOver}"/>
  41. </ObjectAnimationUsingKeyFrames>
  42. </Storyboard>
  43. </VisualState>
  44. <VisualState x:Name="Pressed">
  45. <Storyboard>
  46. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonLayoutGrid">
  47. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBackgroundPressed}"/>
  48. </ObjectAnimationUsingKeyFrames>
  49. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonLayoutGrid">
  50. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonBorderBrushPressed}"/>
  51. </ObjectAnimationUsingKeyFrames>
  52. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
  53. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlButtonForegroundPressed}"/>
  54. </ObjectAnimationUsingKeyFrames>
  55. </Storyboard>
  56. </VisualState>
  57. <VisualState x:Name="Disabled">
  58. <Storyboard>
  59. <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ButtonLayoutGrid"/>
  60. </Storyboard>
  61. </VisualState>
  62. </VisualStateGroup>
  63. </VisualStateManager.VisualStateGroups>
  64. <TextBlock x:Name="GlyphElement" AutomationProperties.AccessibilityView="Raw" Foreground="{ThemeResource TextControlButtonForeground}" FontStyle="Normal" FontSize="12" FontFamily="{ThemeResource SymbolThemeFontFamily}" HorizontalAlignment="Center" Text="&#xE10A;" VerticalAlignment="Center"/>
  65. </Grid>
  66. </ControlTemplate>
  67. </Setter.Value>
  68. </Setter>
  69. </Style>
  70. </Grid.Resources>
  71. <Grid.ColumnDefinitions>
  72. <ColumnDefinition Width="*"/>
  73. <ColumnDefinition Width="Auto"/>
  74. </Grid.ColumnDefinitions>
  75. <Grid.RowDefinitions>
  76. <RowDefinition Height="Auto"/>
  77. <RowDefinition Height="*"/>
  78. </Grid.RowDefinitions>
  79. <VisualStateManager.VisualStateGroups>
  80. <VisualStateGroup x:Name="CommonStates">
  81. <VisualState x:Name="Disabled">
  82. <Storyboard>
  83. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="HeaderContentPresenter">
  84. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlHeaderForegroundDisabled}"/>
  85. </ObjectAnimationUsingKeyFrames>
  86. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BorderElement">
  87. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundDisabled}"/>
  88. </ObjectAnimationUsingKeyFrames>
  89. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
  90. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushDisabled}"/>
  91. </ObjectAnimationUsingKeyFrames>
  92. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
  93. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundDisabled}"/>
  94. </ObjectAnimationUsingKeyFrames>
  95. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="PlaceholderTextContentPresenter">
  96. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundDisabled}"/>
  97. </ObjectAnimationUsingKeyFrames>
  98. </Storyboard>
  99. </VisualState>
  100. <VisualState x:Name="Normal"/>
  101. <VisualState x:Name="PointerOver">
  102. <Storyboard>
  103. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
  104. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushPointerOver}"/>
  105. </ObjectAnimationUsingKeyFrames>
  106. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BorderElement">
  107. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundPointerOver}"/>
  108. </ObjectAnimationUsingKeyFrames>
  109. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="PlaceholderTextContentPresenter">
  110. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundPointerOver}"/>
  111. </ObjectAnimationUsingKeyFrames>
  112. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
  113. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundPointerOver}"/>
  114. </ObjectAnimationUsingKeyFrames>
  115. </Storyboard>
  116. </VisualState>
  117. <VisualState x:Name="Focused">
  118. <Storyboard>
  119. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="PlaceholderTextContentPresenter">
  120. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlPlaceholderForegroundFocused}"/>
  121. </ObjectAnimationUsingKeyFrames>
  122. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BorderElement">
  123. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundFocused}"/>
  124. </ObjectAnimationUsingKeyFrames>
  125. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
  126. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderBrushFocused}"/>
  127. </ObjectAnimationUsingKeyFrames>
  128. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
  129. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundFocused}"/>
  130. </ObjectAnimationUsingKeyFrames>
  131. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RequestedTheme" Storyboard.TargetName="ContentElement">
  132. <DiscreteObjectKeyFrame KeyTime="0" Value="Light"/>
  133. </ObjectAnimationUsingKeyFrames>
  134. </Storyboard>
  135. </VisualState>
  136. </VisualStateGroup>
  137. <VisualStateGroup x:Name="ButtonStates">
  138. <VisualState x:Name="ButtonVisible">
  139. <Storyboard>
  140. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeleteButton">
  141. <DiscreteObjectKeyFrame KeyTime="0">
  142. <DiscreteObjectKeyFrame.Value>
  143. <Visibility>Visible</Visibility>
  144. </DiscreteObjectKeyFrame.Value>
  145. </DiscreteObjectKeyFrame>
  146. </ObjectAnimationUsingKeyFrames>
  147. </Storyboard>
  148. </VisualState>
  149. <VisualState x:Name="ButtonCollapsed"/>
  150. </VisualStateGroup>
  151. </VisualStateManager.VisualStateGroups>
  152. <Border x:Name="BorderElement" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" Grid.Row="1" Grid.RowSpan="1" CornerRadius="15"/>
  153. <ContentPresenter x:Name="HeaderContentPresenter" Grid.ColumnSpan="2" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{ThemeResource TextControlHeaderForeground}" FontWeight="Normal" Margin="0,0,0,8" Grid.Row="0" Visibility="Collapsed" x:DeferLoadStrategy="Lazy"/>
  154. <ScrollViewer x:Name="ContentElement" AutomationProperties.AccessibilityView="Raw" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsTabStop="False" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="Disabled" BorderThickness="20"/>
  155. <ContentControl x:Name="PlaceholderTextContentPresenter" Grid.ColumnSpan="2" Content="{TemplateBinding PlaceholderText}" Foreground="{ThemeResource TextControlPlaceholderForeground}" IsHitTestVisible="False" IsTabStop="False" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.Row="1"/>
  156. <Button x:Name="DeleteButton" AutomationProperties.AccessibilityView="Raw" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="1" FontSize="{TemplateBinding FontSize}" IsTabStop="False" Margin="{ThemeResource HelperButtonThemePadding}" MinWidth="34" Grid.Row="1" Style="{StaticResource DeleteButtonStyle}" Visibility="Collapsed" VerticalAlignment="Stretch"/>
  157. </Grid>
  158. </ControlTemplate>
  159. </Setter.Value>
  160. </Setter>
  161. </Style>
  162. </TextBox.Resources>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement