C#--工作笔记(直方图Page页)
2013-12-25 10:18
309 查看
<Page xmlns:my="clr-namespace:Health365IIProjectView" x:Class="Health365IIProjectView.HeartbeatStatisticsPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="800" Title="HeartbeatStatisticsPage" Loaded="Page_Loaded" SizeChanged="Page_SizeChanged" Background="DarkGray"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="100*"/> <RowDefinition Height="100*"/> </Grid.RowDefinitions> <my:HartHistogramControl Margin="0" Grid.Row="0" x:Name="hartHistogramControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> <my:HartListControl Grid.Row="1" HorizontalAlignment="Stretch" x:Name="hartListControl" VerticalAlignment="Stretch" /> </Grid> </Page>
===============================================================
using System; using System.Collections.Generic; using System.Linq; using System.Text; 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; using Health365IIProjectBLL; namespace Health365IIProjectView { /// <summary> /// HeartbeatStatisticsPage.xaml 的交互逻辑 /// </summary> public partial class HeartbeatStatisticsPage : Page { /// <summary> /// 当前应用程序 /// </summary> private App _thisApplication; /// 当前主逻辑类 private Health365IIMainLogic _mainLogic; /// 保存数组 private int[] _heartList; /// <summary> /// 从直方图中获取心搏模板的数据保存到列表中 /// </summary> private List<int> _listOneHeartBeat; /// <summary> /// 记录被点击的直方图索引 /// </summary> private int _index; public HeartbeatStatisticsPage() { _thisApplication = (App)Application.Current; _mainLogic = _thisApplication.MainLogic; InitializeComponent(); hartHistogramControl.UXEvent += new HartHistogramControl.user_OnClick(RefreshList); //进入直方图页面时,清空心搏模板列表 _listOneHeartBeat = new List<int>(); hartListControl.HartListControlListIndex(_listOneHeartBeat); } private void Page_SizeChanged(object sender, SizeChangedEventArgs e) { hartHistogramControl.SetData(_index, _heartList, 25, "毫秒"); } private void Page_Loaded(object sender, RoutedEventArgs e) { _heartList = _mainLogic.GetHeartRateData(); hartHistogramControl.SetData(_index, _heartList, 25, "毫秒"); //初始化分类模板心搏类型变化事件(N、V、S、O) _mainLogic.HeartTypesChangeEvent += new DlgtHeartChange(_mainLogic_HeartTypesChangeEvent); //初始化心搏个数变化事件(添加、删除心搏) _mainLogic.HeartCountChangeEvent += new DlgtHeartChange(_mainLogic_HeartCountChangeEvent); } /// <summary> /// 右键改变心电节点类型时,向逻辑层触发事件,刷新页面显示 /// </summary> /// <param name="heartIndex">心搏索引列表</param> private void _mainLogic_HeartTypesChangeEvent(List<int> heartIndex) { //同步刷新心搏模板显示 _listOneHeartBeat = _mainLogic.GetRateStatByIndex(_index); //发送给心搏模板,相应的刷新心搏模板的事件 hartListControl.HartListControlListIndex(_listOneHeartBeat); } /// <summary> /// 心搏个数变化时,刷新页面显示 /// </summary> /// <param name="heartIndex">心搏索引列表</param> private void _mainLogic_HeartCountChangeEvent(List<int> heartIndex) { //同步刷新心搏模板显示 _listOneHeartBeat = _mainLogic.GetRateStatByIndex(_index); //发送给心搏模板,相应的刷新心搏模板的事件 hartListControl.HartListControlListIndex(_listOneHeartBeat); } public void RefreshList(int index) { //接收Control的一个下标,根据下标判断点击的直方图 //传到逻辑层获取心搏模板的List集合,这个集合中应该有当前心率模板的集合 _index = index; _listOneHeartBeat = _mainLogic.GetRateStatByIndex(index); //发送给心搏模板,相应的刷新心搏模板的事件 hartListControl._selectCtrIndex = -1; hartListControl._oldScrValue = 0; hartListControl.HartListControlListIndex(_listOneHeartBeat); } } }
相关文章推荐
- C#--工作笔记(直方图单个UserControls)
- C#--工作笔记(直方图整体UserControls)
- 修改项目JDK版本的简单有效方法(工作笔记)
- HR 工作笔记
- Unity Manual 笔记01 第一章 使用Unity工作——资源工作流
- 最近的工作笔记
- WorkList工作笔记
- Eclipse IDE 使用技巧 (Eclipse工作空间小技巧)(自己的一些学习笔记和心得,记录下来,备忘录和复习使用)
- 我的工作笔记
- 工作笔记 2011.12.29
- 2015-12-29 工作笔记-2
- 各人工作笔记-centos5安装vsftpd
- 工作笔记之图标切换
- 工作笔记---js和java共同完成大写锁定提示
- 2016年10月10号工作笔记:NVR 实现ONVIF客户端异步事件机制
- 【OpenCV学习笔记 017】图像颜色分布直方图
- 关于nginx多域名SSL证书的工作笔记
- 笔记:在CentOS上开始你的工作
- 工作笔记