Пример #1
0
        public void UpdatedView(MediaItemsListModelItem mediaItem)
        {
            switch (mediaItem.ItemType)
            {
            case MediaItemType.Picture:
                PictureItemModel pictureModel = new PictureItemModel();
                pictureModel.LoadImage(mediaItem.GetMediaFileIsolatedStoragePath());
                Content         = pictureModel;
                ContentTemplate = PictureTemplate;
                break;

            case MediaItemType.Text:
                ContentTemplate = TextTemplate;
                break;

            case MediaItemType.Audio:
                Content = new AudioVideoItemModel()
                {
                    MediaSource = mediaItem.GetMediaFileIsolatedStoragePath()
                };
                ContentTemplate = AudioTemplate;
                break;

            case MediaItemType.Video:
                Content = new AudioVideoItemModel()
                {
                    MediaSource = mediaItem.GetMediaFileIsolatedStoragePath()
                };
                ContentTemplate = VideoTemplate;
                break;

            case MediaItemType.Undefined:
                ContentTemplate = UnknownTemplate;
                break;

            default:
                break;
            }
        }
 public void UpdatedView( MediaItemsListModelItem mediaItem )
 {
     switch( mediaItem.ItemType )
     {
         case MediaItemType.Picture:
             PictureItemModel pictureModel = new PictureItemModel();
             pictureModel.LoadImage( mediaItem.GetMediaFileIsolatedStoragePath() );
             Content = pictureModel;
             ContentTemplate = PictureTemplate;
             break;
         case MediaItemType.Text:
             ContentTemplate = TextTemplate;
             break;
         case MediaItemType.Audio:
             Content = new AudioVideoItemModel() { MediaSource = mediaItem.GetMediaFileIsolatedStoragePath() };
             ContentTemplate = AudioTemplate;
             break;
         case MediaItemType.Video:
             Content = new AudioVideoItemModel() { MediaSource = mediaItem.GetMediaFileIsolatedStoragePath() };
             ContentTemplate = VideoTemplate;
             break;
         case MediaItemType.Undefined:
             ContentTemplate = UnknownTemplate;
             break;
         default:
             break;
     }
 }