Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Just wanted to post the final markup for this, in case anybody ever is searching for the same thing.</p> <pre><code>&lt;Style TargetType="{x:Type local:TimePicker}"&gt; &lt;Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Height}" /&gt; &lt;Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Width}" /&gt; &lt;Setter Property="HorizontalAlignment" Value="Center" /&gt; &lt;Setter Property="VerticalAlignment" Value="Center" /&gt; &lt;Setter Property="FontSize" Value="14" /&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate&gt; &lt;Border Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="1"&gt; &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="{TemplateBinding VerticalAlignment}"&gt; &lt;ToggleButton VerticalAlignment="{TemplateBinding VerticalAlignment}" Margin="0" BorderBrush="Transparent" BorderThickness="0" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Hour}"&gt; &lt;ToggleButton.Template&gt; &lt;ControlTemplate TargetType="{x:Type ToggleButton}"&gt; &lt;Aero:ButtonChrome SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" RenderDefaulted="False"&gt; &lt;Grid&gt; &lt;ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/&gt; &lt;ContentPresenter x:Name="ContentPart" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" TextBlock.Foreground="#FF605c" Visibility="Collapsed"&gt; &lt;ContentPresenter.Effect&gt; &lt;BlurEffect /&gt; &lt;/ContentPresenter.Effect&gt; &lt;/ContentPresenter&gt; &lt;/Grid&gt; &lt;/Aero:ButtonChrome&gt; &lt;ControlTemplate.Triggers&gt; &lt;Trigger Property="IsMouseOver" Value="True"&gt; &lt;Setter TargetName="ContentPart" Property="Visibility" Value="Visible" /&gt; &lt;/Trigger&gt; &lt;Trigger Property="IsChecked" Value="True"&gt; &lt;Setter Property="FontWeight" Value="Bold" /&gt; &lt;Setter TargetName="ContentPart" Property="Visibility" Value="Visible" /&gt; &lt;/Trigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; &lt;/ToggleButton.Template&gt; &lt;ToggleButton.Style&gt; &lt;Style TargetType="{x:Type ToggleButton}"&gt; &lt;Setter Property="Background" Value="Transparent" /&gt; &lt;/Style&gt; &lt;/ToggleButton.Style&gt; &lt;/ToggleButton&gt; &lt;Label HorizontalContentAlignment="{TemplateBinding HorizontalAlignment}" VerticalContentAlignment="{TemplateBinding VerticalAlignment}" Content=":"/&gt; &lt;ToggleButton VerticalAlignment="{TemplateBinding VerticalAlignment}" Margin="0" Background="{TemplateBinding Background}" BorderBrush="Transparent" Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Minute}" /&gt; &lt;/StackPanel&gt; &lt;/Border&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload