Skip to content

Commit cb50b48

Browse files
committed
multi float - fix tooltip display
1 parent 9c8d873 commit cb50b48

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

MainDemo.Wpf/Buttons.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@
117117
<Button ToolTip="Three">3</Button>
118118
</StackPanel>
119119
</materialDesign:PopupBox>
120+
<materialDesign:PopupBox Style="{StaticResource MaterialDesignMultiFloatingActionAccentPopupBox}"
121+
PlacementMode="BottomAndAlignCentres"
122+
Margin="48 0 0 0"
123+
ToolTip="PopupBox, Style MaterialDesignMultiFloatingActionAccentPopupBox">
124+
<StackPanel>
125+
<Button ToolTip="One">1</Button>
126+
<Button ToolTip="Two">2</Button>
127+
<Button ToolTip="Three">3</Button>
128+
</StackPanel>
129+
</materialDesign:PopupBox>
120130
</StackPanel>
121131
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0 16 0 0">
122132
<Button Style="{StaticResource MaterialDesignRaisedLightButton}" Margin="0 0 8 0" Width="100"

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.PopupBox.xaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<Setter Property="PlacementMode" Value="TopAndAlignCentres" />
7272
<Setter Property="PopupMode" Value="MouseOverEager" />
7373
<Setter Property="ToolTipService.Placement" Value="Left" />
74+
<Setter Property="ToolTipService.IsEnabled" Value="False" />
7475
<Setter Property="HorizontalAlignment" Value="Left" />
7576
<Setter Property="BorderThickness" Value="1"/>
7677
<Setter Property="Cursor" Value="Hand"/>
@@ -201,6 +202,8 @@
201202
Foreground="{TemplateBinding Foreground}"
202203
VerticalAlignment="Stretch"
203204
HorizontalAlignment="Stretch"
205+
ToolTip="{TemplateBinding ToolTip}"
206+
ToolTipService.Placement="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=(ToolTipService.Placement)}"
204207
/>
205208
<controlz:PopupEx x:Name="PART_Popup"
206209
IsOpen="False"
@@ -267,4 +270,58 @@
267270
</Setter>
268271
</Style>
269272

273+
<Style TargetType="{x:Type wpf:PopupBox}"
274+
x:Key="MaterialDesignMultiFloatingActionLightPopupBox"
275+
BasedOn="{StaticResource MaterialDesignMultiFloatingActionPopupBox}">
276+
<Setter Property="Background" Value="{DynamicResource PrimaryHueLightBrush}"/>
277+
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueLightBrush}"/>
278+
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueLightForegroundBrush}"/>
279+
<Setter Property="ToggleContent">
280+
<Setter.Value>
281+
<Viewbox Width="24" Height="24">
282+
<Canvas Width="24" Height="24">
283+
<Path Data="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
284+
Fill="{DynamicResource PrimaryHueLightForegroundBrush}" />
285+
</Canvas>
286+
</Viewbox>
287+
</Setter.Value>
288+
</Setter>
289+
</Style>
290+
291+
<Style TargetType="{x:Type wpf:PopupBox}"
292+
x:Key="MaterialDesignMultiFloatingActionDarkPopupBox"
293+
BasedOn="{StaticResource MaterialDesignMultiFloatingActionPopupBox}">
294+
<Setter Property="Background" Value="{DynamicResource PrimaryHueDarkBrush}"/>
295+
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueDarkBrush}"/>
296+
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueDarkForegroundBrush}"/>
297+
<Setter Property="ToggleContent">
298+
<Setter.Value>
299+
<Viewbox Width="24" Height="24">
300+
<Canvas Width="24" Height="24">
301+
<Path Data="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
302+
Fill="{DynamicResource PrimaryHueDarkForegroundBrush}" />
303+
</Canvas>
304+
</Viewbox>
305+
</Setter.Value>
306+
</Setter>
307+
</Style>
308+
309+
<Style TargetType="{x:Type wpf:PopupBox}"
310+
x:Key="MaterialDesignMultiFloatingActionAccentPopupBox"
311+
BasedOn="{StaticResource MaterialDesignMultiFloatingActionPopupBox}">
312+
<Setter Property="Background" Value="{DynamicResource SecondaryAccentBrush}"/>
313+
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryAccentBrush}"/>
314+
<Setter Property="Foreground" Value="{DynamicResource SecondaryAccentForegroundBrush}"/>
315+
<Setter Property="ToggleContent">
316+
<Setter.Value>
317+
<Viewbox Width="24" Height="24">
318+
<Canvas Width="24" Height="24">
319+
<Path Data="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
320+
Fill="{DynamicResource SecondaryAccentForegroundBrush}" />
321+
</Canvas>
322+
</Viewbox>
323+
</Setter.Value>
324+
</Setter>
325+
</Style>
326+
270327
</ResourceDictionary>

0 commit comments

Comments
 (0)