ListBoxEdit

De Banane Atomic
Aller à la navigationAller à la recherche

Style RadioButton

Xaml.png
<!-- xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
     Assembly: DevExpress.Xpf.Core.v15.1.dll -->
<dxe:ListBoxEdit ItemsSource="{Binding Path=...}" SelectedIndex="{Binding Path=...}"
                 Background="Transparent" VerticalContentAlignment="Top">

    <dxe:ListBoxEdit.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal" />
        </ItemsPanelTemplate>
    </dxe:ListBoxEdit.ItemsPanel>

    <dxe:ListBoxEdit.Items>
        <dxe:ListBoxEditItem Content="Item1"/>
        <dxe:ListBoxEditItem Content="Item2" />
    </dxe:ListBoxEdit.Items>

    <!-- Style RadioButton -->
    <dxe:ListBoxEdit.StyleSettings>
        <dxe:RadioListBoxEditStyleSettings/>
    </dxe:ListBoxEdit.StyleSettings>
    <dxe:ListBoxEdit.ItemContainerStyle>
        <Style>
            <Setter Property="Control.Margin" Value="3 0" />
        </Style>
    </dxe:ListBoxEdit.ItemContainerStyle>

    <!-- Style Masquer la bordure -->
    <dxe:ListBoxEdit.BorderTemplate>
        <ControlTemplate TargetType="{x:Type ContentControl}">
            <Border Width="Auto" Height="Auto" BorderThickness="1" SnapsToDevicePixels="True">
                <ContentPresenter />
            </Border>
        </ControlTemplate>
    </dxe:ListBoxEdit.BorderTemplate>
</dxe:ListBoxEdit>
Le binding de RadioButton est plus facile avec ListBoxEdit et RadioListBoxEditStyleSettings.