02 2013 档案
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 o...
阅读全文
WPF Template
摘要:1.为什么用模板模板是用来定义(或重定义)对象的外观的好东西. WPF已经提供了Style来自定义外观, 那为什么还需要Template呢? 是因为Style只能让你一个一个地设置对象的属性, 但template用来改变对象的组织结构. Style就好象是更改一台电脑的配置, 你可以换个内存, 换个...
阅读全文
Template、ItemsPanel、ItemContainerStyle、ItemTemplate
摘要:Template是指控件的模板它代表的是一个控件的内部结构组成部分(Visual Tree)。如:Button的默认Template外面是一个边框,里面是文字描述。如果我们要把普通的文字Button改为图片按钮的话就必须要重写Button的模板,要在里面加上一个Image,即已经把Button的Te...
阅读全文
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 b...
阅读全文
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 heig...
阅读全文
Margin vs Padding
摘要:padding用在容器内部,margin用在容器外部 如图所示: 比如:padding-top:10px;是指容器内的内容距离容器的顶部有10个像素,是包含在容器内的;margin-top:10px;是指容器本身的顶部距离其他容器有10个像素,不饱含在容器内
阅读全文
How to bind listbox to data dynamically
摘要:In xamlIn xaml.csfor (int index = 0; index (item, "InnerList"); if (innerList!= null) { innerList.ItemsSource = data...
阅读全文
PreviewXXX event and XXX event
摘要:Most controls in WPF inherit a series ofeventsfromtheUIElementclass such asPreviewMouseMove(tunneling) andMouseMove(bubbling) events.Because these eve...
阅读全文
How to add nested MenuItem dynamically
摘要:How to add sub items to "Second Item" dynamicallyIn xaml file // Initialize context menu event ...
阅读全文
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 ...
阅读全文
Dispatcher
摘要:Dispatcher可为特定线程维护其按优先顺序排列的工作项队列。当在线程中创建了Dispatcher时,它将成为可与该线程关联的唯一Dispatcher,即使Dispatcher已经关闭。如果尝试获取当前线程的CurrentDispatcher,而此时该线程没有关联的Dispatcher,则将创建...
阅读全文
二维码生成与解析 (使用ThoughtWorks.QRCode)
摘要:二维码生成QRCodeEncoder qrCodeEncoder = new QRCodeEncoder();qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE;// support different modeqrCode...
阅读全文
Event
摘要:Multicast delegates are used extensively in event handling.Event source objects send event notifications to recipient objects that have registered to ...
阅读全文
软件调试实战
摘要:系统性调试方法13条黄金规则:理解需求制造失败简化测试用例:目的:排除不起作用的因素 ;减少测试用例的运行时间;最重要的是,使测试用例更容易调试。读取恰当的错误信息:重点关注首先出现的那些消息。检查显而易见的问题从解释和中分离出事实分而治之:整理一份清单,列出潜在问题以及如何调试它们(调试归根到底是...
阅读全文
When to Use Delegates Instead of Interfaces
摘要:Both delegates and interfaces enable a class designer to separate type declarations and implementation.A giveninterfacecan be inherited and implemente...
阅读全文
Delegate
摘要:Adelegateis a type that safely encapsulates a method, similar to a function pointer in C and C++.Unlike C function pointers, delegates are object-orie...
阅读全文
浙公网安备 33010602011771号