
Silverlight
千影
苦逼的码农一枚
展开
-
Silverlight DataGrid行背景分组着色
根据条件让特定的行背景着色写了几天都没找到好的办法,都是拖动滚动条之后才变色,很是头疼,终于找到一个简单方法e.Row.Background = (e.Row.DataContext as SourceModel).BG; 非常感谢作者分享!--------------------------------------------------------------源码---------转载 2013-01-23 15:27:35 · 496 阅读 · 0 评论 -
silverlight文件下载
4:首先在前台添加下载按钮代码: 后台代码如下: private void Download_Click(object sender, RoutedEventArgs e){ string filePath = "http://localhost:34270/ClientBin/test.rar"; WebRequest re原创 2013-03-26 17:57:23 · 755 阅读 · 0 评论 -
反射加载xaml页面
Assembly assem = Assembly.GetExecutingAssembly(); Page cw = assem.CreateInstance("Client.Views.UserInfo") as Page; this.ContentFrame.Content = cw;原创 2013-04-12 11:10:43 · 986 阅读 · 0 评论 -
silverlight用图片替代HyperlinkButton显示在Frame的功能
xaml代码:原创 2013-04-12 11:14:06 · 709 阅读 · 0 评论 -
http://hi.baidu.com/lizhenlin126
http://hi.baidu.com/lizhenlin126 点击打开链接原创 2013-04-12 15:52:20 · 862 阅读 · 0 评论 -
silverlight 加载动画(钟)
直接上代码:Client.Controls.LoginLoading.xaml:<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ed="http://sc原创 2013-04-16 17:52:55 · 535 阅读 · 0 评论 -
silverlight 背景平铺
类文件:/*Copyright (c) 2008, WiredPrairie.usAll rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions原创 2013-04-16 17:44:07 · 607 阅读 · 0 评论 -
[Silverlight]简单实现DataGrid使用CheckBox选择行
在DataGrid中使用CheckBox选择行时典型的错误就是CheckBox没有Binding到任何属性上,这样的话当拖动滚动条时CheckBox.IsChecked就会乱掉,如Demo中左边那个DataGrid所示。最直观的解决方法是禁用DataGrid的滚动条,或者在绑定的数据上添加一个用于绑定CheckBox的bool属性。其实只要在DataGrid.LoadingRow事件中将Che转载 2013-01-22 18:39:16 · 932 阅读 · 0 评论 -
Silverlight之DataGrid的列格式化日期
<sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Binding="{Binding Name}" Header="名称" IsReadOnly="True"/> <s转载 2013-01-23 17:07:25 · 684 阅读 · 0 评论 -
silverlight 边框虚线
<Rectangle RadiusX="5" RadiusY="5"Width="{Binding ElementName=g, Path=ActualWidth}"Height="{Binding ElementName=g, Path=ActualHeight}"Stroke="Blue" StrokeDashArray="5,2,1,2" StrokeThickness="2"/>原创 2013-01-28 17:19:48 · 828 阅读 · 0 评论 -
silverlight导出Excel
#region 导出DataGrid数据到Excel /// /// CSV格式化 /// /// 数据 /// 格式化数据 private static string FormatCsvField(string data) { return String.转载 2013-01-31 18:17:14 · 601 阅读 · 0 评论 -
silverlight分页控件DataPager使用要点
想必知道大家都会用web网页的分页控件,但silverlight分页控件的PageCount是不支持赋值的(了解知识有限,至少我不会),那怎么办呢我们知道DataPager分页是可以设置PageSize和Source,然后控件会自动显示最大页数,也就是PageCount,那么我们就可以以Source为出发点,因为Source是要绑定集合的,那么我们构建一个数据集,然后绑定,只要数据条数和数据源原创 2013-02-27 10:00:03 · 1000 阅读 · 0 评论 -
Silverlight之DatePicker日期格式化
DatePicker日期格式化DatePicker 控件有个默认的时间格式,它根据服务器上的时间格式来显示,若需要改变,可以通过以下方法进行修改:App.xaml.cs 中添加 public App() { this.Startup += this.Application_Startup; this.Unha原创 2013-03-13 17:08:41 · 2246 阅读 · 0 评论 -
iTextSharp 使用详解
PDF文件是目前比较流行的电子文档格式,在办公自动化(OA)等软件的开发中,经常要用到该格式,但介绍如何制作PDF格式文件的资料非常少,在网上搜来搜去,都转贴的是同一段“暴力”破解的方法,代码片断如下:StreamWriter pPDF=new StreamWriter(filePath); ArrayList xRefs=new ArrayList(); float转载 2013-03-19 16:45:11 · 1452 阅读 · 0 评论 -
silverlight页面保存为图片
自己整理了一下 直接上代码:private void button1_Click(object sender, RoutedEventArgs e) { SaveFileDialog saveDlg = new SaveFileDialog(); saveDlg.Filter = "jpg file format|*.jpg";原创 2013-03-20 16:54:05 · 1221 阅读 · 0 评论 -
silverlight页面保存为PDF
不知道什么原因 只能保存图片的一部分为PDF 纠结了很久 现在还是没弄出来现在把silverlight页面保存为PDF的方法做个笔记void CreateImgPdf(object sender, RoutedEventArgs e) { WriteableBitmap wb = new WriteableBitmap(LayoutRoot, nul转载 2013-03-20 16:35:33 · 1054 阅读 · 0 评论 -
Silverlight改变Header背景色
直接上代码:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Primitives="clr-namespace:System.Window原创 2014-01-13 16:12:11 · 935 阅读 · 0 评论