I want to make checkbox list which toggles only if directly clicked on checkbox.
Unfortunately if I make this way:
<ListBox Name="LanguagesListBox">
<ListBox.ItemTemplate>
<DataTemplate>
<ListBoxItem>
<StackPanel Orientation="Horizontal">
<CheckBox/>
<Label Content="{Binding InputLanguage.LayoutName}"/>
</StackPanel>
</ListBoxItem>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
I get checkbox not vertially aligned with it's label:
But if I write
<ListBox Name="LanguagesListBox">
<ListBox.ItemTemplate>
<DataTemplate>
<ListBoxItem>
<StackPanel Orientation="Horizontal">
<CheckBox Content="{Binding InputLanguage.LayoutName}"/>
</StackPanel>
</ListBoxItem>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
I get checkbox toggle if clicked at the label
How to get both?
Aucun commentaire:
Enregistrer un commentaire