IsXamlText: Boolean;
IsXamlText: boolean;
The IsXamlText property determines whether XAML structure is used to set formatting for parts of the range text.
Available values:
True.Individual formatting can be set for separate text parts. Text and formatting are in this case displayed in XAML format.
False. Font settings defined in the ITabCellStyle.Font property will be applied to the text.
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.
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.
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: