티스토리 뷰

반응형

에러

 

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>     

 

반응형

'UWP & Windows App' 카테고리의 다른 글

OneSearch Help - 한글 메뉴얼  (0) 2015.04.23
OneSearch help  (0) 2015.04.01
BackgroundDownloader 이용해서 로컬에 다운로드 받기  (0) 2014.12.10
Privacy & Cookies policy  (0) 2014.12.01
Nuget Package error 해결법  (0) 2014.11.18
댓글