CollectionView is an object that we generally use while dealing with a collection in WPF. It is an object structure that supports a collection as well some of the inherent features which a user might always need while dealing with a collection. Some of the features like Sorting, Grouping, Filtering are automatically implemented in a CollectionView. I have written one article on how to deal with CollectionView way back in Aug 2010 which explains almost everything you need to do while dealing with collection in WPF. But it does not give the entire story.
Controls that can show a Collection in WPF is somehow derived from ItemsPresenter. The ItemsPresenter has a property called ItemsSource which takes an object of ICollectionView, and hence it is one of the important interfaces considered so far.
There are some advanced scenarios where the general Grouping or sorting does not makes sense. Here in this article I am going to deal with such advanced scenarios which might be worth mentioning.
Handy Tricks and Tips to do your .NET code Fast, Efficient and Simple. Some common questions that comes into mind. Please check if you could find them listed or not.
Showing posts with label MVVM. Show all posts
Showing posts with label MVVM. Show all posts
Tuesday, July 9, 2013
Sunday, April 21, 2013
.NET Book : Visual Studio 2012 and .NET 4.5 Expert Development Cookbook (Must Read)
Friends,
It is my great honor to tell you that my book has finally been released this week. If you have ever liked any of my blogs or internals, you would like this book for sure. There are lot of things to learn from the book and I can assure you that you wont be upset with this book if you buy it.
The "Visual Studio 2012 and .NET 4.5 Expert Development Cookbook" is a book that guides you through steps to ensure you enrich the best experience with the latest technology in the best amount of time possible. The book focusses to give you under the hood expertise in .NET technologies it tends to cover and adapts you the best to face common problems of these technologies. The book is divided in forms of recipes. Each of these recipes gives you clear insight of the problem and step by step process to solve the issue practically. It also addresses the advanced features associated with each of those recipes that gives you additional advantage on getting precise knowledge about the problem and its associated issues.
It is my great honor to tell you that my book has finally been released this week. If you have ever liked any of my blogs or internals, you would like this book for sure. There are lot of things to learn from the book and I can assure you that you wont be upset with this book if you buy it.
The "Visual Studio 2012 and .NET 4.5 Expert Development Cookbook" is a book that guides you through steps to ensure you enrich the best experience with the latest technology in the best amount of time possible. The book focusses to give you under the hood expertise in .NET technologies it tends to cover and adapts you the best to face common problems of these technologies. The book is divided in forms of recipes. Each of these recipes gives you clear insight of the problem and step by step process to solve the issue practically. It also addresses the advanced features associated with each of those recipes that gives you additional advantage on getting precise knowledge about the problem and its associated issues.
What you will learn from this book
- Basic usage of Visual Studio 2012 IDE and its various components and better utilization of the tool while writing code
- Understand memory management techniques to build better applications
- Understand the .NET infrastructure with in-depth analysis of its internals
- Architect solutions that leverage the full power of .NET language gems, understanding when to use what
- Implement multithreaded / asynchronous applications using recent updates on .NET 4.5 and compare the past approaches
- Create secure ASP.NET web based applications in .NET 4.5 with use of JQuery and HTML5 for rapid application development
- Architect advanced .NET client applications using MVVM with WPF 4.5
- Understand touch sensitive devices and leverage skills to develop multi-touch applications inside Windows 8
Labels:
.NET infrastructure,
.NET Memory Management,
asp.net4.5,
async,
book,
C#,
CodeProject,
cookbook,
html5,
internals,
jquery,
multithreading,
MVVM,
push technology,
TPL,
TPL Data Flows,
VS2012,
Windows8,
WPF
Sunday, July 24, 2011
Writing a Reusable Custom Control in WPF
In my previous post, I have already defined how you can inherit from an existing control and define your own reusable chunk. The reusable XAML code that I have defined there is actually a composition of one of more existing elements in a common design surface. But sometimes you must define a new behaviour for your reusable component which does not belong to any of the already existing behaviors. Custom controls can help you in this. You can define a new behaviour for your Custom control which can have a default look and feel defined for it, and obviously which can be changed using Template for the user who is using the control. In this post I am going to provide you step by step approach on defining a Custom Control for your application.
Note: If you are really new to WPF, please read my WPF Tutorial before going further.
Steps to Create a new Custom Control
Creating a custom control is very simple. Just in your project right click and add a new Item. In the dialog box that appears, choose Custom Control template and Name it. I call it here as SimpleControl.
Once you have added the control, it adds up a new class to your project which inherits from Control. The Template also provides you with some initial help to define your own control. Lets remove all the comments for now and start building a control.
Download Sample Code
Note: If you are really new to WPF, please read my WPF Tutorial before going further.
Steps to Create a new Custom Control
Creating a custom control is very simple. Just in your project right click and add a new Item. In the dialog box that appears, choose Custom Control template and Name it. I call it here as SimpleControl.
Once you have added the control, it adds up a new class to your project which inherits from Control. The Template also provides you with some initial help to define your own control. Lets remove all the comments for now and start building a control.
Download Sample Code
Labels:
.NET 4.0,
beyondrelational,
C#,
CodeProject,
Custom Control,
MVVM,
windowsclient.net,
WPF,
XAML
Saturday, July 23, 2011
Writing a Reusable WPF Control with Design Support
Code reusablity is one of the major concern to many of us. When dealing with large projects, modularizing your project is one of the primary thing that you should look for. I have talked about many of the approaches that you can use to deal with modularizing your code, eg, Prism. In this post our intent is not to talk hard on some pattern, rather I will discuss how your WPF application supports code reusability. There are a number of approaches that WPF supports to deal with reusable component. We can use Resources to define a Resource or even use CodeBehind to write our reusable component or even load the XAML from a file using XAML Loader. Each of the approaches has its own pros and cons. Today I will show you another cool technique to write a reusable XAML for your project which will allow you to easily use Visual Studio design surface to design the component.
Note : It is a very basic article, if you want to know about details on WPF, please read my tutorial on it.
Steps to Create your Reusable Component
Lets create a series of steps to create a reusable component for your application to make it easier for you to write one yourself.
Note : It is a very basic article, if you want to know about details on WPF, please read my tutorial on it.
Steps to Create your Reusable Component
Lets create a series of steps to create a reusable component for your application to make it easier for you to write one yourself.
Labels:
.NET 3.5,
.NET 4.0,
architecture,
C#,
MVVM,
windowsclient.net,
WPF,
XAML
Monday, May 2, 2011
Creating Animated Splash screen in Windows Phone 7
Creating a beautiful splash screen is always great to see for any application. Windows Phone 7 being no exception to it, you want to give the user great look and feel while loading the application using your Splash Screens. In this article, I am going to spend some time by talking about some of the probable options that you have to create your own Splash Screen for your windows phone 7 application.
What is Splash Screen?
Splash screen is the first screen that comes as an introduction to the application before the application gets on executing. During the application loads up into memory there are lot of things happen in background. The process is created in memory, memory blocks are allocated, Virtualized File System gets initialized etc. During these phase of loading the application, the application hung up and the user sees the black screen. If this wait becomes too long, the user gets frustrated and might stop using the application as well. The Mobile Marketplace also puts a threshold of 10 seconds in which your application must load, otherwise your application will be rejected from App Store. During this phase, if you show some nice little splash screen to the user without hampering the normal loading of the application, the user will feel much more comfortable with your application.
In this post I will demonstrate how you can create / use splash screen for your windows Phone 7 application and the different approaches available to you for this.
Basically there are two options available before you which will allow you to show your customized splash screen :
What is Splash Screen?
Splash screen is the first screen that comes as an introduction to the application before the application gets on executing. During the application loads up into memory there are lot of things happen in background. The process is created in memory, memory blocks are allocated, Virtualized File System gets initialized etc. During these phase of loading the application, the application hung up and the user sees the black screen. If this wait becomes too long, the user gets frustrated and might stop using the application as well. The Mobile Marketplace also puts a threshold of 10 seconds in which your application must load, otherwise your application will be rejected from App Store. During this phase, if you show some nice little splash screen to the user without hampering the normal loading of the application, the user will feel much more comfortable with your application.
In this post I will demonstrate how you can create / use splash screen for your windows Phone 7 application and the different approaches available to you for this.
Basically there are two options available before you which will allow you to show your customized splash screen :
Labels:
.NET,
async,
beyondrelational,
C#5.0,
CodeProject,
MVVM,
silverlight,
Windows Phone7,
XAML
Sunday, April 24, 2011
Working with Isolated Storage for Windows Phone 7
During the last few days, Microsoft is getting more and more inclined towards improving the user experience in more than a number of technologies. Silverlight being one of the major forerunner on this moving good in Web by providing Rich Internet Applications for end users. But not only for Web, Silverlight is a language being used for Windows Phone 7 as well, which gives the silverlight developers a chance to move over to Windows Phone easily. Being a WPF developer, I am totally freaked out on watching stuffs related to Windows Phone as richness in UI always attracts me. I have learned a few about Windows Phone 7 as well, but never got a chance to speak about it. Lets speak a little about the use of Isolated Storage (if you have already read my article here), in Windows Phone 7 in this article.
Isolated Storage
We say Files and Folders are the building blocks for any application. We need to store data in our Phones to persist data when the application is not running. In case of Windows Phone 7 microsoft provides a secure way to store data into Isolated Store. Isolated Storage, as the name suggests is a special virtualized file system that every application can access for standard IO operations yet the file is unavailable to any other application. Hence the files stored by one application is isolated from another.
Each application has a root of the store of this Virtualized File system. You can use the store to create folders and files. The main advantage of the Isolated store is independence between the actual file system and the application. Hence it gives a strong decoupling between the actual physical architecture of the system and the application. To understand, lets see the image below :

