using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
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.Shapes;
using XHZB.Model;
using Common.ZB;
using XHZB.Desktop.Utils;
using Common.system;
using System.Windows.Media.Animation;
using System.Threading;
using XHZB.Desktop.WebSocket;
namespace XHZB.Desktop
{
///
/// ToolbarWindow.xaml 的交互逻辑
///
public partial class ToolbarWindow : Window
{
#region 字段
///
/// 屏幕宽
///
internal double pwidth = SystemParameters.PrimaryScreenWidth;
///
/// 屏幕高
///
internal double pHeight = SystemParameters.PrimaryScreenHeight;
///
/// 工具栏数据
///
internal ToolbarModel pageData = new ToolbarModel();
///
/// 是否已打开课堂工具二级列表
///
private bool heibanshow = false;
private bool isTool = true;
#region 当前已打开页面
///
/// 是否已打开个人空间
///
public static bool IsOpenUserCenterWindow = false;
///
/// 是否已打开课堂点名
///
public static bool IsOpenRollCallWindow = false;
///
/// 是否已打开考勤页面
///
public static bool IsOpenAttendanceWindow = false;
#endregion 当前已打开页面
#endregion
#region 初始化
public ToolbarWindow()
{
InitializeComponent();
txbName.Text = APP.LoginUser.username;
heiban_btn.Click += Heiban_btn_Click;
pizhu_btn.Click += Pizhu_btn_Click;
Topmost = true;
Left = pwidth - 300;
Top = (pHeight - 568) / 2;
pageData.menuList.Add(new ToolbarMenu()
{
Name = "个人空间",
Pic = "../Images/ToolBar/我的备课@2x.png"
});
pageData.menuList.Add(new ToolbarMenu()
{
Name = "开始直播",
Pic = "../Images/ToolBar/直播@2x.png"
});
pageData.menuList.Add(new ToolbarMenu()
{
Name = "抢答点名",
Pic = "../Images/ToolBar/抢答@2x.png"
});
pageData.menuList.Add(new ToolbarMenu()
{
Name = "课堂工具",
Pic = "../Images/ToolBar/黑板01@2x.png"
});
pageData.menuList.Add(new ToolbarMenu()
{
Name = "本节考勤",
Pic = "../Images/ToolBar/本节考勤01@2x.png"
});
pageData.menuList.Add(new ToolbarMenu()
{
Name = "结束直播",
Pic = "../Images/ToolBar/下课@2x.png"
});
DataContext = pageData;
Thread t = new Thread(new ThreadStart(startSocket))
{
IsBackground = true
};
t.Start();
}
#endregion
#region 事件
///
/// 模块点击
///
///
///
private void toolbar_item_Click(object sender, RoutedEventArgs e)
{
int clickindex = 0;
List