Tutorials - C#, WPF, ASP.NET MVC, WCF, Entity Framework, AngularJS and MVVM Frameworks - MVVM Light - DotNetPattern.com

MVVM Light Toolkit Example

In my previous blog, I have showed you some main classes in MVVM Light Tookit. In this blog, I will show a simple MVVM Light Toolkit example. In this example, we will create a sample application for loading and saving the employees details using MVVM Light Toolkit. We will do below tasks one by one: Add a reference of MVVM Light Toolkit into...

Continue Reading

C# Interface

C# Interface defines a group of related functionality. An interface defines only the definition of the functionality. All classes and structures which inherit from interface must implement the functionality defined in an interface. We can not create an instance of interface. In the interface declaration variable, we can only store the instance of the object that impleme...

Continue Reading

How to Apply WPF ListView ItemContainerStyle

ListView ItemContainerStyle specifies a style that is used by every generated ListViewItem for styling it. You can create a Style inline or in the Resources section and set the ItemContainerStyle property of ListView. You can set ItemContainerStyle as StaticResource or DynamicResource. When to Use? By default you cannot modify style of ListViewItem in WPF ListView....

Continue Reading

How to Hide WPF ListView Columns in MVVM?

ListView control is a very popular control among WPF developers. Developers use ListView control for showing the data in tabular format. Sometimes, we need to hide WPF ListView columns, but wpf does not provide any default implementation for hide WPF ListView columns. I have developed a WPF Behavior to hide WPF ListView columns through Attach property. An attached&...

Continue Reading

C# Predicate

Predicate is a pre-built delegate in the .NET framework class library. Delegates are used to store method which has same parameters and return types as specify in the delegate type. Predicate is a generic delegate. It takes one parameter and returns a boolean value. Predicate delegate is used for check whether a parameter meets specify condition or not. ...

Continue Reading

Quick Tips to Filter ListView in WPF

WPF ListView does not support Filtering by default. ListView does not have their own methods to filter the bounded list. But WPF has a very special class CollectionViewSource which supports Filtering very effectively and in very easy way. What is CollectionViewSource class? CollectionViewSource is a class which we can use in WPF for filtering and sorting a bounded ...

Continue Reading

C# Reflection - What is Assembly?

Assembly is the main unit in .NET applications. Assembly is a collection of types and its information. There are two types of assemblies: Executable files (EXE) Libraries (DLL) Both type of assemblies includes information about types and its members in its metadata. There are three ways to get Assembly instances: Geting assembly instance from type...

Continue Reading

C# Reflection - Getting Constructors

C# reflection Type class provides two methods for getting the constructors in any Type. GetConstructors() //Returns all the constructors GetConstructor() //Returns only the specific constructor with match your given criteria. By default, all the above methods returns public constructors of a Type. To get the private, protected, and static constructors you have to u...

Continue Reading

C# Reflection - MemberInfo Class

MemberInfo class provides a quick look of all the members in a Type. Below is the same code to get all members of a Type. static void Main(string[] args) { Type type = typeof(Program); foreach(MemberInfo member in type.GetMembers()) { Console.WriteLine(member.Name + ":" + member.MemberType); } } MemberInfo MemberType property MemberInfo prov...

Continue Reading

C# Reflection - Type class

A Type class is an important class in C# reflection. Type class represents class types, interface types, array types, value types, enum types, type parameters, generic type definitions, and open/closed generic types. Type class helps you to find properties, methods, events, fields, and constructors declared in a type. It also provides us the Assembly in which the type is dec...

Continue Reading

Join our newsletter and get an occasional email with a technology and DotNetPattern.com news update.