Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Assuming WPF, a quick sample:</p> <pre><code>&lt;Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition /&gt; &lt;RowDefinition /&gt; &lt;RowDefinition /&gt; &lt;/Grid.RowDefinitions&gt; &lt;ListBox x:Name="list" ItemsSource="{Binding}" DisplayMemberPath="Name"/&gt; &lt;TextBox Text="{Binding ElementName=list, Path=SelectedItem.Name}" Grid.Row="1"/&gt; &lt;TextBox Text="{Binding ElementName=list, Path=SelectedItem.Val}" Grid.Row="2" /&gt; &lt;/Grid&gt; &lt;/Window&gt; namespace WpfApplication1 { public class Thing : INotifyPropertyChanged { private string _name; private double _val; public string Name { get { return _name; } set { _name = value; OnPropertyChanged("Name"); } } public double Val { get { return _val; } set { _val = value; OnPropertyChanged("Val"); } } protected void OnPropertyChanged(string propertyName) { PropertyChangedEventHandler propertyChanged = this.PropertyChanged; if (propertyChanged != null) { propertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public event PropertyChangedEventHandler PropertyChanged; } public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DataContext = new List&lt;Thing&gt; { new Thing { Name = "A", Val = 1.0 }, new Thing { Name = "B", Val = 2.0 } }; } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload