Created
August 28, 2024 20:02
-
-
Save DamianSuess/0da57d63be8243b188a08cdd44a8b6eb to your computer and use it in GitHub Desktop.
Avalonia-MultiBinding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserControl.Resources> | |
<ResourceDictionary> | |
<DataTemplate x:Key="FlatDeviceInfo" DataType="models:DeviceInfo"> | |
<TextBlock> | |
<TextBlock.Text> | |
<MultiBinding StringFormat="{}{0} - {1}"> | |
<Binding Path="Address" /> | |
<Binding Path="DeviceTypeName" /> | |
</MultiBinding> | |
</TextBlock.Text> | |
</TextBlock> | |
</DataTemplate> | |
</ResourceDictionary> | |
</UserControl.Resources> | |
<!-- ... --> | |
<ComboBox IsTextSearchEnabled="True" | |
ItemTemplate="{StaticResource FlatDeviceInfo}" | |
Items="{Binding Devices}" | |
SelectedItem="{Binding DeviceSelected, Mode=TwoWay}" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment