locked
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) RRS feed

  • Question

  • My error occured at the GroupedItemPage when I am trying to show my messagedialog when my collection count equal zero.

    if (VMCount > 0)
                {
                    // TODO: Assign a collection of bindable groups to this.DefaultViewModel["Groups"]
                    var sampleDataGroups = VMDataSource.GetGroups((String)navigationParameter);
                    this.DefaultViewModel["Groups"] = sampleDataGroups;
                }
                else
                {
                    var sampleDataGroups = VMDataSource.GetGroups((String)navigationParameter);
                    this.DefaultViewModel["Groups"] = sampleDataGroups;
    
                    var message = new MessageDialog("No Virtual Machine is available for your diploma");
    
                    message.Commands.Add(new UICommand("Close", new UICommandInvokedHandler(this.CloseInvokedHandler)));
                    message.DefaultCommandIndex = 0;
                    await message.ShowAsync();   //Here is the point where the error occured
                }


    Thanks, Smiths

    Friday, September 6, 2013 3:09 AM

Answers

  • If you leave out these two commands, does it work?

    message.Commands.Add(new UICommand("Close", new UICommandInvokedHandler(this.CloseInvokedHandler))); message.DefaultCommandIndex = 0;

    If so, make sure your handlers are working properly.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Anne Jing Monday, September 16, 2013 3:38 AM
    Friday, September 6, 2013 1:02 PM
    Moderator