Frage

I'm currently using the following itemscontrol and datatemplate:

<UserControl.Resources>
    <DataTemplate x:Key="OrdersTemplate">
        <dxlc:LayoutItem Label="CustomerReference" LabelPosition="Top" MaxWidth="300" HorizontalAlignment="Left" Width="300">
            <dxe:TextEdit IsEnabled="True" Text="{Binding Path=CustomerReference}" />
        </dxlc:LayoutItem>
    </DataTemplate>
</UserControl.Resources>

<HeaderedContentControl Header="Steps">
    <ItemsControl ItemsSource="{Binding Orders}" ItemTemplate="{StaticResource OrdersTemplate}"/>
</HeaderedContentControl>

The source is just a list with entities.

The problem is that the "CustomerReference" of every object from my source changes when I change it in the textbox. Whats missing here?

Greets

War es hilfreich?

Lösung

I think in your view model you have added the same object more than once. Instead of creating new object when ever you added to the collection. So when you want to add a object to collection create a new object and add it

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top