LayoutCycleException class

Applies to Windows and Windows Phone

An exception that is thrown by the layout cycle, typically because the number of cycles indicates a loop or recursive condition.

Syntax


public class LayoutCycleException : Exception

Members

The LayoutCycleException class has these types of members:

Constructors

The LayoutCycleException class has these constructors.

ConstructorDescription
LayoutCycleException() Initializes a new instance of the LayoutCycleException class.
LayoutCycleException(String) Initializes a new instance of the LayoutCycleException class with a specified error message.
LayoutCycleException(String,Exception) Initializes a new instance of the LayoutCycleException class with a specified error message and a reference to the inner exception that is the cause of this exception.

 

Events

The LayoutCycleException class has these events.

EventDescription
SerializeObjectState (Inherited from Exception)

 

Methods

The LayoutCycleException class has these methods. It also inherits methods from the Object class.

MethodDescription
GetBaseException (Inherited from Exception)
GetObjectData (Inherited from Exception)
GetType (Inherited from Exception)
ToString (Inherited from Exception)

 

Properties

The LayoutCycleException class has these properties.

PropertyAccess typeDescription

Data

Read-only (Inherited from Exception)

HelpLink

Read/write (Inherited from Exception)

HResult

Read-only (Inherited from Exception)

InnerException

Read-only (Inherited from Exception)

Message

Read-only (Inherited from Exception)

Source

Read/write (Inherited from Exception)

StackTrace

Read-only (Inherited from Exception)

TargetSite

Read-only (Inherited from Exception)

 

Remarks

App code wouldn't typically be the direct cause of this exception. However, a bad implementation of MeasureOverride or ArrangeOverride might be the underlying cause of this exception and cause it to be thrown by the Windows Runtime while running layout for a XAML UI.

The layout system has an inherent internal concept of passes over layout, during which the layout adjusts itself asynchronously. The layout logic is based on several inputs and a bottom-up evaluation of all contributing layout elements in a visual tree. In some situations it's possible for an app layout to introduce a loop or condition that causes the layout system to throw LayoutCycleException. In such a loop, the layout system can't arrive at a solution and can't produce the visuals for a finalized layout, because it repeatedly invalidates its candidate layouts. For example, there could be a layout-related property binding or custom property-changed handling between a parent and child that keeps invalidating the inner parts of the layout before it can finish the outer part.

A custom container doesn't necessarily have full control over what elements could exist within it, so loops like this aren't completely avoidable either by control authors or by app writers.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml

Assembly

System.Runtime.WindowsRuntime.UI.Xaml.dll

See also

MeasureOverride
ArrangeOverride
Exception handling for Windows Store apps in C# or Visual Basic
Cross-reference: Standard exceptions and error codes

 

 

Show:
© 2014 Microsoft