BorderChildClipConverter Class
A multi-value converter that can be applied to a Border.Child
element's Clip
property
to ensure the child element is properly clipped based on the Border.CornerRadius
value.
public class BorderChildClipConverter : IMultiValueConverter
- Inheritance:
- object object
- Implements:
- IMultiValueConverter
Remarks
This converter is useful when the Border.Child
element or another element within its hierarchy
has a background that renders into the portion of the parent Border
that is normally rounded off by the corner radius.
Examples
<Border BorderBrush="Black" BorderThickness="1" CornerRadius="8">
<Grid actipro:BorderChildClipConverter.ClipToContainingBorder="True">
<!-- Grid child controls here -->
</Grid>
</Border>
Constructors
BorderChildClipConverter()
Initializes an instance of the class.
public BorderChildClipConverter()
Methods
Convert(IList<object?>, Type, object?, CultureInfo)
Converts multi-binding inputs to a final value.
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
Parameter | Type | Description |
---|---|---|
values | IList<object> | The values to convert. |
targetType | Type | The type of the target. |
parameter | object | A user-defined parameter. |
culture | CultureInfo | The culture to use. |
Returns
- object:
The converted value.
Remarks
This method should not throw exceptions. If the value is not convertible, return Avalonia.AvaloniaProperty.UnsetValue. Any exception thrown will be treated as an application exception.
GetClipToContainingBorder(Control)
The get accessor for the attached ClipToContainingBorderProperty.
public static bool GetClipToContainingBorder(Control obj)
Parameter | Type | Description |
---|---|---|
obj | Control | The object to examine. |
Returns
- bool:
The value of the attached property.
SetClipToContainingBorder(Control, bool)
The set accessor for the attached ClipToContainingBorderProperty.
public static void SetClipToContainingBorder(Control obj, bool value)
Parameter | Type | Description |
---|---|---|
obj | Control | The object to update. |
value | bool | The value to set. |
Fields
ClipToContainingBorderProperty
Defines the ClipToContainingBorder
attached property.
public static readonly AttachedProperty<bool> ClipToContainingBorderProperty
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()