'Declaration Public ReadOnly Property TextAlignmentResolved As TextAlignment
public TextAlignment TextAlignmentResolved {get;}
Private Sub Button1_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Me.textEditor1.ClearValue(XamTextEditor.TextAlignmentProperty) Me.textEditor1.HorizontalContentAlignment = Windows.HorizontalAlignment.Right ' TextAlignment will return Left which is the default value of the property. Debug.WriteLine("TextAlignment = " & Me.textEditor1.TextAlignment.ToString()) ' TextAlignmentResolved will return Right. This is because TextAlignment is not ' set on the text editor itself. In such a case the resolved text alignment will ' be based on the HorizontalContentAlignment setting. Debug.WriteLine("TextAlignmentResolved = " & Me.textEditor1.TextAlignmentResolved.ToString()) End Sub
public void button1_Click( object sender, RoutedEventArgs e ) { this.textEditor1.ClearValue( XamTextEditor.TextAlignmentProperty ); this.textEditor1.HorizontalContentAlignment = HorizontalAlignment.Right; // TextAlignment will return Left which is the default value of the property. Debug.WriteLine( "TextAlignment = " + this.textEditor1.TextAlignment ); // TextAlignmentResolved will return Right. This is because TextAlignment is not // set on the text editor itself. In such a case the resolved text alignment will // be based on the HorizontalContentAlignment setting. Debug.WriteLine( "TextAlignmentResolved = " + this.textEditor1.TextAlignmentResolved ); }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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