|
4 | 4 | xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
|
5 | 5 | xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters">
|
6 | 6 |
|
| 7 | + <ResourceDictionary.MergedDictionaries> |
| 8 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" /> |
| 9 | + <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToolTip.xaml" /> |
| 10 | + </ResourceDictionary.MergedDictionaries> |
| 11 | + |
7 | 12 | <Style TargetType="{x:Type wpf:PopupBox}" x:Key="MaterialDesignPopupBox">
|
8 | 13 | <Setter Property="ToggleContent">
|
9 | 14 | <Setter.Value>
|
|
64 | 69 | <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/>
|
65 | 70 | <Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidForegroundBrush}"/>
|
66 | 71 | <Setter Property="PlacementMode" Value="TopAndAlignCentres" />
|
| 72 | + <Setter Property="ToolTipService.Placement" Value="Left" /> |
67 | 73 | <Setter Property="HorizontalAlignment" Value="Left" />
|
68 | 74 | <Setter Property="BorderThickness" Value="1"/>
|
69 | 75 | <Setter Property="Cursor" Value="Hand"/>
|
|
167 | 173 | HorizontalAlignment="Stretch"
|
168 | 174 | />
|
169 | 175 | <controlz:PopupEx x:Name="PART_Popup" IsOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPopupOpen, Mode=TwoWay}"
|
170 |
| - CustomPopupPlacementCallback="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PopupPlacementMethod}" |
171 |
| - HorizontalOffset="5" |
172 |
| - VerticalOffset="5" |
| 176 | + CustomPopupPlacementCallback="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PopupPlacementMethod}" |
173 | 177 | PlacementTarget="{Binding ElementName=PART_Toggle}"
|
174 | 178 | Placement="Custom"
|
175 | 179 | PopupAnimation="Fade"
|
176 | 180 | AllowsTransparency="True">
|
177 |
| - <wpf:Card Content="{TemplateBinding PopupContent}" ContentTemplate="{TemplateBinding PopupContentTemplate}" |
| 181 | + <Border Background="Transparent"> |
| 182 | + <ContentControl Content="{TemplateBinding PopupContent}" ContentTemplate="{TemplateBinding PopupContentTemplate}" |
178 | 183 | Margin="5" Padding="8">
|
179 |
| - <wpf:Card.Resources> |
180 |
| - <ResourceDictionary> |
181 |
| - <Style TargetType="{x:Type Button}"> |
182 |
| - <Style.Setters> |
183 |
| - <Setter Property="Background" Value="{DynamicResource MaterialDesignPrimaryLightBrush}" /> |
184 |
| - <Setter Property="Foreground" Value="{DynamicResource MaterialDesignPrimaryLightForegroundBrush}" /> |
185 |
| - <Setter Property="ToolTipService.IsEnabled" Value="False" /> |
186 |
| - <Setter Property="Template"> |
187 |
| - <Setter.Value> |
188 |
| - <ControlTemplate TargetType="{x:Type Button}"> |
189 |
| - <StackPanel Orientation="Horizontal" Margin="8"> |
190 |
| - <Grid Clip="{Binding ElementName=UncheckedEllipse, Path=RenderedGeometry}" ClipToBounds="True" Background="{TemplateBinding Background}" |
191 |
| - Width="30" Height="30"> |
192 |
| - <Ellipse Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" x:Name="UncheckedEllipse" /> |
193 |
| - <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> |
194 |
| - </Grid> |
195 |
| - <Border Background="{DynamicResource MaterialDesignToolTipBackground}" Margin="8 0 0 0" Padding="8"> |
196 |
| - <ContentControl Foreground="{DynamicResource MaterialDesignPaper}" Content="{TemplateBinding ToolTip}" VerticalAlignment="Center" /> |
197 |
| - </Border> |
198 |
| - </StackPanel> |
199 |
| - </ControlTemplate> |
200 |
| - </Setter.Value> |
201 |
| - </Setter> |
202 |
| - </Style.Setters> |
203 |
| - </Style> |
204 |
| - </ResourceDictionary> |
205 |
| - </wpf:Card.Resources> |
206 |
| - <wpf:Card.Background> |
207 |
| - <SolidColorBrush Color="White" Opacity=".6" /> |
208 |
| - </wpf:Card.Background> |
209 |
| - </wpf:Card> |
| 184 | + <ContentControl.Resources> |
| 185 | + <ResourceDictionary> |
| 186 | + <Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource MaterialDesignToolTip}"> |
| 187 | + <Style.Setters> |
| 188 | + <Setter Property="Margin" Value="16 4 16 4" /> |
| 189 | + </Style.Setters> |
| 190 | + </Style> |
| 191 | + <Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignFloatingActionMiniLightButton}"> |
| 192 | + <Style.Setters> |
| 193 | + <Setter Property="ToolTipService.Placement" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=wpf:PopupBox}, Path=(ToolTipService.Placement)}"/> |
| 194 | + <Setter Property="Margin" Value="4" /> |
| 195 | + </Style.Setters> |
| 196 | + </Style> |
| 197 | + </ResourceDictionary> |
| 198 | + </ContentControl.Resources> |
| 199 | + </ContentControl> |
| 200 | + </Border> |
210 | 201 | </controlz:PopupEx>
|
211 | 202 | </Grid>
|
212 | 203 | </ControlTemplate>
|
|
0 commit comments