add Poptip

This commit is contained in:
NaBian committed 2019-11-07 23:27:43 +08:00
1 parent 3192832e76
commit cf5c9c69a2
5 files changed
+242 -79

No files matched your search

+6 -2
View File
@@ -65,6 +65,10 @@ Step 4:enjoy coding
## Latest examples ## Latest examples
### Poptip
![Poptip](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Poptip.gif)
### Divider ### Divider
![Divider](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Divider.png) ![Divider](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Divider.png)
@@ -81,12 +85,12 @@ Step 4:enjoy coding
![FloatingBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/FloatingBlock.gif) ![FloatingBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/FloatingBlock.gif)
## History publication
### HoneycombPanel ### HoneycombPanel
![HoneycombPanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/HoneycombPanel.png) ![HoneycombPanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/HoneycombPanel.png)
## History publication
### RunningBlock ### RunningBlock
![RunningBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/RunningBlock.gif) ![RunningBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/RunningBlock.gif)
@@ -8,12 +8,21 @@
<UserControl.Resources> <UserControl.Resources>
<Style x:Key="Button4PoptipStyle" BasedOn="{StaticResource {x:Type Button}}" TargetType="Button"> <Style x:Key="Button4PoptipStyle" BasedOn="{StaticResource {x:Type Button}}" TargetType="Button">
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/> <Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
<Setter Property="Height" Value="50"/>
<Setter Property="MinWidth" Value="100"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Content" Value="{Binding Tag,RelativeSource={RelativeSource Self},Converter={StaticResource Int2StringConverter},ConverterParameter={x:Static langs:Lang.PoptipPositionStr}}"/>
</Style>
<Style x:Key="ToggleButton4PoptipStyle" BasedOn="{StaticResource {x:Type ToggleButton}}" TargetType="ToggleButton">
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
<Setter Property="Height" Value="50"/>
<Setter Property="MinWidth" Value="100"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Content" Value="{Binding Tag,RelativeSource={RelativeSource Self},Converter={StaticResource Int2StringConverter},ConverterParameter={x:Static langs:Lang.PoptipPositionStr}}"/> <Setter Property="Content" Value="{Binding Tag,RelativeSource={RelativeSource Self},Converter={StaticResource Int2StringConverter},ConverterParameter={x:Static langs:Lang.PoptipPositionStr}}"/>
</Style> </Style>
</UserControl.Resources> </UserControl.Resources>
<hc:TransitioningContentControl> <hc:TransitioningContentControl>
<Grid Margin="24,32"> <Grid Margin="24,320">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition/> <ColumnDefinition/>
@@ -25,24 +34,44 @@
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<UniformGrid Grid.Column="1" Columns="3"> <UniformGrid Grid.Column="1" Columns="3">
<Button Margin="8,0" Tag="0" Style="{StaticResource Button4PoptipStyle}"/> <Button Margin="8,0" Tag="0" Style="{StaticResource Button4PoptipStyle}">
<Button Margin="8,0" Tag="1" Style="{StaticResource Button4PoptipStyle}"/> <hc:Poptip.Instance>
<Button Margin="8,0" Tag="2" Style="{StaticResource Button4PoptipStyle}"/> <hc:Poptip Content="{x:Static langs:Lang.Text}" Placement="TopLeft"/>
</hc:Poptip.Instance>
</Button>
<Button Margin="8,0" Tag="1" Style="{StaticResource Button4PoptipStyle}">
<hc:Poptip.Instance>
<hc:Poptip Placement="Top">
<hc:Poptip.Content>
<Path Width="100" Height="100" Fill="#f06632" Data="{StaticResource LogoGeometry}"/>
</hc:Poptip.Content>
</hc:Poptip>
</hc:Poptip.Instance>
</Button>
<Button hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="TopRight" Margin="8,0" Tag="2" Style="{StaticResource Button4PoptipStyle}"/>
</UniformGrid> </UniformGrid>
<UniformGrid Grid.Row="1" Grid.Column="2" Rows="3"> <UniformGrid Grid.Row="1" Grid.Column="2" Rows="3">
<Button Margin="8,16" Tag="3" Style="{StaticResource Button4PoptipStyle}"/> <ToggleButton hc:Poptip.HitMode="None" hc:Poptip.IsOpen="{Binding IsChecked,RelativeSource={RelativeSource Self}}" hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="RightTop" Margin="8,16" Tag="3" Style="{StaticResource ToggleButton4PoptipStyle}"/>
<Button Margin="8,16" Tag="4" Style="{StaticResource Button4PoptipStyle}"/> <ToggleButton Margin="8,16" Tag="4" Style="{StaticResource ToggleButton4PoptipStyle}">
<Button Margin="8,16" Tag="5" Style="{StaticResource Button4PoptipStyle}"/> <hc:Poptip.Instance>
<hc:Poptip Background="Transparent" Padding="0" BorderThickness="0" HitMode="None" Placement="Right" IsOpen="{Binding Target.IsChecked,RelativeSource={RelativeSource Self}}">
<hc:Poptip.Content>
<Path Width="100" Height="100" Fill="#f06632" Data="{StaticResource LogoGeometry}"/>
</hc:Poptip.Content>
</hc:Poptip>
</hc:Poptip.Instance>
</ToggleButton>
<ToggleButton hc:Poptip.HitMode="None" hc:Poptip.IsOpen="{Binding IsChecked,RelativeSource={RelativeSource Self}}" hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="RightBottom" Margin="8,16" Tag="5" Style="{StaticResource ToggleButton4PoptipStyle}"/>
</UniformGrid> </UniformGrid>
<UniformGrid Grid.Column="1" Grid.Row="2" Columns="3"> <UniformGrid Grid.Column="1" Grid.Row="2" Columns="3">
<Button Margin="8,0" Tag="8" Style="{StaticResource Button4PoptipStyle}"/> <Button hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="BottomLeft" Margin="8,0" Tag="8" Style="{StaticResource Button4PoptipStyle}"/>
<Button Margin="8,0" Tag="7" Style="{StaticResource Button4PoptipStyle}"/> <Button hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="Bottom" Margin="8,0" Tag="7" Style="{StaticResource Button4PoptipStyle}"/>
<Button Margin="8,0" Tag="6" Style="{StaticResource Button4PoptipStyle}"/> <Button hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="BottomRight" Margin="8,0" Tag="6" Style="{StaticResource Button4PoptipStyle}"/>
</UniformGrid> </UniformGrid>
<UniformGrid Grid.Row="1" Grid.Column="0" Rows="3"> <UniformGrid Grid.Row="1" Grid.Column="0" Rows="3">
<Button Margin="8,16" Tag="11" Style="{StaticResource Button4PoptipStyle}"/> <Button hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="LeftTop" hc:Poptip.HitMode="Focus" Margin="8,16" Tag="11" Style="{StaticResource Button4PoptipStyle}"/>
<Button Margin="8,16" Tag="10" Style="{StaticResource Button4PoptipStyle}"/> <Button hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="Left" hc:Poptip.HitMode="Focus" Margin="8,16" Tag="10" Style="{StaticResource Button4PoptipStyle}"/>
<Button Margin="8,16" Tag="9" Style="{StaticResource Button4PoptipStyle}"/> <Button hc:Poptip.Content="{x:Static langs:Lang.Text}" hc:Poptip.Placement="LeftBottom" hc:Poptip.HitMode="Focus" Margin="8,16" Tag="9" Style="{StaticResource Button4PoptipStyle}"/>
</UniformGrid> </UniformGrid>
</Grid> </Grid>
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
@@ -1,21 +1,18 @@
using System.ComponentModel; using System;
using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input; using System.Windows.Input;
using HandyControl.Data; using HandyControl.Data;
using HandyControl.Data.Enum; using HandyControl.Data.Enum;
using HandyControl.Interactivity;
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
public class Poptip : Control public class Poptip : Control
{ {
private Popup _popup; private readonly Popup _popup;
private AdornerContainer _adorner;
private UIElement _elementTarget; private UIElement _elementTarget;
@@ -27,24 +24,51 @@ namespace HandyControl.Controls
Child = this Child = this
}; };
_popup.SetBinding(Popup.IsOpenProperty, new Binding(IsOpenProperty.Name) _popup.SetBinding(DataContextProperty, new Binding(DataContextProperty.Name) {Source = this});
{
Source = this,
Mode = BindingMode.TwoWay
});
} }
public static readonly DependencyProperty HitModeProperty = DependencyProperty.Register( public static readonly DependencyProperty HitModeProperty = DependencyProperty.RegisterAttached(
"HitMode", typeof(HitMode), typeof(Poptip), new PropertyMetadata(HitMode.Hover)); "HitMode", typeof(HitMode), typeof(Poptip), new PropertyMetadata(HitMode.Hover));
public static void SetHitMode(DependencyObject element, HitMode value)
=> element.SetValue(HitModeProperty, value);
public static HitMode GetHitMode(DependencyObject element)
=> (HitMode) element.GetValue(HitModeProperty);
public HitMode HitMode public HitMode HitMode
{ {
get => (HitMode)GetValue(HitModeProperty); get => (HitMode)GetValue(HitModeProperty);
set => SetValue(HitModeProperty, value); set => SetValue(HitModeProperty, value);
} }
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register( private static readonly DependencyProperty IsInstanceProperty = DependencyProperty.RegisterAttached(
"Content", typeof(object), typeof(Poptip), new PropertyMetadata(default(object))); "IsInstance", typeof(bool), typeof(Poptip), new PropertyMetadata(ValueBoxes.TrueBox));
private static void SetIsInstance(DependencyObject element, bool value)
=> element.SetValue(IsInstanceProperty, value);
private static bool GetIsInstance(DependencyObject element)
=> (bool) element.GetValue(IsInstanceProperty);
public static readonly DependencyProperty ContentProperty = DependencyProperty.RegisterAttached(
"Content", typeof(object), typeof(Poptip), new PropertyMetadata(default, OnContentChanged));
private static void OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is Poptip) return;
if (GetInstance(d) == null)
{
SetInstance(d, Default);
SetIsInstance(d, false);
}
}
public static void SetContent(DependencyObject element, object value)
=> element.SetValue(ContentProperty, value);
public static object GetContent(DependencyObject element)
=> element.GetValue(ContentProperty);
public object Content public object Content
{ {
@@ -79,35 +103,56 @@ namespace HandyControl.Controls
set => SetValue(ContentTemplateSelectorProperty, value); set => SetValue(ContentTemplateSelectorProperty, value);
} }
public static readonly DependencyProperty HorizontalOffsetProperty = DependencyProperty.Register( public static readonly DependencyProperty OffsetProperty = DependencyProperty.RegisterAttached(
"HorizontalOffset", typeof(double), typeof(Poptip), new PropertyMetadata(ValueBoxes.Double0Box)); "Offset", typeof(double), typeof(Poptip), new PropertyMetadata(6.0));
public double HorizontalOffset public static void SetOffset(DependencyObject element, double value)
=> element.SetValue(OffsetProperty, value);
public static double GetOffset(DependencyObject element)
=> (double) element.GetValue(OffsetProperty);
public double Offset
{ {
get => (double)GetValue(HorizontalOffsetProperty); get => (double)GetValue(OffsetProperty);
set => SetValue(HorizontalOffsetProperty, value); set => SetValue(OffsetProperty, value);
} }
public static readonly DependencyProperty VerticalOffsetProperty = DependencyProperty.Register( public static readonly DependencyProperty PlacementProperty = DependencyProperty.RegisterAttached(
"VerticalOffset", typeof(double), typeof(Poptip), new PropertyMetadata(ValueBoxes.Double0Box));
public double VerticalOffset
{
get => (double)GetValue(VerticalOffsetProperty);
set => SetValue(VerticalOffsetProperty, value);
}
public static readonly DependencyProperty PlacementProperty = DependencyProperty.Register(
"Placement", typeof(TipPlacement), typeof(Poptip), new PropertyMetadata(TipPlacement.Top)); "Placement", typeof(TipPlacement), typeof(Poptip), new PropertyMetadata(TipPlacement.Top));
public static void SetPlacement(DependencyObject element, TipPlacement value)
=> element.SetValue(PlacementProperty, value);
public static TipPlacement GetPlacement(DependencyObject element)
=> (TipPlacement) element.GetValue(PlacementProperty);
public TipPlacement Placement public TipPlacement Placement
{ {
get => (TipPlacement) GetValue(PlacementProperty); get => (TipPlacement)GetValue(PlacementProperty);
set => SetValue(PlacementProperty, value); set => SetValue(PlacementProperty, value);
} }
public static readonly DependencyProperty IsOpenProperty = DependencyProperty.Register( public static readonly DependencyProperty IsOpenProperty = DependencyProperty.RegisterAttached(
"IsOpen", typeof(bool), typeof(Poptip), new PropertyMetadata(default(bool))); "IsOpen", typeof(bool), typeof(Poptip), new PropertyMetadata(ValueBoxes.FalseBox, OnIsOpenChanged));
private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is Poptip poptip)
{
poptip.SwitchPoptip((bool) e.NewValue);
}
else
{
GetInstance(d)?.SwitchPoptip((bool)e.NewValue);
}
}
public static void SetIsOpen(DependencyObject element, bool value)
=> element.SetValue(IsOpenProperty, value);
public static bool GetIsOpen(DependencyObject element)
=> (bool) element.GetValue(IsOpenProperty);
public bool IsOpen public bool IsOpen
{ {
@@ -125,6 +170,7 @@ namespace HandyControl.Controls
ctl.UpdateTarget((UIElement)e.NewValue, true); ctl.UpdateTarget((UIElement)e.NewValue, true);
} }
[Bindable(true), Category("Layout")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public UIElement Target public UIElement Target
{ {
@@ -133,9 +179,9 @@ namespace HandyControl.Controls
} }
public static readonly DependencyProperty InstanceProperty = DependencyProperty.RegisterAttached( public static readonly DependencyProperty InstanceProperty = DependencyProperty.RegisterAttached(
"Instance", typeof(Poptip), typeof(Poptip), new PropertyMetadata(default(Poptip), OnMagnifierChanged)); "Instance", typeof(Poptip), typeof(Poptip), new PropertyMetadata(default(Poptip), OnPoptipChanged));
private static void OnMagnifierChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnPoptipChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
if (!(d is UIElement target)) return; if (!(d is UIElement target)) return;
var poptip = (Poptip)e.NewValue; var poptip = (Poptip)e.NewValue;
@@ -175,61 +221,141 @@ namespace HandyControl.Controls
private void UpdateLocation() private void UpdateLocation()
{ {
var targetPoint = Mouse.GetPosition(Target); var targetWidth = Target.RenderSize.Width;
} var targetHeight = Target.RenderSize.Height;
private void ShowPoptip() Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
{ var size = DesiredSize;
if (_adorner == null)
var width = size.Width;
var height = size.Height;
var offsetX = .0;
var offsetY = .0;
var poptip = GetInstance(Target);
var popupPlacement = poptip.Placement;
var popupOffset = poptip.Offset;
PlacementMode placementMode;
switch (popupPlacement)
{ {
var layer = AdornerLayer.GetAdornerLayer(Target); case TipPlacement.LeftTop:
if (layer == null) return; offsetX = -popupOffset;
_adorner = new AdornerContainer(layer) placementMode = PlacementMode.Left;
{ break;
Child = this case TipPlacement.Left:
}; offsetX = -popupOffset;
layer.Add(_adorner); offsetY = (targetHeight - height) / 2;
placementMode = PlacementMode.Left;
break;
case TipPlacement.LeftBottom:
offsetX = -popupOffset;
offsetY = targetHeight - height;
placementMode = PlacementMode.Left;
break;
case TipPlacement.TopLeft:
offsetY = -popupOffset;
placementMode = PlacementMode.Top;
break;
case TipPlacement.Top:
offsetX = (targetWidth - width) / 2;
offsetY = -popupOffset;
placementMode = PlacementMode.Top;
break;
case TipPlacement.TopRight:
offsetX = targetWidth - width;
offsetY = -popupOffset;
placementMode = PlacementMode.Top;
break;
case TipPlacement.RightTop:
offsetX = popupOffset;
placementMode = PlacementMode.Right;
break;
case TipPlacement.Right:
offsetX = popupOffset;
offsetY = (targetHeight - height) / 2;
placementMode = PlacementMode.Right;
break;
case TipPlacement.RightBottom:
offsetX = popupOffset;
offsetY = targetHeight - height;
placementMode = PlacementMode.Right;
break;
case TipPlacement.BottomLeft:
offsetY = popupOffset;
placementMode = PlacementMode.Bottom;
break;
case TipPlacement.Bottom:
offsetX = (targetWidth - width) / 2;
offsetY = popupOffset;
placementMode = PlacementMode.Bottom;
break;
case TipPlacement.BottomRight:
offsetX = targetWidth - width;
offsetY = popupOffset;
placementMode = PlacementMode.Bottom;
break;
default:
throw new ArgumentOutOfRangeException();
} }
UpdateLocation(); _popup.HorizontalOffset = offsetX;
SetCurrentValue(IsOpenProperty, true); _popup.VerticalOffset = offsetY;
_popup.Placement = placementMode;
} }
private void ClosePoptip() private void SwitchPoptip(bool isShow)
{ {
var layer = AdornerLayer.GetAdornerLayer(Target); if (isShow)
if (layer == null) return; {
layer.Remove(_adorner); if (!GetIsInstance(Target))
_adorner.Child = null; {
_adorner = null; SetCurrentValue(ContentProperty, GetContent(Target));
SetCurrentValue(PlacementProperty, GetPlacement(Target));
SetCurrentValue(HitModeProperty, GetHitMode(Target));
SetCurrentValue(OffsetProperty, GetOffset(Target));
SetCurrentValue(IsOpenProperty, GetIsOpen(Target));
}
_popup.PlacementTarget = Target;
UpdateLocation();
}
_popup.IsOpen = isShow;
Target.SetCurrentValue(IsOpenProperty, isShow);
} }
private void Element_MouseEnter(object sender, MouseEventArgs e) private void Element_MouseEnter(object sender, MouseEventArgs e)
{ {
if (HitMode != HitMode.Hover) return; var hitMode = GetIsInstance(Target) ? HitMode : GetHitMode(Target);
if (hitMode != HitMode.Hover || hitMode == HitMode.None) return;
ShowPoptip(); SwitchPoptip(true);
} }
private void Element_MouseLeave(object sender, MouseEventArgs e) private void Element_MouseLeave(object sender, MouseEventArgs e)
{ {
if (HitMode != HitMode.Hover) return; var hitMode = GetIsInstance(Target) ? HitMode : GetHitMode(Target);
if (hitMode != HitMode.Hover || hitMode == HitMode.None) return;
ClosePoptip(); SwitchPoptip(false);
} }
private void Element_GotFocus(object sender, RoutedEventArgs e) private void Element_GotFocus(object sender, RoutedEventArgs e)
{ {
if (HitMode != HitMode.Focus) return; var hitMode = GetIsInstance(Target) ? HitMode : GetHitMode(Target);
if (hitMode != HitMode.Focus || hitMode == HitMode.None) return;
ShowPoptip(); SwitchPoptip(true);
} }
private void Element_LostFocus(object sender, RoutedEventArgs e) private void Element_LostFocus(object sender, RoutedEventArgs e)
{ {
if (HitMode != HitMode.Focus) return; var hitMode = GetIsInstance(Target) ? HitMode : GetHitMode(Target);
if (hitMode != HitMode.Focus || hitMode == HitMode.None) return;
ClosePoptip(); SwitchPoptip(false);
} }
} }
} }
@@ -4,6 +4,7 @@
{ {
Click, Click,
Hover, Hover,
Focus Focus,
None
} }
} }
@@ -10,13 +10,16 @@
<Setter Property="IsHitTestVisible" Value="False" /> <Setter Property="IsHitTestVisible" Value="False" />
<Setter Property="HorizontalAlignment" Value="Left"/> <Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/> <Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Offset" Value="6"/>
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/> <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="controls:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/> <Setter Property="controls:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="controls:Poptip"> <ControlTemplate TargetType="controls:Poptip">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
<ContentPresenter Margin="{TemplateBinding Padding}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/> <ContentPresenter Margin="{TemplateBinding Padding}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
</Border> </Border>
</ControlTemplate> </ControlTemplate>