Struct MagnetAnchor
- Namespace
- Nalu
- Assembly
- Nalu.Maui.Layouts.dll
An anchor of a MagnetView side to a pole of another node (or of the parent stage).
[TypeConverter(typeof(MagnetAnchorTypeConverter))]
public readonly record struct MagnetAnchor : IEquatable<MagnetAnchor>
- Implements
- Inherited Members
Remarks
XAML syntax: "target.Pole", "target.Pole,margin" or "target.Pole,margin,gone:goneMargin",
e.g. "parent.Left", "avatar.Right,12", "avatar.Right,12,gone:0".
Constructors
MagnetAnchor(string, MagnetPole, double, double?)
An anchor of a MagnetView side to a pole of another node (or of the parent stage).
public MagnetAnchor(string Target, MagnetPole Pole, double Margin = 0, double? GoneMargin = null)
Parameters
TargetstringPoleMagnetPoleThe target pole.
MargindoubleThe margin between the anchored side and the target pole.
GoneMargindouble?The margin used when the target view is collapsed (defaults to
Margin).
Remarks
XAML syntax: "target.Pole", "target.Pole,margin" or "target.Pole,margin,gone:goneMargin",
e.g. "parent.Left", "avatar.Right,12", "avatar.Right,12,gone:0".
Fields
Parent
The reserved identifier of the stage (the Magnet layout content area).
public const string Parent = "parent"
Field Value
Properties
EffectiveGoneMargin
Gets the effective margin used when the target is collapsed.
public double EffectiveGoneMargin { get; }
Property Value
GoneMargin
The margin used when the target view is collapsed (defaults to Margin).
public double? GoneMargin { get; init; }
Property Value
IsHorizontal
Gets whether the pole belongs to the horizontal axis.
public bool IsHorizontal { get; }
Property Value
Margin
The margin between the anchored side and the target pole.
public double Margin { get; init; }
Property Value
Pole
The target pole.
public MagnetPole Pole { get; init; }
Property Value
Target
public string Target { get; init; }
Property Value
TargetsParent
Gets whether this anchor targets the stage.
public bool TargetsParent { get; }
Property Value
Methods
Diff(MagnetAnchor?, MagnetAnchor?)
Classifies the difference between two optional anchors.
public static MagnetChange Diff(MagnetAnchor? a, MagnetAnchor? b)
Parameters
aMagnetAnchor?bMagnetAnchor?
Returns
DiffWith(in MagnetAnchor)
Classifies the difference between this anchor and other.
public MagnetChange DiffWith(in MagnetAnchor other)
Parameters
otherMagnetAnchor
Returns
Parse(string)
Parses the XAML representation of an anchor.
public static MagnetAnchor Parse(string value)
Parameters
valuestring
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
implicit operator MagnetAnchor(string)
Implicitly parses the XAML representation of an anchor.
public static implicit operator MagnetAnchor(string value)
Parameters
valuestring