123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using System;
- using System.Threading;
- using System.Windows;
- using System.Windows.Controls;
-
- namespace XHZB.Desktop
- {
- //定义委托
- public delegate void ChangeTextHandler(string text);
-
- /// <summary>
- /// RollCallPerfectionWindow.xaml 的交互逻辑
- /// </summary>
- public partial class RollCallPerfectionWindow : Window
- {
- //定义事件
- public event ChangeTextHandler ChangeTextEvent;
-
- public RollCallPerfectionWindow(string _name, string _pic)
- {
- InitializeComponent();
- this.Opacity = 1;
- txbName.Text = _name;
- }
-
- public void Name(string _name)
- {
- this.Opacity = 1;
- txbName.Text = _name;
- }
-
- /// <summary>
- /// </summary>
- /// <param name="sender">事件源</param>
- /// <param name="e">事件对象</param>
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- }
-
- /// <summary>
- /// 结束
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnEnd_Click(object sender, RoutedEventArgs e)
- {
- //ToolbarWindow.IsNotOperation = false;
-
- new Thread(new ThreadStart(new Action(() =>
- {
- Dispatcher.Invoke(new Action(() =>
- {
- txbName.Text = "";
- this.Opacity = 0;
- }));
- Thread.Sleep(200);
- Dispatcher.Invoke(new Action(() =>
- {
- ChangeTextEvent?.Invoke("关闭窗口");
- Hide();
- }));
- }))).Start();
- }
-
- /// <summary>
- /// 重新点名
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnNewRollCall_Click(object sender, RoutedEventArgs e)
- {
- RadioButton rdo = sender as RadioButton;
- //引发事件
- if (ChangeTextEvent != null)
- {
- ChangeTextEvent("重新点名");
- }
- new Thread(new ThreadStart(new Action(() =>
- {
- Dispatcher.Invoke(new Action(() =>
- {
- txbName.Text = "";
- this.Opacity = 0;
- }));
- Thread.Sleep(200);
- Dispatcher.Invoke(new Action(() =>
- {
- Hide();
- }));
- }))).Start();
- }
- }
- }
|