Quantcast
Channel: .Net Examples
Browsing all 61 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Builder Design Pattern

Builder focuses on constructing a complex object step by step and final step will returns the object. The process of constructing an object should be generic so that it can be used to create different...

View Article


Image may be NSFW.
Clik here to view.

Prototype Design Pattern

Prototype design pattern is a pattern where new instances of a class are created by cloning an initial object.Reasons for using this design pattern are, - Creating an object is time consuming and a...

View Article


Image may be NSFW.
Clik here to view.

Adapter Design Pattern

What is Adapter Pattern?An adapter helps two incompatible interfaces to work together. This is the real world definition for an adapter. Adapter design pattern is used when you want two different...

View Article

Image may be NSFW.
Clik here to view.

Proxy Design Pattern

The proxy design pattern allows you to provide an interface to other objects by creating a wrapper class as the proxy. The wrapper class, which is the proxy, can add additional functionality to the...

View Article

Image may be NSFW.
Clik here to view.

Decorator Design Pattern

The decorator design pattern allows you to add features to an object dynamically. Inheritance is used to extend the abilities of ‘a class’. Unlike inheritance, we can choose any single object of a...

View Article


Image may be NSFW.
Clik here to view.

Facade Design Pattern

The facade design pattern allows us, to provide a simplified interface from multiple class libraries. It provides a simple interface that hides the complexity of the class libraries being used. UML...

View Article

Image may be NSFW.
Clik here to view.

Bridge Design Pattern

The bridge design pattern allows us, to separate the abstraction from the implementation. In the bridge pattern there are two parts, the first part is the Abstraction, and the second part is the...

View Article

Image may be NSFW.
Clik here to view.

Composite Design Pattern

The composite design pattern allows us to set up a tree structure and ask each element in the tree structure to perform a task. A typical tree structure would be a company organization chart, where the...

View Article


Image may be NSFW.
Clik here to view.

Flyweight Design Pattern

The flyweight design pattern allows us to reuse memory spaces in an application when we have lots of objects that are almost identical in nature.For example, if we are writing a game for a smartphone...

View Article


Image may be NSFW.
Clik here to view.

Command Design Pattern

The command design pattern allows us to store a list of actions those we can execute later. A common example is, storing the undo actions in an application. The undo actions are stored as the user is...

View Article

Image may be NSFW.
Clik here to view.

Observer Design Pattern

The Observer Design Pattern allows us to have a publisher-subscriber framework, whereas change to a publisher will notify all of its subscribers automatically. The subscribers are registered to the...

View Article

Image may be NSFW.
Clik here to view.

Iterator Design Pattern

Provide a way to access the elements of aggregate objects sequentially without exposing its representation. We can make the client independent on the movement of the cursors like forward traversal /...

View Article

Image may be NSFW.
Clik here to view.

Memento Pattern

Delegate some activity to some other class like some helper classes to do the job.The memento pattern is used to encapsulate the current state of an object in a memento object in order to be able to...

View Article


Visitor Pattern

The Visitor pattern is a powerful design pattern that I see a lot less than its popular brethren such as Factory, Facade, Command and Singleton. I believe this is because the pattern is often a bit...

View Article

Image may be NSFW.
Clik here to view.

Mediator Pattern

This pattern is best illustrated in code as the source describes it a lot more concisely than in prose. One central class (the mediator) is used by many ‘client’ classes to send messages with (n.b....

View Article


WPF - Styles

A style in WPF is the collection of (dependency) properties that affect the appearance and behavior of a control. For example, the text color inside a TextBox and background of a Button. For our...

View Article

WPF - Triggers

In previous article, we learned Styles, Triggers are similar to styles, the difference is Styles are applied to controls unconditionally whereas Triggers as based on one or more conditions.There are...

View Article


WPF - Dependency Properties

In .Net 1.1/2.0, a typical CLR property looks like this, // Private fieldprivate int _postId;// Public property that wraps the private fieldpublic int PostId{ get { return _postId; } set { _postId=...

View Article

Image may be NSFW.
Clik here to view.

WPF - Logical and Visual trees

To be clear at the outset, there is only one object tree in WPF, which is created based on the nested relationships of the elements in the markup (the markup may be built via XAML or code). The logical...

View Article

Image may be NSFW.
Clik here to view.

WPF - Control Templates

In the previous post we have seen that, elements in the WPF object tree which derive from Visual constitute the visual tree. The visual tree is thus all the WPF elements that come together to render a...

View Article
Browsing all 61 articles
Browse latest View live