using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace ivf_tl_Manage.UserControls { /// /// PicSourceUserControl.xaml 的交互逻辑 /// public partial class PicSourceUserControl : UserControl { public PicSourceUserControl() { InitializeComponent(); this.Visibility = Visibility.Collapsed; } public string ImageInfoString { get { return (string)GetValue(ImageInfoStringProperty); } set { SetValue(ImageInfoStringProperty, value); } } public static readonly DependencyProperty ImageInfoStringProperty = DependencyProperty.Register("ImageInfoString", typeof(string), typeof(PicSourceUserControl), new PropertyMetadata(null)); public ImageSource ImageSourceUrl { get { return (ImageSource)GetValue(ImageSourceUrlProperty); } set { SetValue(ImageSourceUrlProperty, value); } } public static readonly DependencyProperty ImageSourceUrlProperty = DependencyProperty.Register("ImageSourceUrl", typeof(ImageSource), typeof(PicSourceUserControl), new PropertyMetadata(null, new PropertyChangedCallback(ImageSourceUrlPropertyChangedCallback))); private static void ImageSourceUrlPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (!(d is PicSourceUserControl source)) return; if (e.NewValue == null) { source.Visibility = Visibility.Collapsed; return; } if (!(e.NewValue is ImageSource newValue)) { source.Visibility = Visibility.Collapsed; return; } source.Visibility = Visibility.Visible; } public string ImageUrl { get; set; } public long ImageId { get; set; } public int developTime { get; set; } } }