Created
April 14, 2014 06:54
-
-
Save odugen/10622541 to your computer and use it in GitHub Desktop.
ComboBox ItemsSource to parent collection binding
This file contains hidden or 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
| <!-- In user countrol resources --> | |
| <UserControl.Resources> | |
| <CollectionViewSource Source="{Binding Currencies}" x:Key="Currencies"/> | |
| </UserControl.Resources> | |
| <!-- below inside ex. DataGrid --> | |
| <ComboBox ItemsSource="{Binding Source={StaticResource Currencies}}" IsSynchronizedWithCurrentItem="False" | |
| DisplayMemberPath="IsoCode" | |
| SelectedItem="{Binding BaseCurrency}"/> | |
| <!-- IsSynchronizedWithCurrentItem="False" is important, otherwise ComboBoxes will select same item for each child viewmodel --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment