teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

tuiki

2015/11/27 04:37

投稿

Tak1wa
Tak1wa

スコア4791

answer CHANGED
@@ -25,4 +25,17 @@
25
25
  ```
26
26
 
27
27
  ボタンの中はxxxContentAlignmentで調整できます。(上の例では左上に寄せました)
28
- ListBoxItemのボーダーサイズなどを調整してボタン同士をくっつけてみました。これについては他に最適解があるかも。
28
+ ListBoxItemのボーダーサイズなどを調整してボタン同士をくっつけてみました。これについては他に最適解があるかも。
29
+
30
+ ---
31
+
32
+ ```XML
33
+ <ControlTemplate TargetType="{x:Type Button}">
34
+ <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
35
+ <!--<StackPanel Orientation="Horizontal">-->
36
+ <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
37
+ <!--</StackPanel>-->
38
+ </Border>
39
+ ```
40
+
41
+ ButtonListStyleがStackPanelで詰められているからですね。