1
Le code suivant me donne l'erreur (impossible d'ajouter le type Object to Stackpanel).Comment puis-je dire .ToString() en XAML?
Comment puis-je dire .ToString() en XAML?
<Window.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Content">
<Setter.Value>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=FirstName}"/>
</StackPanel>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<ListBox x:Name="theCustomers"/>
</Grid>
obligatoire dans le code-behind avec ADO.NET Entity Framework:
MainEntities db = new MainEntities();
var customers = from c in db.CustomersSet
select c;
theCustomers.ItemsSource = customers;
excellent, cela fonctionne, savez-vous comment je peux utiliser StringFormat dans ce contexte? http://stackoverflow.com/questions/577697/how-can-i-get-multibinding-to-work-in-xaml-listbox –