12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- using Aitex.Core.RT.Log;
- 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 MECF.Framework.UI.Core.Control
- {
- /// <summary>
- /// SwitchDialog.xaml 的交互逻辑
- /// </summary>
- public partial class SwitchDialog : Window
- {
- public Action<bool> CommandDelegate;
- public bool IsOpen { get; set; }
- public bool IsOpenChecked { get; set; }
- public bool IsCloseChecked { get; set; }
- public bool IsSave { get; set; }
- private string _deviceName;
- public string DeviceName
- {
- get
- {
- return _deviceName;
- }
- set
- {
- _deviceName = value;
- this.TxtDeviceName.Text = value;
- }
- }
- public SwitchDialog()
- {
- InitializeComponent();
- }
- protected override void OnSourceInitialized(EventArgs e)
- {
- base.OnSourceInitialized(e);
- opencheck.IsChecked = IsOpen;
- closecheck.IsChecked = !IsOpen;
- }
- private void RadioButton_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- IsOpen = true;
- }
- catch (Exception ex)
- {
- LOG.Error(ex.Message);
- }
- }
- private void RadioButton_Click_1(object sender, RoutedEventArgs e)
- {
- try
- {
- IsOpen = false;
- }
- catch (Exception ex)
- {
- LOG.Error(ex.Message);
- }
- }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- IsSave = false;
- Close();
- }
- private void Button_Click_1(object sender, RoutedEventArgs e)
- {
- IsSave = true;
- Close();
- }
- }
- }
|