locked
FlipView problem RRS feed

  • Question

  • Hi,

    I am creating win 8.1 store app.

    If I use flip view to show profiles it causes an error.

    Here is a flip view code.

    <FlipView VerticalAlignment="Bottom"  x:Name="profileFlipView" Grid.Row="1"  ItemsSource="{Binding Profiles}" >
    <FlipView.ItemsPanel>
    		<ItemsPanelTemplate>
    			<StackPanel Orientation="Horizontal" Margin="0,0,30,40" />
    		</ItemsPanelTemplate>
    	</FlipView.ItemsPanel>
    	<FlipView.ItemTemplate>
    		<DataTemplate>
    			<TextBlock Text="{Binding Name}" Margin="5,0,5,0" Style="{StaticResource HeaderTextBlockStyle}" />
    		</DataTemplate>
    	</FlipView.ItemTemplate>
    </FlipView> 

    Item source is binded to Profiles collection, however when I leave current page, modify source collection and then go back to page with FlipView, its not updated and if I do it again, it throws an exception.

    {"Error HRESULT E_FAIL has been returned from a call to a COM component."}

    Error code: -2147467259

    Stack trace:

       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
       at System.Collections.ObjectModel.Collection`1.Add(T item)

    It seems like there is a subscribed event handler from first FlipView.

    Sunday, January 12, 2014 12:00 PM

Answers

  • I am unable to demonstrate the problem on minimal sample. However when I set Width and Height properties it works.
    • Marked as answer by Anne Jing Monday, January 20, 2014 1:47 AM
    Monday, January 13, 2014 5:59 PM

All replies

  • The problem is unlikely to be in the Xaml. What does the code behind look like? Where exactly is the error?

    Can you share a minimal sample which demonstrates the problem on your SkyDrive?

    --Rob

    Sunday, January 12, 2014 9:45 PM
    Moderator
  • I am unable to demonstrate the problem on minimal sample. However when I set Width and Height properties it works.
    • Marked as answer by Anne Jing Monday, January 20, 2014 1:47 AM
    Monday, January 13, 2014 5:59 PM