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

ObservableCollection Mistake?

$
0
0

Hi!

i have a bug in my source but i did not see the bug... !?

<ListView x:Name="ListViewAnsprechpartner" Margin="0,0,254,0" ItemsSource="{Binding Ansprechpatner}" IsSynchronizedWithCurrentItem="True" PreviewKeyDown="ListViewAnsp_PreviewKeyDown" SelectionChanged="ListViewAnsp_SelectionChanged" Height="506" PreviewMouseLeftButtonUp="ListViewAddresses_PreviewMouseLeftButtonUp" Canvas.Left="739" Canvas.Top="173" Width="200" AlternationCount="2" FontFamily="Arial" FontWeight="Bold" FontSize="14"><ListView.View><GridView AllowsColumnReorder="True"><GridViewColumn Width="auto" Header="Ansprechpartner                   " DisplayMemberBinding="{Binding Ansprechp1}" /></GridView></ListView.View></ListView>
...
        public ObservableCollection<WPFAnsprechpartner> Ansprechpatner { get; set; }
...
        Ansprechpartner = new ObservableCollection<WPFAnsprechpartner>();
...
    public class WPFAnsprechpartner
    {
        public string Ansprechp1 { get; set; }
    }

On this line is a Mistake:

Ansprechpartner = new ObservableCollection<WPFAnsprechpartner>();

But what is wrong?

The compiler mean it is not a String!?

See anyone the mistake?

Best regards

Bernd


Viewing all articles
Browse latest Browse all 18858

Trending Articles