Пример #1
0
 private void AppListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems != null)
     {
         MainModel mm   = e.AddedItems[0] as MainModel;
         string    path = mm.Photo;
         if (path.Contains("pic"))
         {
             cameraViewModel.PicVisibilty        = Visibility.Visible;
             cameraViewModel.PicButtonVisibilty  = Visibility.Collapsed;
             cameraViewModel.PicListVisiblity    = Visibility.Collapsed;
             cameraViewModel.PlayerVisiblity     = Visibility.Collapsed;
             cameraViewModel.PicContentVisibilty = Visibility.Visible;
             cameraViewModel.PicSource           = new BitmapImage(new Uri(path));
             //  imgPhone.Source = cameraViewModel.PicSource;
             cameraViewModel.OpenImageByPath(path);
         }
         else
         {
             cameraViewModel.PlayerVisiblity     = Visibility.Visible;
             cameraViewModel.PicListVisiblity    = Visibility.Collapsed;
             cameraViewModel.PicVisibilty        = Visibility.Collapsed;
             cameraViewModel.PicButtonVisibilty  = Visibility.Collapsed;
             cameraViewModel.PicContentVisibilty = Visibility.Collapsed;
             sourcePlayer.VideoSource            = new VideoCaptureDevice(videoStr);
             sourcePlayer.Start();
         }
     }
 }