InlineIterator

WPF does not support collection-based bindings for inline elements. Therefore, the Smartpoint SDK created its own inline iterator. InlineInterator provides the infrastructure to render an iteration of inline elements (such as spans).

Example

When InlineIterator is used, you can specify the following on each item in the collection:

  • ItemsSource is the source of data (an ICollection type).

  • DefaultItemViewType allows us to specify the view that will be used. If not specified InlineIterator picks up its view from the defined class attribute.

    Example

    The following code is used to specify the view type within the view model.

  • DefaultItemViewModelType determines the type of view model used by the view.

  • VisibleLines (a dependency property) defines how many lines are rendered initially; after that number, new lines are rendered in a background thread. This rendering method is useful for speeding up the response time of plug-ins that return large amounts of information (e.g., fare display). The value is determined in the following order:

    1. From the dependency property. You can set VisibleLines to a number.

    2. If VisibleLines is not specified in the XAML DP setter, Smartpoint looks in Travelport.Smartpoint.Properties.Settings.Default.DefaultInlineIteratorVisibleLines. If this property is set to zero, this property is ignored and the following setting is used.

    3. If VisibleLines is not specified in either of the above areas, Smartpoint gets the VisibleLines setting from the current available lines in the TEControl: UIHelper.Instance.GetLinesAvailableInTE(UIHelper.Instance.CurrentTEControl). The VisibleLines available in the TEControl depends on screen resolution and the height of the TEControl. If the window is resized, this parameter changes.

  • InlineRendererFunc provides a way to define a callback function in your code that is called upon each line being rendered. That function must return an Inline object (view). This function is useful if you have a general view that is used most of the time but you want to use a specific view in certain instances.