NoesisGUI

AlternationConverter Class

namespace Noesis | MSDN

Converts an integer to/from an object by applying the integer as an index to a list of objects.

<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Grid.Resources>
        <AlternationConverter x:Key="backgroundConverter">
            <SolidColorBrush>Silver</SolidColorBrush>
            <SolidColorBrush>Gray</SolidColorBrush>
        </AlternationConverter>
        <Style x:Key="listItemStyle" TargetType="{x:Type ListBoxItem}">
            <Setter Property="Background"
                Value="{Binding Path=(ItemsControl.AlternationIndex),
                    RelativeSource={RelativeSource Self},
                    Converter={StaticResource backgroundConverter}}"/>
        </Style>
    </Grid.Resources>

    <ListBox AlternationCount="2" ItemsSource="{Binding Items}"
        ItemContainerStyle="{StaticResource listItemStyle}"/>

</Grid>

Inheritance Hierarchy

AlternationConverter

INDEX Class Hierarchy Index

Methods

From BaseValueConverter

Name Description
TryConvert The data binding engine calls this method when it propagates a value from the binding source to the binding target
TryConvertBack The data binding engine calls this method when it propagates a value from the binding target to the binding source

Properties


Name Description
RO Values Gets a list of objects that the AlternationConverter returns when an integer is passed to the Convert() method
DP_ Dependency Property - RO_ Read only

Events

AlternationConverter has no events

© 2017 Noesis Technologies