XamlSourceInfo Class
Definition
Represents source location information for an element within a XAML or code file.
public class XamlSourceInfo
Constructors
| Name | Description |
|---|---|
| XamlSourceInfo | Initializes a new instance of the Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo class with a specified line, column, and file path. |
XamlSourceInfo Constructor
Initializes a new instance of the Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo class with a specified line, column, and file path.
public XamlSourceInfo(int line, int column, string filePath)
Parameters
line int
The line number of the source element.
column int
The column number of the source element.
filePath string
The full path of the source file.
Methods
| Name | Description |
|---|---|
| <Clone>$ | No summary available. |
| Equals (2 overloads) | No summary available. |
| GetHashCode | No summary available. |
| GetXamlSourceInfo (2 overloads) | Retrieves the XAML source information associated with the specified key in the given resource dictionary, if available. |
| SetXamlSourceInfo (2 overloads) | Associates XAML source information with the specified key in the given resource dictionary. |
| ToString | Returns a string that represents the current Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo. |
<Clone>$ Method
public Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo <Clone>$()
Returns
Equals overloads
Equals Method
public bool Equals(Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo other)
Parameters
other Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo
Returns
bool
Equals Method
public bool Equals(object obj)
Parameters
obj object
Returns
bool
GetHashCode Method
public int GetHashCode()
Returns
int
GetXamlSourceInfo overloads
GetXamlSourceInfo Method
Retrieves the XAML source information associated with the specified key in the given resource dictionary, if available.
public Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo GetXamlSourceInfo(Avalonia.Controls.IResourceDictionary dictionary, object key)
Parameters
dictionary Avalonia.Controls.IResourceDictionary
The resource dictionary associated with the XAML source information.
key object
The key associated with the source info.
Returns
Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo
A Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo instance containing the XAML source information for the specified key, or if no source information is available.
GetXamlSourceInfo Method
Retrieves the XAML source information associated with the specified object, if available.
public Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo GetXamlSourceInfo(object obj)
Parameters
obj object
The object for which to obtain XAML source information. Cannot be null.
Returns
Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo
A Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo instance containing the XAML source information for the specified object, or if no source information is available.
SetXamlSourceInfo overloads
SetXamlSourceInfo Method
Associates XAML source information with the specified key in the given resource dictionary.
public void SetXamlSourceInfo(Avalonia.Controls.IResourceDictionary dictionary, object key, Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo info)
Parameters
dictionary Avalonia.Controls.IResourceDictionary
The resource dictionary to associate with the XAML source information.
key object
The key associated with the source info.
info Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo
The XAML source information to associate with the object, or null to remove any existing association.
SetXamlSourceInfo Method
Associates XAML source information with the specified object for debugging or diagnostic purposes.
public void SetXamlSourceInfo(object obj, Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo info)
Parameters
obj object
The object to associate with the XAML source information. Cannot be null.
info Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo
The XAML source information to associate with the object, or null to remove any existing association.
Remarks
This method is typically used to enable enhanced debugging or diagnostics by tracking the origin of XAML elements at runtime. If the same object is passed multiple times, the most recent source information will overwrite any previous value.
ToString Method
Returns a string that represents the current Avalonia.Markup.Xaml.Diagnostics.XamlSourceInfo.
public string ToString()
Returns
string
A formatted string in the form "FilePath:Line,Column",
or "(unknown):Line,Column" if the file path is not set.
Properties
| Name | Description |
|---|---|
| LineNumber | Gets the 1-based line number in the source file where the element is defined. |
| LinePosition | Gets the 1-based column number in the source file where the element is defined. |
| SourceUri | Gets the full path of the source file containing the element, or null if unavailable. |
LineNumber Property
Gets the 1-based line number in the source file where the element is defined.
public int LineNumber { get; set; }
LinePosition Property
Gets the 1-based column number in the source file where the element is defined.
public int LinePosition { get; set; }
SourceUri Property
Gets the full path of the source file containing the element, or null if unavailable.
public Uri SourceUri { get; set; }