'Declaration Public Shadows ReadOnly Property UIElement As UltraMonthViewSingleUIElement
public new UltraMonthViewSingleUIElement UIElement {get;}
The UIElement property provides access to the visual representation of the UltraMonthViewSingle control.
The control's UIElement property exposes a ChildElements collection under which all of the control's many individual UIElements appear as descendants.
Imports Infragistics.Win Imports Infragistics.Win.UltraWinSchedule Imports Infragistics.Win.UltraWinSchedule.MonthViewSingle Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim info As String = "The descendant elements of the control's main UIElement are: " + vbCrLf + vbCrLf Me.EnumerateChildElements(Me.ultraMonthViewSingle1.UIElement, info, 0) ' Display the UIElement hierarchy in a message box MessageBox.Show(info, "EnumerateUIElements", MessageBoxButtons.OK) End Sub Private Sub EnumerateChildElements(ByVal element As UIElement, ByRef info As String) ' Get the indentation level Dim level As Integer = Me.GetElementLevel(element) Dim tabChar As String = String.Empty Dim i As Integer For i = 0 To level tabChar += Chr(9) Next ' Increment the level for the next iteration, if any level += 1 ' Iterate the specified element's ChildElements collection, Dim child As UIElement For Each child In element.ChildElements ' Output each child element's type name info += tabChar + child.ToString() + vbCrLf ' Call this function recursively to get each child's children, etc. Me.EnumerateChildElements(child, info) Next End Sub ' Returns the "generation" of the specified UIElement; that is, the ' number of ancestor UIElements it has Private Function GetElementLevel(ByVal element As UIElement) Dim level As Integer Dim parentElement As UIElement = element.Parent ' Increment 'level' until we hit a null parent While Not parentElement Is Nothing level += 1 parentElement = parentElement.Parent End While Return level End Function
using Infragistics.Win; using Infragistics.Win.UltraWinSchedule; using Infragistics.Win.UltraWinSchedule.MonthViewSingle; using System.Diagnostics; private void button1_Click(object sender, System.EventArgs e) { string info = "The descendant elements of the control's main UIElement are: " + "\n" + "\n"; this.EnumerateChildElements( this.ultraMonthViewSingle1.UIElement, ref info ); // Output the UIElement hierarchy to the debugger Debug.WriteLine( info ); } private void EnumerateChildElements( UIElement element, ref string info ) { int level = this.GetElementLevel( element ); string tabChar = string.Empty; for ( int i = 0; i <= level; i ++ ) { tabChar += ((char)(9)).ToString(); } // Increment the level for the next iteration, if any level++; // Iterate the specified element's ChildElements collection, foreach( UIElement child in element.ChildElements ) { // Output each child element's type name info += tabChar + child.ToString() + "\n"; // Call this function recursively to get each child's children, etc. this.EnumerateChildElements( child, ref info ); } } // Returns the "generation" of the specified UIElement; that is, the // number of ancestor UIElements it has private int GetElementLevel( UIElement element ) { int level = 0; UIElement parentElement = element.Parent; // Increment 'level' until we hit a null parent while ( parentElement != null ) { level ++; parentElement = parentElement.Parent; } return level; }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2