| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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
- {
- /// <summary>
- /// PicSourceUserControl.xaml 的交互逻辑
- /// </summary>
- 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; }
- }
- }
|