- 浏览: 217305 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
zhangwei412827_:
[flash=200,200][/flash]
js 关键字 in 的使用方法 -
flycatdeng:
.classpath文件在哪里?
AndEngine示例运行环境搭建过程 -
revol:
请问,你是如何调用LSMessage,并弹出窗口的?
Silverlight模拟MSN和QQ即时提示消息框
xmal代码(Loading.xaml):
<UserControl x:Class="Longshine.SLLib.CommonXaml.Loading" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Grid x:Name="LayoutRoot" Width="Auto" Height="Auto"> <Grid Background="Black" Opacity="0.2"></Grid> <Canvas Width="320" Height="50"> <Rectangle RadiusX="8" RadiusY="8" Stroke="{x:Null}" Fill="#19000000" Height="49" Width="316" Canvas.Left="6" Canvas.Top="3"/> <Rectangle RadiusX="8" RadiusY="8" Stroke="{x:Null}" Fill="#19000000" Height="48" Width="316" Canvas.Left="5" Canvas.Top="3"/> <Border Height="50" Width="320" Background="#FFFFFFFF" BorderBrush="#FFACACAC" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"> <Rectangle RadiusX="8" RadiusY="8" Stroke="{x:Null}" Margin="1,1,1,1"> <Rectangle.Fill> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFFFFFFF"/> <GradientStop Color="#FFE9E9E9" Offset="1"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> </Border> </Canvas> <Grid Width="320" Height="50" VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="5*" /> <ColumnDefinition Width="10*" /> <ColumnDefinition Width="80*" /> <ColumnDefinition Width="5*" /> </Grid.ColumnDefinitions> <Image Stretch="None" Source="Images/loading.png" Grid.Column="1" Opacity="0.3" /> <Image x:Name="loadingImage" Stretch="None" Source="Images/loading.png" Grid.Column="1" RenderTransformOrigin="0.5,0.5"> <Image.RenderTransform> <RotateTransform Angle="0"></RotateTransform> </Image.RenderTransform> </Image> <TextBlock x:Name="titleText" FontFamily="Calibri" FontSize="13" Foreground="#FF000000" HorizontalAlignment="Left" Grid.Column="3"/> <TextBlock Text="系统处理:" x:Name="loadingText" FontFamily="Verdana" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="2"/> </Grid> </Grid> <UserControl.Resources> <Storyboard x:Name="storyboard"> <DoubleAnimation Storyboard.TargetName="loadingImage" Duration="0:0:0.7" To="360" Storyboard.TargetProperty="(UIElement.RenderTransform).RotateTransform.Angle" RepeatBehavior="Forever"></DoubleAnimation> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="loadingText" Storyboard.TargetProperty="Opacity" RepeatBehavior="Forever"> <SplineDoubleKeyFrame KeyTime="00:00:0.0" Value="0"/> <SplineDoubleKeyFrame KeyTime="00:00:0.5" Value="1"/> <SplineDoubleKeyFrame KeyTime="00:00:1.0" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </UserControl.Resources> </UserControl>
CS代码(Loading.xaml.cs):
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 Longshine.SLLib.CommonXaml { public partial class Loading : UserControl { public string Title { get { return this.titleText.Text; } set { this.titleText.Text = value; } } public Loading() { InitializeComponent(); this.storyboard.Begin(); } public void SetLoadingText(string text) { this.loadingText.Text = "系统处理: " + text; } } }
应用代码(LSWindow.cs):
using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Longshine.SLLib.CommonXaml; using System.Collections.Generic; using Longshine.SLLib.InputControls; using System.Threading; using System.Windows.Threading; using Telerik.Windows.Controls; using ClientUtils; namespace Longshine.SLLib { public class LSWindow { private static Loading loading; static LSWindow() { System.Windows.Controls.Control rootPage = Application.Current.RootVisual as System.Windows.Controls.Control; Panel panel = VisualTreeHelper.GetChild(rootPage, 0) as Panel; int count = VisualTreeHelper.GetChildrenCount(rootPage); if (loading == null) { loading = new Loading(); loading.Visibility = Visibility.Collapsed; panel.Children.Add(loading); } } public static void ShowLoading(string message) { if (loading != null) { loading.Dispatcher.BeginInvoke(() => { loading.Visibility = Visibility.Visible; loading.SetLoadingText(message); }); } } public static void HideLoading() { if (loading != null) loading.Dispatcher.BeginInvoke(() => loading.Visibility = Visibility.Collapsed); } /// <summary> /// 记录大批量信息,提示用户 /// </summary> /// <param name="msg"></param> public static void MessagePrompt(List<string> msg) { var msgPromptForm = new MessagePromptForm(); msgPromptForm.lbMessage.ItemsSource = msg; msgPromptForm.Show(); } /// <summary> /// 一般性弹出提示框 /// </summary> /// <param name="msg"></param> public static void Alert(object msg) { RadWindow.Alert(new TextBlock { Text = msg.ToString(), Width = 300, TextWrapping = TextWrapping.Wrap }); } /// <summary> /// 捕获异常信息,提示用户,并记录日志 /// </summary> /// <param name="ex">异常</param> public static void AlertError(System.Exception ex) { AlertError(ex, true); } /// <summary> /// 捕获异常信息,提示用户,是否记录日志 /// </summary> /// <param name="ex">异常</param> /// <param name="isLog">是否记录日志</param> public static void AlertError(System.Exception ex, bool isLog) { if (ex == null) return; RadWindow.Alert(new TextBlock { Text = "出现异常:" + ex.Message + "\n可能原因:" + ex.StackTrace, Width = 300, TextWrapping = TextWrapping.Wrap }); if(isLog) LogFactory.FileLogger.Log("出现异常:" + ex.Message + ", 可能原因:" + ex.StackTrace, LOGLEVEL.FATAL); } } }
界面:
注明:全局等待提示框代码来自于EasySL
发表评论
-
以假乱真解决WebBrowser遮挡SL控件的问题
2010-09-02 11:49 1549查找了很多官网文档、资料、论坛,WebBrowser遮 ... -
Path的Data生成归总
2010-08-26 11:53 1330Path的Data数据有三种生 ... -
Path Data 常用图形(整理中....)
2010-08-26 11:38 17271 三角形 <Path Stroke="# ... -
根据类型名称获取类型的对象
2010-08-23 10:12 1679private Type GetTypeCore(string ... -
多级菜单导航工具条
2010-08-10 14:08 1607多级菜单导航工具条 animated multi-leve ... -
Image控件的属性扩展
2010-08-07 10:56 1094扩展Image的属性,显示Web下的图片。 ... -
Silverlight模拟MSN和QQ即时提示消息框
2010-07-23 15:17 2219LSMessagePopup.cs: using Syste ... -
动态加载XAML文件(2)
2010-06-09 22:28 1500C#代码部分 using System; using Sy ... -
动态加载XAML文件
2010-06-09 20:34 3743Silverlight 2 提供了 System.W ... -
允许空值的下拉框
2010-05-27 09:56 1356LSComboBoxItem.cs using Sys ... -
分析silverlight里的URI引用资源文件的各种情况
2010-05-08 17:01 1780主要介绍一下在silverlight里的资源文件(图 ... -
Silverlight Validation
2010-05-08 14:57 1231Silverlight DataForm Valida ... -
Silverlight专业网站(整理中...)
2010-05-08 13:24 10911 Microsoft Silverlight htt ... -
Silverlight中常用方法使用总结(整理中...)
2010-05-08 11:40 8531 获取URL地址 Url = Application.Cu ... -
Silverlight同步通信
2010-05-08 11:29 2314SL调用WCF方法,默认是异步的,但有些情况,我们使用同 ...
相关推荐
考虑程序的友好性,当程序在执行一项耗时操作时,界面应告诉用户“程序还在运行中”,那么,QT中进度对话框(QProgressDialog)可以满足要求
参数 等待时间, 整数型 .子程序 超级延时, , 公开, 高精度延时,cpu占用低,窗口不卡死,一次最大可延时几年 (无返回值) .参数 延时间隔, 整数型, , 1000微秒 = 1毫秒 ; 1000毫秒 = 1秒 .参数 延时单位, 整数型, 可空...
WeixinConfigurer是微信上下文全局配置类,里面包含了处理微信类扫描、微信消息重排处理、微信方法执行线程池大小、微信方法调用超时阀值等方面的配置,packages包扫描配置是唯一必须的配置部分,这个配置在快速入门...
1.2.3 对话框类 6 1.2.4 添加消息响应 7 第2章 对话框应用程序 9 2.1 模态对话框 9 2.1.1 实例:使用MFC实现模态对话框 9 2.1.2 实例:使用Win32 API实现模态对话框 10 2.2 非模态对话框 12 2.2.1 实例:...
1.2.3 对话框类 6 1.2.4 添加消息响应 7 第2章 对话框应用程序 9 2.1 模态对话框 9 2.1.1 实例:使用MFC实现模态对话框 9 2.1.2 实例:使用Win32 API实现模态对话框 10 2.2 非模态对话框 12 2.2.1 实例:...
工作量和工资的统计,包括个人的统计(工资条)和总体统计(统筹全局)。 四. 提供形象化的图表来显示统计结果,为您更加直观的决策提供依据。 另外在的主界面上我们为您提供10幅精心挑选的背景画面来适应不同的...
(79) 我需要在我的程序中设置全局变量,以使文档中的所有类都能访问。我应该吧它放到哪儿? 68 (80) 我听说MFC可以发现内存漏洞,我怎样使用该特性? 68 (81) 我怎样才能在我的应用程序中循环浏览已经打开的文档...
修改扩展界面支持库一,为“树形框”增加多态检查框功能,相应地添加了多个与检查框相关的属性、方法和事件。 17. 修改高级表格支持库,允许“复制选定文本()”“剪切选定文本()”在“允许选择块”属性为假时复制...
12.10 打开窗口的等待提示 12.11 在打开的窗口中返回数据 12.12 创建弹出窗口 12.13 不允许窗口出现滚动条 12.14 页面打开的同时打开另外两个窗口 12.15 慢慢变大的窗口 12.16 设置新打开的窗口为活动窗口 12.17 ...
12.10 打开窗口的等待提示 12.11 在打开的窗口中返回数据 12.12 创建弹出窗口 12.13 不允许窗口出现滚动条 12.14 页面打开的同时打开另外两个窗口 12.15 慢慢变大的窗口 12.16 设置新打开的窗口为活动窗口 12.17 ...
11.4.1 改变录音提示音长度 264 11.4.2 速度和音量控制 264 11.4.3 事务录音 264 11.4.4 WAVE文件偏移量放音 268 11.4.5 压缩式录音 268 11.4.6 回声消除资源 269 11.4.7 GSM和G.726语音编码 269 11.5 来电...
3. 饼图小工具已经出现在面板中,并等待你继续配置: 1. '项目或保存的过滤器' — 输入项目或过滤器的名称,或点击'高级搜索'链接搜索项目或已经保存的过滤器。 2. '统计类型' — 选择饼图按照哪个字段进行分组统计...
第1章 消息框 001 如何创建消息框? 002 如何设置消息框标题? 003 如何使用资源串创建消息框? 004 如何使用资源串动态显示消息框内容? 005 如何使消息框显示问号图标? 006 如何使消息框显示“是/否”按钮? 007 如何...
JavaScript:定义行为和动作 (基于对象和事件驱动的客户端脚本语言;也是一种广泛应用于客户端Web开发的脚本语言) 基于对象:网页中的一切...22.全局函数:不用任何对象点(.)就可以调用--可用于所有的 JavaScript ...
9:加入全局进度条和状态条文本提示! 10:修复已发现的各种小bug,使得程序更加安全。 11:加快添加报单写入的速度 12:修复有时候子操作框占用屏幕的BUG 13:优化程序操作和显示速度 8-20 1:增加帐号列表显示 2:...