public static async Task<FrameworkElement> MakePreviewControl(LinkViewModel linkViewModel, CancellationToken cancelSource, object existingControl, bool full = false)
        {
            var preview = await SnooStreamViewModel.SystemServices.RunAsyncIdle(() => 
                {
                    var result = Preview.LoadLinkPreview(linkViewModel.Content);
                    FinishLoad(result, cancelSource);
                    return result;
                }, cancelSource);
            if (linkViewModel.Content is SelfViewModel && full)
            {
                if (existingControl is CardMarkdownControl)
                {
					((CardMarkdownControl)existingControl).SetBinding(FrameworkElement.DataContextProperty, new Binding() { Path = new PropertyPath("Markdown"), Source = linkViewModel.Content } );
                    return existingControl as FrameworkElement;
                }
                else
                {
                    var newControl = new CardMarkdownControl();
					((CardMarkdownControl)newControl).SetBinding(FrameworkElement.DataContextProperty, new Binding() { Path = new PropertyPath("Markdown"), Source = linkViewModel.Content });
					return newControl;
                }
            }
			if (preview is PreviewText)
			{
                if (existingControl is CardPreviewTextControl)
                {
                    ((CardPreviewTextControl)existingControl).DataContext = preview;
                    return existingControl as FrameworkElement;
                }
                else
                {
                    return new CardPreviewTextControl { DataContext = preview, MaxHeight = 175 };
                }
			}
			else if (preview is PreviewImage)
			{
                if (existingControl is CardPreviewImageControl)
                {

                    ((CardPreviewImageControl)existingControl).DataContext = preview;
                    return existingControl as FrameworkElement;
                }
                else
                {
                    return new CardPreviewImageControl { DataContext = preview };
                }
			}
			else
			{
				throw new NotImplementedException(string.Format("cant convert value of type {0} to type of Preview", preview.GetType().FullName));
			}
		}
 public SoloContentStreamViewModel(LinkViewModel linkVM)
 {
     CurrentSelected = linkVM;
     Links = new ObservableCollection<ILinkViewModel>(new ILinkViewModel[] { linkVM });
 }
        public void GotoEditPost(ViewModelBase currentContext, LinkViewModel source)
        {
			source.IsEditing = true;
        }
 public SelfTextLinkViewModel(LinkViewModel context, string url, string title)
 {
     AuthorFlairText = context.Link.AuthorFlairText;
     Author = context.Link.Author;
     Subreddit = context.Link.Subreddit;
     Title = title;
     Url = url;
     CreatedUTC = context.Link.CreatedUTC;
     Id = context.Link.Id;
     Votable = context.Votable;
     GotoWeb = new RelayCommand(() =>
     {
         SnooStreamViewModel.NavigationService.NavigateToWeb(Url);
     });
     GotoComments = new RelayCommand(() =>
     {
         var localTemp = Url;
         SnooStreamViewModel.NavigationService.GoBack();
     });
     GotoUserDetails = context.GotoUserDetails;
     LazyContent = new Lazy<ContentViewModel>(() => SnooStream.ViewModel.Content.ContentViewModel.MakeContentViewModel(url, title, this, null));
 }