This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathDropDownButton.xaml
More file actions
41 lines (41 loc) · 2.25 KB
/
Copy pathDropDownButton.xaml
File metadata and controls
41 lines (41 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GitHub.UI">
<Style TargetType="local:DropDownButton">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:DropDownButton">
<StackPanel>
<Button Name="PART_Button"
Background="{TemplateBinding Background}"
Content="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}"
Margin="{TemplateBinding Padding}">
<Button.Template>
<ControlTemplate TargetType="Button">
<DockPanel Background="{TemplateBinding Background}">
<Polygon DockPanel.Dock="Right"
Margin="4,0"
Fill="{TemplateBinding Foreground}"
Points="0,0 8,0 4,4 0,0"
VerticalAlignment="Center"/>
<ContentPresenter/>
</DockPanel>
</ControlTemplate>
</Button.Template>
</Button>
<Popup Name="PART_Popup"
IsOpen="{TemplateBinding IsOpen}"
Placement="Bottom"
PlacementTarget="{Binding ElementName=PART_Button}"
StaysOpen="False"
MinWidth="{Binding ActualWidth,ElementName=PART_Button}">
<ContentControl Content="{TemplateBinding DropDownContent}"/>
</Popup>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>