`
文章列表
In author's original post, there is one article that describe a base class that you can extend to create some Custom Binding markup extension.    Markup Extension is something like this in .xaml "{Binding Path=Name, Converter={StaticResource ResourceKey";     Binding Extension provide ...
XDocument and its relative class XElement are core classes of the Linq XML in .net 4.0.    how to convert to and from data object with XElement is something that should be on the common knowledge to the C# developers.   here we will discuss with an example.   Suppose that we have a StudentInfo ...
Suppose that you have a UserControl and you want to merge some resources (which defines the styles, template and etc).    Suppose again that we cannot add the style to Application or Window, whereas you might conflict with styles that may be used by other part of the application (typical e.g. when ...
In Previous post , we discussed how to load resource that is embedded in the wpf application. see How to use embedded Resource in WPF.   Here we are going to discuss another approach, where you can load a WPF resource at runtime.   Suppose that you have a resource that you know its pack URI, and ...
NOTE: do not confuse the embedded resource and the Resource in WPF. Embedded Resource is an old term that is used in Windows Form application, while the Resource is used in WPF.   Please see "Embedded and Resource" for more details.     Suppose that you have this layout of files    an ...
If you are familiar with the Dependency Property system in WPF, you may find that create a Dependency Property that is supposed to be readonly is a bit different from the create a normal Dependency Property.   From this part on, I will use DP as a short name for Dependency Property.     The majo ...
Let first take a prediction,  what is the result of the following code.        public static void ClosureForeachWithLambda() { var action = new List<Action>(); var list = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; foreach (var i in list) { action.Add(() = ...
In my previous post, I discussed the range operator in the scalar context, here we are further to discuss on operator tha is quite unique in the Perl programming lanaugae, that is the three dot operator.    ...      Some of the examples are referenced from the stackover post  http://stackoverflo ...
In my previous post, I discuss how to write with XmlWriter to a String, that is a workable solution, however, it by default will generate the text formatted.     It is good to visual, but it does not fit on well when you try to do some unit test on it.    Here is an seque example as how to contr ...
XmlWriter is a stream based Xml processor. The Stream based XML process is more effeicent in memory and low in CPU usage. however, it does not have convenient wasy as the DOM based one, where you can easily load and write to string.     here is an example shows how you can write with XmlWriter to ...
In my previous post, I disussesed with the reader the concept of metaclass and its internals. and in following post one usage of the python metaclass is discussed. Today another use of the metaclass will be discussed.   As a note, this article is inspired from this original post from stackoverflow. ...
In my previous post, I disussesed with the reader the concept of metaclass and its internals.  this post is inspired from this post from stackoverflow.      In this post, I will visit one of the use of meta class so so that we can control the access to the class/static variable through the use of ...
the base article is available here:  http://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python      to understand the metaclass in Python, there is some background that you should be aware in order to grasp the idea of metaclass and its foundation.     Part I:  Classes as object ...
If you are familiar with XDocument, you will know that this is now lega.   var xname = new XName("Condition");   however, you may need to use XName in some occasions, so how can the XName instance spring into existence?   The magics is the implicit conversion operator.   pub ...
To use XDocument with XPath, you will need to reference the following namespace.   using System.Xml using System.Xml.XPath   The former is useful to introduce XDocument, the later will add the Extension method to make it work well with the XPath. One of the method that we will introduce in ...
Global site tag (gtag.js) - Google Analytics