locked
MostRecentlyUsedList doesn't call ItemRemoved

    Question

  • Hello

    I have this code :

    auto list = StorageApplicationPermissions::MostRecentlyUsedList;

    list->ItemRemoved += ref new TypedEventHandler<StorageItemMostRecentlyUsedList^, ItemRemovedEventArgs^>(this,&App1::MainPage::MRUItemRemoved);


    void MainPage::MRUItemRemoved(StorageItemMostRecentlyUsedList^ list, ItemRemovedEventArgs^ args)

    {

    }

    but this event is not called when item is removed (in case of append of new item). Do somebody know what I am doing wrong ?

    Friday, August 24, 2012 2:11 PM

Answers

  • Are you adding or removing using the same instance of 'list' created above? You need to register the event handler each time you obtain a new reference to the StorageApplicationPermissions::MostRecentlyUsedList. I'm checking to see if that behavior is documented anywhere yet.

    Thanks!


    David Lamb

    • Marked as answer by Radek Voltr cz Tuesday, August 28, 2012 10:54 AM
    Monday, August 27, 2012 11:02 PM
    Moderator

All replies

  • Are you adding or removing using the same instance of 'list' created above? You need to register the event handler each time you obtain a new reference to the StorageApplicationPermissions::MostRecentlyUsedList. I'm checking to see if that behavior is documented anywhere yet.

    Thanks!


    David Lamb

    • Marked as answer by Radek Voltr cz Tuesday, August 28, 2012 10:54 AM
    Monday, August 27, 2012 11:02 PM
    Moderator
  • Fixed now, thanks !!!
    Tuesday, August 28, 2012 10:53 AM