private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (cbo_typedoc.SelectedItem != null)
     {
         // Create an instance of the open file dialog box.
         var openDialog = new OpenFileDialog();
         // Set filter options and filter index.
         openDialog.Filter =
             "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png";
         openDialog.FilterIndex = 1;
         openDialog.Multiselect = false;
         // Call the ShowDialog method to show the dialog box.
         bool?userClickedOk = openDialog.ShowDialog();
         // Process input if the user clicked OK.
         if (userClickedOk == true)
         {
             if (openDialog.Files != null && openDialog.Files.Count() > 0 && openDialog.File != null)
             {
                 FileStream stream       = openDialog.File.OpenRead();
                 var        memoryStream = new MemoryStream();
                 stream.CopyTo(memoryStream);
                 image              = memoryStream.GetBuffer();
                 formScanne         = new UcImageScanne(memoryStream, SessionObject.ExecMode.Creation);
                 formScanne.Closed += new EventHandler(GetInformationFromChildWindowImagePreuve);
                 formScanne.Show();
             }
         }
     }
 }
        private void hyperlinkButtonPropScannee__Click(object sender, RoutedEventArgs e)
        {
            if (dgListePiece.SelectedItem != null)
            {
                ObjDOCUMENTSCANNE selectObj = (ObjDOCUMENTSCANNE)this.dgListePiece.SelectedItem;
                if (selectObj.CONTENU != null)
                {
                    MemoryStream memoryStream  = new MemoryStream(selectObj.CONTENU);
                    var          ucImageScanne = new UcImageScanne(memoryStream, SessionObject.ExecMode.Modification);
                    ucImageScanne.Show();
                }
                else
                {
                    Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                    service.DocumentScanneContenuCompleted += (s, args) =>
                    {
                        if ((args != null && args.Cancelled) || (args.Error != null))
                        {
                            return;
                        }

                        MemoryStream memoryStream  = new MemoryStream(args.Result.CONTENU);
                        var          ucImageScanne = new UcImageScanne(memoryStream, SessionObject.ExecMode.Modification);
                        ucImageScanne.Show();
                    };
                    service.DocumentScanneContenuAsync(selectObj);
                    service.CloseAsync();
                }
            }
        }