| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using ivf_tl_Operate.Converts;
- 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_Operate.CustomUserControls
- {
- /// <summary>
- /// StatusControl.xaml 的交互逻辑
- /// </summary>
- public partial class StatusControl : UserControl
- {
- public StatusControl()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 系统正在报警数量
- /// </summary>
- public int Count
- {
- get { return (int)GetValue(CountProperty); }
- set { SetValue(CountProperty, value); }
- }
- public static readonly DependencyProperty CountProperty =
- DependencyProperty.Register("Count", typeof(int), typeof(StatusControl), new PropertyMetadata(0, new PropertyChangedCallback(OnCountPropertyChangedCallback)));
- private static void OnCountPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- var source = d as StatusControl;
- var number = (int)e.NewValue;
- if (number > 0)
- {
- //source._abnormalText.Content = $"系统异常({number})";
- source._abnormalText.Content = $"{KeyToStringConvert.GetLanguageStringByKey("C0270")}({number})";
- source._normal.Visibility = Visibility.Collapsed;
- source._abnormal.Visibility = Visibility.Visible;
- }
- else
- {
- source._normal.Visibility = Visibility.Visible;
- source._abnormal.Visibility = Visibility.Collapsed;
- }
- }
- }
- }
|