using Common.system;
using System;
using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using XHZB.Desktop.Utils;
using XHZB.Model;
namespace XHZB.Desktop
{
///
/// 黑板
///
public partial class ZBlackboardWindow : Window
{
private readonly ZBPageModel pageData = new ZBPageModel();
private readonly BlackboardNew myblackboard;
private readonly int serverReturnCode = 0;
//private readonly RegisterController registerController = new RegisterController();
///
/// 保存图片路径
///
private string Rfpath = string.Empty;
private Color Color = Colors.White;
private int Size = 3;
///
/// 黑板
///
public ZBlackboardWindow()
{
InitializeComponent();
myblackboard = new BlackboardNew(blackboard_canvas);
initData();
}
private void initData()
{
pageData.pagenum = 1;
pageData.currpage = 1;
pageData.menuList.Add(new ZBMenuModel()
{
Name = "铅笔",
Pic = "../Images/Blackboard/class_2s.png",
Selected = true
});
pageData.menuList.Add(new ZBMenuModel()
{
Name = "颜色",
Pic = "../Images/Blackboard/class_c1.png",
Selected = false
});
pageData.menuList.Add(new ZBMenuModel()
{
Name = "粗细",
Pic = "../Images/Blackboard/class_s1.png",
Selected = false
});
pageData.menuList.Add(new ZBMenuModel()
{
Name = "橡皮",
Pic = "../Images/Blackboard/class_3un.png",
Selected = false
});
pageData.menuList.Add(new ZBMenuModel()
{
Name = "黑板颜色",
Pic = "../Images/Blackboard/class_s5.png",
Selected = false
});
pageData.menuList.Add(new ZBMenuModel()
{
Name = "清空",
Pic = "../Images/Blackboard/class_6un.png",
Selected = false
});
pageData.menuList.Add(new ZBMenuModel()
{
Name = "撤销",
Pic = "../Images/Blackboard/class_4un.png",
Selected = false
});
pageData.menuList.Add(new ZBMenuModel()
{
Name = "恢复",
Pic = "../Images/Blackboard/class_5un.png",
Selected = false
});
pageData.menuList.Add(new ZBMenuModel()
{
Name = "退出",
Pic = "../Images/Blackboard/class_7un.png",
Selected = false
});
DataContext = pageData;
}
private void menu_item_Click(object sender, RoutedEventArgs e)
{
int clickindex = 0;
System.Collections.Generic.List