none
Problème messageDialog Exception de HRESULT : 0x80070005 (E_ACCESSDENIED) RRS feed

  • Question

  • bonjour a tous.

    Je ne comprend pas très bien comme marche cette fonction (MessageDialog), sur une page de mon application ca fonctionne et sur une autre page ca ne fonctionne pas :(

    Voilà le code de la page pour laquelle messageDialog fonctionne pas.

    '----------- Importations of classes -----------
    Imports Windows.UI.Popups
    Imports Windows.Storage
    Imports System.Text
    Imports Windows.Storage.Search
    Imports Windows.UI.Xaml
    Imports Windows.UI.Xaml.Controls
    Imports Windows.UI.Xaml.Navigation
    
    
    ' Pour en savoir plus sur le modèle d'élément Page vierge, consultez la page http://go.microsoft.com/fwlink/?LinkId=234238
    
    ''' <summary>
    ''' Une page vide peut être utilisée seule ou constituer une page de destination au sein d'un frame.
    ''' </summary>
    ''' 
    Public NotInheritable Class PageNomClient
        Inherits Page
    
        '----------- Declaration of variables -----------
        Dim positionDep As Windows.UI.Input.PointerPoint
        Dim Diff As Double
        Dim file As StorageFile
        Public NameClient As String
        Dim link As String
    
    
        '----------- Put the page into the cache memory  -----------
        Sub New()
            InitializeComponent()
            Me.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled
        End Sub
    
    
        '----------- Recover information from the last page navigation -----------
        Private Sub navigationHelper_LoadState(e As Navigation.NavigationEventArgs)
            Dim chemin As String = TryCast(e.Parameter, String)
            link = chemin
    
        End Sub
        Protected Overrides Sub OnNavigatedTo(e As Navigation.NavigationEventArgs)
            Dim chemin As String = TryCast(e.Parameter, String)
            link = chemin
    
        End Sub
        
        
        '----------- When the page is loading, we initialize the User Input -----------
        Private Sub Grid_Loaded(sender As Object, e As RoutedEventArgs)
            TextBoxNomClient.Text = ""
    
        End Sub
    
    
        '----------- Management of touch command to go to the next page -----------
        Public Sub Rect_PointerPressed(sender As Object, e As PointerRoutedEventArgs) Handles Rect.PointerPressed
            positionDep = e.GetCurrentPoint(Rect)   'We recover the first position of the finger (= pointer)
    
        End Sub
    
    
        '----------- Management of touch command to go to the next page -----------
        Private Async Sub Rect_PointerMoved(sender As Object, e As PointerRoutedEventArgs) Handles Rect.PointerMoved
            Dim positionArr As Windows.UI.Input.PointerPoint = e.GetCurrentPoint(Rect)                          'We recover the last position of the finger
            Diff = (positionDep.Position.X - positionArr.Position.X)
    
            Dim folder As StorageFolder = KnownFolders.DocumentsLibrary                                         'Initialize the base folder
            Dim sampleFile As StorageFolder
            sampleFile = Nothing                                                                'We recover the user input
    
            Dim client As StorageFolder = Await folder.GetFolderAsync(link)
    
            If (Diff > 300) Then
                If (TextBoxNomClient.Text IsNot "") Then
                    Try
                        sampleFile = Await client.CreateFolderAsync(TextBoxNomClient.Text, CreationCollisionOption.OpenIfExists)              'Creation of a new folder for the client if he is new
                        Dim lien As String = link + sampleFile.Name
                        Me.Frame.Navigate(GetType(PageClient), lien)                                                                                   'Go to the PageClient with the name of the client in parameter
                    Catch
                        'FAIRE UNE MESSAGE BOX POUR AFFICHIER ERREUR DE LECTURE FICHIER
                    End Try
    
                Else
    
    
                    Dim messageDialog = New MessageDialog("Enter the Customer Name.")
    
                    ' Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers 
                    messageDialog.Commands.Add(New UICommand("Ok"))
    
                    ' Set the command that will be invoked by default 
                    messageDialog.DefaultCommandIndex = 0
    
                    ' Set the command to be invoked when escape is pressed 
                    messageDialog.CancelCommandIndex = 1
    
                    ' Show the message dialog 
    
                    Await messageDialog.ShowAsync()
    
    
                End If
    
            End If
    
            e.Handled = True
        End Sub
    
    End Class


    lundi 28 avril 2014 11:17

Réponses

Toutes les réponses