feat: remove item template dependency
This commit is contained in:
@@ -17,8 +17,8 @@
|
|||||||
<ControlTemplate TargetType="u:TagInput">
|
<ControlTemplate TargetType="u:TagInput">
|
||||||
<Border
|
<Border
|
||||||
MinHeight="30"
|
MinHeight="30"
|
||||||
Padding="4"
|
Padding="8,4"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Stretch"
|
||||||
Background="{DynamicResource SemiColorFill0}"
|
Background="{DynamicResource SemiColorFill0}"
|
||||||
CornerRadius="3">
|
CornerRadius="3">
|
||||||
<Panel HorizontalAlignment="Stretch">
|
<Panel HorizontalAlignment="Stretch">
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="TextBox">
|
<ControlTemplate TargetType="TextBox">
|
||||||
<Border>
|
<Border Padding="0,4">
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
Width="{Binding $parent[TextBox].Bounds.Width}"
|
Width="{Binding $parent[TextBox].Bounds.Width}"
|
||||||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class TagInput: TemplatedControl
|
|||||||
|
|
||||||
public void Close(object o)
|
public void Close(object o)
|
||||||
{
|
{
|
||||||
if (o is ClosableTag t)
|
if (o is Control t)
|
||||||
{
|
{
|
||||||
var presenter = t.Parent as ContentPresenter;
|
var presenter = t.Parent as ContentPresenter;
|
||||||
if (presenter != null)
|
if (presenter != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user