XamlException Constructors

Definition

Initializes a new instance of the XamlException class.

Overloads

XamlException()

Initializes a new instance of the XamlException class. The instance contains a system-supplied message that describes the error.

XamlException(String)

Initializes a new instance of the XamlException class. The instance contains a specified message that describes the error.

XamlException(SerializationInfo, StreamingContext)

Initializes a new instance of the XamlException class with serialized data.

XamlException(String, Exception)

Initializes a new instance of the XamlException class. The instance contains a specified error message and a reference to the inner exception that is the cause of this exception.

XamlException(String, Exception, Int32, Int32)

Initializes a new instance of the XamlException class. The instance contains a specified error message, inner exception, and line information.

XamlException()

Initializes a new instance of the XamlException class. The instance contains a system-supplied message that describes the error.

C#
public XamlException();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlException(String)

Initializes a new instance of the XamlException class. The instance contains a specified message that describes the error.

C#
public XamlException(string message);

Parameters

message
String

The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlException(SerializationInfo, StreamingContext)

Initializes a new instance of the XamlException class with serialized data.

C#
protected XamlException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);

Parameters

info
SerializationInfo

The object that holds the serialized object data.

context
StreamingContext

The contextual information about the source or destination.

Exceptions

info is null.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlException(String, Exception)

Initializes a new instance of the XamlException class. The instance contains a specified error message and a reference to the inner exception that is the cause of this exception.

C#
public XamlException(string message, Exception innerException);

Parameters

message
String

The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture.

innerException
Exception

The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Remarks

An exception that is thrown because a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor; or it returns null if the InnerException property does not provide the inner exception value to the constructor.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlException(String, Exception, Int32, Int32)

Initializes a new instance of the XamlException class. The instance contains a specified error message, inner exception, and line information.

C#
public XamlException(string message, Exception innerException, int lineNumber, int linePosition);

Parameters

message
String

The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture.

innerException
Exception

The exception that is the cause of the current exception.

lineNumber
Int32

The line number to report to debugging or to line information consumers.

linePosition
Int32

The line position to report to debugging or line information consumers.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10