WPF 和 Silverlight 的异同点

本文讨论WPF 和 Silverlight 的异同点, WPF 为微软主推的桌面应用程序(多为C/S结构)技术平台,而Silverlight是微软主推富客户端网页应用程序(多为B/S结构)技术平台。  1. WPF 和Silverlight的类似点: a.       都是支持Xaml 语言的 b.      都支持 DEPENDENCY PROPERTIES c.       都支持通用...
阅读(975) 评论(0)

How to stop the gridspliter when the height or width reach the thresholds

1. Declare three private fields private double scrollChange; private double widthThreshold = 100; private double heightThreshold = 100;   2. Add the events for gridspliter   For how to d...
阅读(803) 评论(0)

Let the ListViewItem wdith update according to the ListView's width

1. Add this code in the control load Decorator borderForSourceListView = VisualTreeHelper.GetChild(this.sourceListView, 0) as Decorator; ScrollViewer scrollViewerForSourceListView = bo...
阅读(467) 评论(0)

How can I create a data binding in code using WPF?

When creating UI elements in code it is often necessary to programmatically bind them to data. Fortunately this is relatively straightforward as the following code-snippet using the Binding object fro...
阅读(766) 评论(0)

WPF BackgroundWorker vs. Dispatcher

The main difference between the Dispatcher and other threading methods is that the Dispatcher is not actually multi-threaded. The Dispatcher governs the controls, which need a single thread to functio...
阅读(1015) 评论(0)

Working With The WPF Dispatcher

Proper use of threads can greatly increase the responsiveness of your WPF applications.  Unfortunately, you can't update any UI controls from a thread that doesn't own the control.  In .NET 2.0, you u...
阅读(904) 评论(0)

在WPF 中使用 BackgroundWorker

1. MainWindow.xaml  <Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/x...
阅读(3163) 评论(0)

WPF Image element locks my local file

WPF Image element locks my local file     When using the Image element and specifying a local resource Uri in the Source attribute that resource will be locked by your application's process....
阅读(814) 评论(0)

Forcing WPF to use a specific Windows theme

WPF comes with a few theme assemblies, one for each Windows theme (Luna, Royale and Aero and the fallback theme, Classic.) Usually the theme is loaded according to your current system theme, but if yo...
阅读(700) 评论(0)

Smooth Pixel Scrolling in WPF ListView / ListBox

WPF comes with lots of fun and advantages. We can change the look and behavior of a control very easily which would have been very cumbersome when we are in normal winforms applications. WPF has few f...
阅读(1199) 评论(0)

WPF 继承自定义的控件

WPF 继承自定义的控件 1.创建一个BaseControl.cs namespace Test.Control { using System; using System.Windows; using System.Windows.Controls; using System.Windows.Input; /// ///...
阅读(3549) 评论(1)

WPF 中资源路径的问题

WPF 中资源路径的问题 1. 引用当前工程的资源(注意xxxx.png的build action 应设置为Resource 或Embedded Resource)   2.  引用其它工程的资源  (注意xxxx.png的build action 应设置为Resource 或Embedded Resource)   3. 引用相对路径下的资源(注意最好将xxx.png 的cop...
阅读(5835) 评论(2)

WPF 自定义grid spliter的 Style

WPF 自定义grid spliter的 Style: ...
阅读(2223) 评论(0)

WPF 在ResourceDictionary文件中使用自定的属性作为trigger 的target

1. 定义一个属性DependencyProperty(在对应控件的代码文件中) /// /// Register the Selected to the DependencyProperty /// public static readonly DependencyProperty SelectedProperty =...
阅读(1752) 评论(0)

WPF 中listView.ScrollIntoView失效的问题

使用listView.ScrollIntoView(item) 想让滚动条自动导航到这个item,但如果在单线程中处理这个有时会失灵,就是你明明调用了,但是滚动条没任何反应。 问题类似这里提到的http://social.msdn.microsoft.com/Forums/en/wpf/thread/1223c316-c7e2-48ce-a05a-3cd6fa502036 解决办法是让另外...
阅读(3329) 评论(0)
20条 共2页1 2 下一页 尾页
    • 访问:573359次
    • 积分:8582
    • 等级:
    • 排名:第2090名
    • 原创:252篇
    • 转载:26篇
    • 译文:3篇
    • 评论:199条
    专注于SharePoint+BI 及.net平台的一码农。微软SharePoint server 方向MVP https://mvp.microsoft.com/en-us/mvp/Cheng%20Cheng-5000549