private void Para_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Illus") { IllusPara Para = ( IllusPara )sender; Para.PropertyChanged -= Para_PropertyChanged; ImagesView.ItemsSource = new ImageThumb[] { Para.ImgThumb }; } }
private void SetImage(IllusPara Para) { if (Para.ImgThumb == null || Para.ImgThumb.IsDownloadNeeded) { Para.PropertyChanged += Para_PropertyChanged; ContentIllusLoader.Instance.RegisterImage(Para); } else { ImagesView.ItemsSource = new ImageThumb[] { Para.ImgThumb }; } }
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container) { FrameworkElement element = ( FrameworkElement )container; if (item is IllusPara) { IllusPara Para = ( IllusPara )item; if (Para.EmbedIllus) { ContentIllusLoader.Instance.RegisterImage(Para); return(( DataTemplate )element.FindName("IllusEmbed")); } else { return(( DataTemplate )element.FindName("IllusIcon" + (IsHorizontal ? "H" : "V"))); } } return(( DataTemplate )element.FindName(IsHorizontal ? "Horizontal" : "Vertical")); }