L2Bot2.0/Client/Application/Components/ObjectSelector.xaml
2024-08-15 17:23:24 +02:00

31 lines
1.3 KiB
XML

<UserControl x:Class="Client.Application.Components.ObjectSelector"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Client.Application.Components"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
x:Name="root">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="{Binding Header,ElementName=root}" Grid.Row="0" Grid.Column="0"/>
<ComboBox
Grid.Row="1" Grid.Column="0"
SelectedValuePath="Id"
DisplayMemberPath="Name"
ItemsSource="{Binding Source,ElementName=root}"
SelectedValue="{Binding SelectedValue,ElementName=root}"
>
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
</Grid>
</UserControl>