Here we have three applications running on Windows Phone, and each accesses its own root in the Virtualized file system for data storage. The application API cannot access the physical file system, but interacts with the Virtualized File system for its I/O operations. Thus if our physical file system changes, our stores will still be available and our application will run independently.
Isolated Storage
We say Files and Folders are the building blocks for any application. We need to store data in our Phones to persist data when the application is not running. In case of Windows Phone 7 microsoft provides a secure way to store data into Isolated Store. Isolated Storage, as the name suggests is a special virtualized file system that every application can access for standard IO operations yet the file is unavailable to any other application. Hence the files stored by one application is isolated from another.
Each application has a root of the store of this Virtualized File system. You can use the store to create folders and files. The main advantage of the Isolated store is independence between the actual file system and the application. Hence it gives a strong decoupling between the actual physical architecture of the system and the application. To understand, lets see the image below :
Here we have three applications running on Windows Phone, and each accesses its own root in the Virtualized file system for data storage. The application API cannot access the physical file system, but interacts with the Virtualized File system for its I/O operations. Thus if our physical file system changes, our stores will still be available and our application will run independently.
Labels:
beyondrelational,
C#,
CodeProject,
IsolatedStorage,
MVVM,
Windows Phone7,
XAML
Tuesday, March 22, 2011
Issue with RadioButtons and Binding for MVVM
Well, if you are working with WPF or silverlight, and in VS 2008, I think you would have definitely found this issue or will find it sooner.
Most of us when dealing with WPF applications must have been using MVVM pattern where you want to completely separate the presentation layer into a View Models. Well, it would be hard to create MVP or MVVM pattern yourself in other applications, but WPF has inbuilt support of MVVM with Command interfaces and Binding. Binding is the concept which lets you to update the control whenever the underlying data object is modified and vice versa.
Most of the controls works great with Binding and hence can easily be used with MVVM pattern, but RadioButton has serious issue with it. In this post I will describe the problem with Radios and define some of the ways to solve it.
Most of us when dealing with WPF applications must have been using MVVM pattern where you want to completely separate the presentation layer into a View Models. Well, it would be hard to create MVP or MVVM pattern yourself in other applications, but WPF has inbuilt support of MVVM with Command interfaces and Binding. Binding is the concept which lets you to update the control whenever the underlying data object is modified and vice versa.
Most of the controls works great with Binding and hence can easily be used with MVVM pattern, but RadioButton has serious issue with it. In this post I will describe the problem with Radios and define some of the ways to solve it.
Subscribe to:
Posts (Atom)
Author's new book
Abhishek authored one of the best selling book of .NET. It covers ASP.NET, WPF, Windows 8, Threading, Memory Management, Internals, Visual Studio, HTML5, JQuery and many more...
Grab it now !!!
Grab it now !!!