J'ai cet objet:WPF Reliure Problème
class a
{
public string Application;
public DateTime From, To;
}
Et je déclare cette liste avec elle:
ObservableCollection<a> ApplicationsCollection =
new ObservableCollection<a>();
Dans mon XAML je:
<ListView Height="226.381" Name="lstStatus" Width="248.383" HorizontalAlignment="Left" Margin="12,0,0,12" VerticalAlignment=">
<ListView.View>
<GridView>
<GridViewColumn Width="140" Header="Application"
DisplayMemberBinding="{Binding Path=Application}"/>
<GridViewColumn Width="50" Header="From"
DisplayMemberBinding="{Binding Path=From}"/>
<GridViewColumn Width="50" Header="To"
DisplayMemberBinding="{Binding Path=To}"/>
</GridView>
</ListView.View>
</ListView>
Quand je fais:
lstStatus.ItemsSource = ApplicationsCollection;
Je reçois un tas d'erreurs et rien ne montre dans mon avis la liste:
System.Windows.Data Error: 39 : BindingExpression path error: 'Application' property not found on 'object' ''a' (HashCode=60325168)'. BindingExpression:Path=Application; DataItem='a' (HashCode=60325168); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
System.Windows.Data Error: 39 : BindingExpression path error: 'From' property not found on 'object' ''a' (HashCode=60325168)'. BindingExpression:Path=From; DataItem='a' (HashCode=60325168); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
System.Windows.Data Error: 39 : BindingExpression path error: 'To' property not found on 'object' ''a' (HashCode=60325168)'. BindingExpression:Path=To; DataItem='a' (HashCode=60325168); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
Il est de voir évidemment l'objet comme ayant le type a
et est ont évidemment les propriétés correctes, alors pourquoi est-ce pas de travail?
Wow, ça me rendait fou, merci beaucoup! – Blindy