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 Windows Phone7. Show all posts
Showing posts with label Windows Phone7. Show all posts
Tuesday, July 9, 2013
Monday, August 15, 2011
.NET Tips : List of my short tips
Hi Friends,
As I have already told you that I have been publishing short tips in DailyDotnetTips regularly, it is time to share the links with you to keep you updated. Please read these short tips from me and give your feedback.
As I have already told you that I have been publishing short tips in DailyDotnetTips regularly, it is time to share the links with you to keep you updated. Please read these short tips from me and give your feedback.
- Using ReaderWriterLock over Monitor for Thread Locking
- What is the use of IsBackground property of Thread?
- Co-Ordinated Thread Shutdown with and without using CancellationTokenSource
- Writing a Stretchable ContentControl in WPF
- What is Visual Tree and Logical Tree in WPF?
- Dealing with HWND in WPF
- Hosting a WPF control inside a Windows Form
- Accessing local assemblies in XAML
- Difference between a UserControl and a CustomControl
- Hosting a Windows Forms control inside a WPF
- Use x:Shared to write your FrameworkElements directly as Resource
- Use BitmapScalingMode to ensure your rendering of Image is perfect
- Object hierarchy of NULL
- Lazy Initializer to defer expensive Object creation in .NET 4.0
- Working with Co-Variance and Contra-Variance in .NET 4.0
- Using Complex Numbers in .NET 4.0
- Working with BigInteger in .NET 4.0
- Working with SortedSet in .NET 4.0
- Common Table Expressions in SQL Server
- Compiler directive #Pragma reference
So here are my last 20 short tips posted on DailyDotnetTips.
I hope you will like these tips. For full list of all the tips and the latest updates, check this link.
Happy Coding.
Thanks.
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
Saturday, April 30, 2011
How to Customize On-Screen Keyboard Layout in Windows Phone 7 application ?
While you want to enter some text in your Windows Phone 7 application, the first thing that you will notice is your very own on – screen keyboard. As Windows Phone 7 mobile have a very large screen area, most of the phones does not have an analog keyboard associated with it. Hence your application should provide provision to handle keyboard events directly using on-screen keyboards. There are few flexibilities available to you while you define your input scope, in this post I will demonstrate them with an example.
What is InputScope?
InputScope is a special functionality to the developers to customize how the layout of the keyboard appear to the user while entering data into that particular textbox. Hence you can easily customize the On-Screen Keyboard for your input so that one can easily feed in data fast and easy. For instance, say if you want to take phone number as input,you need only digits and some special characters to be available, on the other hand, email needed alphanumeric characters with @ as symbol. Silverlight introduces the new option to let you specify the InputScope for a particular input. Lets look into the code below :
What is InputScope?
InputScope is a special functionality to the developers to customize how the layout of the keyboard appear to the user while entering data into that particular textbox. Hence you can easily customize the On-Screen Keyboard for your input so that one can easily feed in data fast and easy. For instance, say if you want to take phone number as input,you need only digits and some special characters to be available, on the other hand, email needed alphanumeric characters with @ as symbol. Silverlight introduces the new option to let you specify the InputScope for a particular input. Lets look into the code below :
Labels:
.NET,
C#,
CodeProject,
silverlight,
Windows Phone7,
XAML
Thursday, April 28, 2011
Async support for Silverlight and WP7
Async support in C# language brings the new life to the modern application development to bring forth the same technique of writing your code and bring asynchrony easily. The main focus of async ctp is to ornament the language in such a way so that the developer could seamlessly create applications that brings asynchrony yet not dealing with its complexity. Hence using the new technique, asynchrony could easily achieved in a program without refactoring the whole program with lots of callbacks and method calls. I have already talked about it in a separate article. If you don’t know, please visit “Async CTP 5.0”.
Async CTP is released again recently and announced in MIX 11. Just after it is released, the first thing that everyone looks for is what is new in the release. As a matter of fact, I did jumped back to see them but eventually found out that there is nothing new in this build in terms of new features is concerned but the release focuses on fixes of performance adding debugging capabilities etc. I will definitely look back to them later in another post, but in this post I am going to talk about another important thing that featured with this release. As opposed to the previous release, the current release now supports Silverlight and Windows Phone 7 environments. This seems to be interesting.
What is Asynchrony?
The word asynchrony means something that is running without blocking other operations running in parallel. If you have created a background Thread to process some data, you are actually doing asynchronous job in background as your foreground operation does not get hampered. In vNext C# introduces Asynchrony using TPL. The two new keywords “async” and “await” could be used to make one sequential method asynchronous. Hence the new way of developing asynchronous program replaces the traditional approach where we needed to refactor the code totally to gain asynchrony in our application. Basically, this is done using the StateMachine to store the entire method into a form of states, and each states are delegated into batch of statements. The Task.ContinueWith is used in the system to ensure that the method body gets executed sequentially. Yes, it’s a compiler trick. If you want to know more about it, please read through my entire article on “Async CTP”.
Async CTP is released again recently and announced in MIX 11. Just after it is released, the first thing that everyone looks for is what is new in the release. As a matter of fact, I did jumped back to see them but eventually found out that there is nothing new in this build in terms of new features is concerned but the release focuses on fixes of performance adding debugging capabilities etc. I will definitely look back to them later in another post, but in this post I am going to talk about another important thing that featured with this release. As opposed to the previous release, the current release now supports Silverlight and Windows Phone 7 environments. This seems to be interesting.
What is Asynchrony?
The word asynchrony means something that is running without blocking other operations running in parallel. If you have created a background Thread to process some data, you are actually doing asynchronous job in background as your foreground operation does not get hampered. In vNext C# introduces Asynchrony using TPL. The two new keywords “async” and “await” could be used to make one sequential method asynchronous. Hence the new way of developing asynchronous program replaces the traditional approach where we needed to refactor the code totally to gain asynchrony in our application. Basically, this is done using the StateMachine to store the entire method into a form of states, and each states are delegated into batch of statements. The Task.ContinueWith is used in the system to ensure that the method body gets executed sequentially. Yes, it’s a compiler trick. If you want to know more about it, please read through my entire article on “Async CTP”.
Labels:
.NET,
architecture,
async,
beyondrelational,
C#,
C#5.0,
CodeProject,
debugging,
design pattern,
IsolatedStorage,
silverlight,
Windows Phone7,
XAML
Wednesday, April 27, 2011
Application Bar for your Windows Phone 7
If you are working with Windows Phone 7, the first thing that you should have noticed is the very own Application bar. Application Bar is present in most of the applications that you use in your Windows Phone 7. This is basically a standard Toolbar with a menu associated with it which allows you to enumerate the commonly used commands in a standard location. While creating your application, Microsoft strongly recommends you to add an application bar, to ensure the user have common behaviour for every application. You can think Application bar similar to TaskBar of windows.
Components of Application Bar
An application Bar is made up with two components:
1. ApplicationBar Buttons
2. ApplicationBar Menu
The applicationbar buttons are always visible for an application which is used to list only the items that needed to be frequently used while dealing with the application. Lets say you create a Text processing application, you can list the File->Open and File-Save commands as ApplicationBarButtons.
ApplicationBarMenu pops up when the user clicks on either the blank space of the application bar or the special button with 3 dots. The Application Menu is used to list the items that are not used often but needed sometimes in the context.
Components of Application Bar
An application Bar is made up with two components:
1. ApplicationBar Buttons
2. ApplicationBar Menu
The applicationbar buttons are always visible for an application which is used to list only the items that needed to be frequently used while dealing with the application. Lets say you create a Text processing application, you can list the File->Open and File-Save commands as ApplicationBarButtons.
ApplicationBarMenu pops up when the user clicks on either the blank space of the application bar or the special button with 3 dots. The Application Menu is used to list the items that are not used often but needed sometimes in the context.
Labels:
.NET,
beyondrelational,
C#,
CodeProject,
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
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 !!!