Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Binding ComboBox SelectedItem

$
0
0

I have a ComboBox Bind to my data. It displays: Beer, Soda, Wine, ...

<ComboBoxItemTemplate="{StaticResource Drink}"ItemsSource="{Binding Drink}" x:Name="cboDrink"/>

On another Page I have a TextBlock which I would like to Bind to display to the chosen drink from the previous Page(cboDrink).

<TextBlock x:Name="ChosenDrink"Text="{Binding Path=SelectedIndex, ElementName=cboDrink}"></TextBlock>

Unfortunately this doesn't work. How can I make this work? Keep in mind this is a Windows 8 application.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>