资源简介
简单的翻页时钟,通过WPF实现,可以进行再开发或是学习思路。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace FlipClockApp
{
public partial class App : Application
{
public App()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;
InitializeComponent();
}
private void Application_Startup(object sender StartupEventArgs e)
{
this.RootVisual = new MainPage();
}
private void Application_Exit(object sender EventArgs e)
{
}
private void Application_UnhandledException(object sender ApplicationUnhandledExceptionEventArgs e)
{
// If the app is running outside of the debugger then report the exception using
// the browser‘s exception mechanism. On IE this will display it a yellow alert
// icon in the status bar and Firefox will display a script error.
if (!System.Diagnostics.Debugger.IsAttached)
{
// NOTE: This will allow the application to continue running after an exception has been thrown
// but not handled.
// For production applications this error handling should be replaced with something that will
// report the error to the website and stop the application.
e.Handled = true;
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
}
}
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
{
try
{
string errorMsg = e.Exceptionobject.Message + e.Exceptionobject.StackTrace;
errorMsg = errorMsg.Replace(‘“‘ ‘\‘‘).Replace(“\r\n“ @“\n“);
System.Windows.Browser.HtmlPage.Window.Eval(“throw new Error(\“Unhandled Error in Silverlight Application “ + errorMsg + “\“);“);
}
catch (Exception)
{
}
}
}
}
- 上一篇:C#/.NET 学生管理系统控制台版含数据库
- 下一篇:C#实现双态按钮
相关资源
- Wpf_背景音乐
- WPF中的可以实现缩放拖拽功能的布局
- c#窗体编程显示鼠标位置;菜单程序;
- wpf美化tabcontroll并且支持gif动画
- WPF操作滚动条
- WPF数学用直尺
- WPF之DataGrid基础学习代码(新)
- WPF datagrid 表格复选框
- WPF 带CheckBox的TreeView
- WPF图片滚动效果
- 用于海康、大华等录像机的WPF视频播
- WPF中用于嵌入其他进程窗口的自定义
- WPF3D转圈与鼠标拖动图片移动 listvie
- WPF实现Expander折叠展开动画
- csWPF井字棋游戏
- WPF中不规则窗体与WindowsFormsHost控件的
- c#wpf chart绘图 源代码 示波器
- C#WPF 绘制几何图形 2D坐标 sin曲线
- WPF 关于C#代码实现ControlTemplate
- MVVM模式学习的
- wpf连接ACCESS数据库
- C#实现socket通讯
- wpf实现本地图像文件打开与保存
- WPF对比WinForm
- c# scoket异步通信代码
- WPF导出Excel
- WPF自定义控件库_可实现QQ音乐播放器
- WPF中绘制3D地表图,效果和matlab类似
- WpfApplication 界面窗口变换效果的保存
- WPF TreeView递归异步绑定
评论
共有 条评论