블로그 이미지
* Microsoft MVP - Windows Development 2014 ~ 2019 5ring * LINE : kaki104 * facebook : https://www.facebook.com/kaki104 https://www.facebook.com/groups/w10app/ kaki104

카테고리

List All (551)
Xamarin Forms (4)
Bot Framework (19)
Azure (9)
Windows 10 (35)
Facebook News & Tips (158)
Windows App(Universa.. (83)
Windows 8&8.1 (113)
Windows Phone 8 (42)
Silverlight (37)
HTML5 & MVC4 (16)
WPF (1)
Portable Class Library (2)
Uncategorised Tips a.. (3)
Kinect for Windows (2)
ETC (12)
kaki104 Scrap (4)
App News (11)
Total522,039
Today48
Yesterday101

에러


System.Exception was unhandled by user code

  HResult=-2147418113

  Message=Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

  Source=mscorlib

  StackTrace:

       at System.Runtime.InteropServices.WindowsRuntime.IVector`1.Clear()

       at System.Runtime.InteropServices.WindowsRuntime.VectorToCollectionAdapter.Clear[T]()

       at CrossPlatform.Universal.Windows.Behaviors.SelectedItemsBehavior.ViewModelToControl_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)

       at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)

       at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()

       at System.Collections.ObjectModel.Collection`1.Clear()

       at OneSearch.Universal.ViewModels.ProgressPageVM.<OnInitLocalReactiveCommand>b__13(Object obj)

       at System.Reactive.AnonymousObserver`1.OnNextCore(T value)

       at System.Reactive.ObserverBase`1.OnNext(T value)

       at System.Reactive.Subjects.Subject`1.OnNext(T value)

       at System.Reactive.Linq.ObservableImpl.Do`1._.OnNext(TSource value)

  InnerException: 



에러 발생 위치

            var control = AssociatedObject as ListViewBase;


            //Reset처리

            if (e.Action == NotifyCollectionChangedAction.Reset)

            {

                if (control != null) control.SelectedItems.Clear();

            }



에러 발생 원인


GridView control이나 ListView control에서 SelectionMode가 Single인데 SelectedItems를 사용해서 발생한 오류



해결


<GridView ItemsSource="{Binding BackgroundOperationItems}" Padding="120,140,120,50" 

 ItemTemplateSelector="{StaticResource BackgroundItemTemplateSelector}" Grid.RowSpan="2" SelectionMode="Multiple">

<Interactivity:Interaction.Behaviors>

<Behaviors:SelectedItemsBehavior SelectedItems="{Binding BackgroundSelectedItems}"/>

</Interactivity:Interaction.Behaviors>

</GridView>     


Posted by MVP kaki104

티스토리 툴바