Skip to main content

One post tagged with "xaml"

View All Tags

WPF ItemsControl and Operation is not valid while ItemsSource is in use…

Greg Roberts

Greg Roberts

Greg Roberts

See anything wrong with the following XAML:

<ItemsControl ItemsSource="{Binding GridColumns}" Grid.Row="1" Grid.Column="0">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Margin="0,14" Height="22" >
<TextBlock TextAlignment="Center" Text="{Binding Name}"></TextBlock>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Clicked">
<n:ExecuteCommandAction Command="{Binding HighlightColumn}" Parameter="{Binding Index}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" >
</StackPanel>
</ItemsPanelTemplate>
</ItemsControl>