- 博客(16)
- 收藏
- 关注
转载 Use Immediate Window in Visual Studio
The immediate window is an immensely useful tool for debugging applications. You can use it to execute code statements that are valid in the context of your break point and inspect values.You can also
2013-02-18 15:31:51 1684
转载 WPF Template
1. 为什么用模板模板是用来定义(或重定义)对象的外观的好东西. WPF已经提供了Style来自定义外观, 那为什么还需要Template呢? 是因为Style只能让你一个一个地设置对象的属性, 但template用来改变对象的组织结构. Style就好象是更改一台电脑的配置, 你可以换个内存, 换个显卡, 但它还是一台电脑, 而Template则是把电脑整个换成一部汽车, 或者是
2013-02-18 14:51:27 8924
原创 Template、ItemsPanel、ItemContainerStyle、ItemTemplate
Template是指控件的模板它代表的是一个控件的内部结构组成部分(Visual Tree)。如:Button的默认Template外面是一个边框,里面是文字描述。如果我们要把普通的文字Button改为图片按钮的话就必须要重写Button的模板,要在里面加上一个Image,即已经把Button的Template修改了。在WPF中所有继承自contentcontrol类的控件都含有此属性,(继承
2013-02-18 11:49:57 8608
原创 How to choose WPF container controls
Usually you can set up the general layout with a Grid and use a few stackpanels here and there to do some specific stuff. Usually the performance is better with Grids and that Grids generally give you
2013-02-17 18:26:48 630
转载 Auto vs *
Auto and * are definitely not the same.When talking about RowDefinitions, Auto means that the size of the elements in that row will determine the height of that row.* means that the row's height
2013-02-17 17:13:11 404
转载 Margin vs Padding
padding用在容器内部,margin用在容器外部 如图所示: 比如:padding-top:10px;是指容器内的内容距离容器的顶部有10个像素,是包含在容器内的;margin-top:10px;是指容器本身的顶部距离其他容器有10个像素,不饱含在容器内
2013-02-17 14:51:04 459
原创 How to bind listbox to data dynamically
In xamlInnerList"/>In xaml.csfor (int index = 0; index { ListBoxItem item = OuterList.ItemContainerGenerator.ContainerFromIndex(index) as
2013-02-17 14:08:04 512
转载 PreviewXXX event and XXX event
Most controls in WPF inherit a series of events from the UIElement class such as PreviewMouseMove (tunneling) and MouseMove (bubbling) events.Because these events propagate, however, the events will
2013-02-17 12:41:35 793
原创 How to add nested MenuItem dynamically
How to add sub items to "Second Item" dynamicallyIn xaml file // Initialize context menu event Second
2013-02-16 18:51:58 558
原创 Customize the border of the control
Create a border with dot line and round corner How to create a border as the following graph shows for example, the effect for mouse hover/selected a list box item (Code in green font
2013-02-16 18:35:45 541
原创 Dispatcher
Dispatcher 可为特定线程维护其按优先顺序排列的工作项队列。当在线程中创建了 Dispatcher 时,它将成为可与该线程关联的唯一 Dispatcher,即使 Dispatcher 已经关闭。如果尝试获取当前线程的 CurrentDispatcher,而此时该线程没有关联的 Dispatcher,则将创建一个Dispatcher。A Dispatcher在创建时还创建Dispatcher
2013-02-16 11:13:07 1077
原创 二维码生成与解析 (使用ThoughtWorks.QRCode)
二维码生成QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; // support different modeqrCodeEncoder.QRCodeScale = 1;qrCodeEncoder.
2013-02-04 12:24:34 13068
原创 Event
Multicast delegates are used extensively in event handling. Event source objects send event notifications to recipient objects that have registered to receive that event. To register for an event, t
2013-02-02 15:46:21 730
原创 软件调试实战
系统性调试方法13条黄金规则:理解需求制造失败简化测试用例:目的:排除不起作用的因素 ;减少测试用例的运行时间;最重要的是,使测试用例更容易调试。读取恰当的错误信息:重点关注首先出现的那些消息。检查显而易见的问题从解释和中分离出事实分而治之:整理一份清单,列出潜在问题以及如何调试它们(调试归根到底是一种试错法trial-and-error);将环境更改和源代码更改区分开(跟踪环境的
2013-02-02 14:29:05 853
转载 When to Use Delegates Instead of Interfaces
Both delegates and interfaces enable a class designer to separate type declarations and implementation. A given interface can be inherited and implemented by any class or struct. A delegate can be c
2013-02-01 17:10:09 419
原创 Delegate
A delegate is a type that safely encapsulates a method, similar to a function pointer in C and C++. Unlike C function pointers, delegates are object-oriented, type safe, and secure. The type of a de
2013-02-01 15:55:39 851
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人