ITabRange.IsXamlText

Fore Syntax

IsXamlText: Boolean;

Fore.NET Syntax

IsXamlText: boolean;

Description

The IsXamlText property determines whether XAML structure is used to set formatting for parts of the range text.

Comment

Available values:

To get or modify a text in XAML format, use the ITabRange.Text property.

The ITabView.UseWpfEditor property affects the format of text to be displayed, if this property is set to False, formatted text of a cell or a cell range cannot be displayed in XAML format. Information about working with WPF editor is presented in the Using Formatted Text page.

On working with complex formatting it is necessary to take into account features of entering values into a cell.

The XAML format text must begin with the XAML version specification and correspond to rules of the XAML structure writing. Indents or tabulation cannot be used before version specification.

NOTE. The property is outdated, use the ITabRange.IsRtfText property instead.

Fore Example

To execute the example a form that contains the Button component with the Button1 identifier, the TabSheetBox component with the TabSheetBox1 identifier and the UiTabSheet component with the UiTabSheet1 identifier are required. Set the UiTabSheet1 component as a data source for the TabSheetBox1 component.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    TSheet: ITabSheet;
    TRange: ITabRange;
Begin
    TSheet := UiTabSheet1.TabSheet;
    TRange := TSheet.ParseCell("A0");
    TRange.Value := "m2";
    TRange.Text := "<?xml version=""1.0"" encoding=""utf-16""?><TextBlock FontFamily=""Arial""" +
        " FontStyle=""Normal"" FontWeight=""Normal"" FontSize=""10.6666666666667"" Foreground=""#FF000000""" +
        " Background=""#00FFFFFF"" TextAlignment=""Left"" TextWrapping=""NoWrap"" FlowDirection=""LeftToRight""" +
        " VerticalAlignment=""Top"" xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""" +
        " xmlns:s=""clr-namespace:System;assembly=mscorlib"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">" +
        "<TextBlock.Resources><s:String x:Key=""GeneralAlignment"">True</s:String></TextBlock.Resources>M<Run BaselineAlignment=""TextTop""" +
        " FontSize=""8.484848484848"">2</Run></TextBlock>";
    TRange.IsXamlText := True;
End Sub Button1OnClick;

On clicking the Button1 button, the A0 cell displays formatted text: M2.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Tab;
...
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    TSheet: ITabSheet;
    TRange: ITabRange;
Begin
    TSheet := UiTabSheetNet1.TabSheetUi.TabSheet;
    TRange := TSheet.ParseCell("A0");
    TRange.Value := "m2";
    TRange.Text := "<?xml version=""1.0"" encoding=""utf-16""?><TextBlock FontFamily=""Arial""" +
        " FontStyle=""Normal"" FontWeight=""Normal"" FontSize=""10.6666666666667"" Foreground=""#FF000000""" +
        " Background=""#00FFFFFF"" TextAlignment=""Left"" TextWrapping=""NoWrap"" FlowDirection=""LeftToRight""" +
        " VerticalAlignment=""Top"" xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""" +
        " xmlns:s=""clr-namespace:System;assembly=mscorlib"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">" +
        "<TextBlock.Resources><s:String x:Key=""GeneralAlignment"">True</s:String></TextBlock.Resources>M<Run BaselineAlignment=""TextTop""" +
        " FontSize=""8.484848484848"">2</Run></TextBlock>";
    TRange.IsXamlText := True;
End Sub;

See also:

ITabRange | Features of Entering Values into a Cell