Wednesday, August 22, 2012

What are rules and principles for Metro UI design

Before describing rules for Metro design first I am telling you a brief about the metro UI design.

"Metro UI is nothing but a design structure/pattern with a smooth, attractive and simple user interface where text content has more appeal than the containers"

Please follow these rules when you are trying to develop a website using Microsoft's Metro UI design being a best web professional.

Rules given by Microsoft for Metro design
  • Consistent and smooth navigation and scrolling.
  • Both the background of the page and the background of text should be plain, usually with a solid color, to avoid distracting from the text.
  • Simple, attractive and non bothering user interface
  • Organize information on the bases of meaning and functionality.
  • Attention on the device on which the software will run. this will remove future difficulties when the software will run on both traditional and touch-screens with different sizes.
  • Use font-size and colors for content separation and headings in place of background and some other separator containers.
  • Use snap view to engage your users.
  • Keep app contextual actions in the app bar.
Here check this layout and content representation as a best metro design example
Rules for metro UI  design

Sunday, August 19, 2012

Hotmail changed to with Metro UI feature

Let us Know!
Ques: What is
Ques: Vs
Ques: What are new features in
Ques: What is replacement of

       is actually replacement of with new Windows 8  metro UI features New web mail launched by MicrosoftThrough Microsoft seems to be serious about content focusing design with Clean layout, block colors and plenty of contextual menus help to implement a simple and attractive user interface. Vs

There might be competition between Google and Microsoft because Over 1 million people reserved webmail service in the first 6 hours when Microsoft launched and more than 10 million users registered in the two weeks after its launch.

Most desirable Features
  • The biggest feature update, and the one I believe most users have been asking for a while, is the addition of Office Web Apps – Word, PowerPoint, Excel and OneNote – to open attachments, edit them on the fly and send them back as email. The inability to do so has been a major pet peeve for most email users. It also offers SkyDrive support so users can upload heavy attachments to the cloud service without worrying about attachment size limits. 
  • SkyDrive Integration 
  • Windows Live Messenger Support
  • Fully designed based on Metro UI guidlines
  • Skype Integration
Take a tour of new

Personally, I really like this new fast and clean interface with Metro style features so I 'll say You can try this webmail.

How to delete your twitter account

How to deactivate your Twitter account

Please think twice before sending request for account deactivation and if you say 'Yes' then follow these steps:
  • Open Twitter website
  • Log in to your Twitter account
  • Go to your Account settings and click on Deactivate my account at the bottom of the page.
  • Read the account deactivation information. Click Okay, fine, deactivate account.  
  • Enter your password when prompted and verify that you are authenticated and really want to deactivate your account.

Before sending request for account deactivation always remember

  • Twitter only retain your user data for 30 days from the date of deactivation, after which it is permanently deleted.
  • You may reactivate your account at any time during these 30 days by logging in.
  • Never deactivate your account to change your username or email address; you can change it at any time in your account settings.
  • To use a username or email address on another account, you must first change them and then confirm the change prior to deactivation.
  • Your content indexed by search engines like Google or Bing will be removed.
  • After deactivation, your account should be removed within a few minutes, however some content may be viewable on for a few days.

Monday, August 13, 2012

Difference between Website and Web application asp dot net

Find the solution of following queries:
Ques: What is Web application project?
Ques: What is website?
Ques: Differentiate Web Application and Website in with respect to Dot Net Technology.

Web application projects
  • A Visual Studio project file (.csproj or .vbproj) stores information about the project, such as the list of files that are included in the project. 
  • You explicitly compile the source code on the computer that is used for development or source control. 
  • By default, compilation of code files (excluding .aspx and .ascx files) produces a single assembly. 
  • For deployement, You need to copy the assembly to a server. The assembly is produced by compiling the application. 
  • Use when You want to avoid putting source code on a production server. 

Web site projects 
  • There is no project file (.csproj or .vbproj). All the files in a folder structure are automatically included in the site. 
  • The source code is typically compiled dynamically (automatically) by ASP.NET on the server the first time a request is received after the site has been installed or updated. 
  • By default, compilation produces multiple assemblies. 
  • You copy the application source files to a computer that has IIS installed on it. 
  • You want to be able to update individual files in production by just copying new versions to the production server, or by editing the files directly on the production server.

Sunday, August 12, 2012

Guidelines for developing metro style Apps

Design principles for Windows 8 Metro style apps

"Being a good developer, we need to have the conceptual knowledge of metro UI design principles while trying to develop a application based on windows 8 metro UI. Its a good practice to choose the right surface for the right application. Here I am giving a brief description that will help you as I hope and you might feel better"

Layout and navigation

Focus on content

When creating the Metro style app, our first goal was to remove all UI elements that were not directly relevant to the core functionality of the app. For example, the top navigation bar, pagination controls, and the bottom control bar can all be removed.
Metro UI layout navigation

Use App bars

Outside of the app page, the app bar is the primary command interface for your app. Use the app bar to present navigation, commands, and tools to users. 

Use direct manipulation to navigate

When designing the Metro style app, always use direct manipulation whenever possible, using built-in controls like Semantic Zoom, which lets users navigate more efficiently.

Use View states

People can snap your app so that they can use another app, or snap another app so they can use your app.

Commands and actions

Keep app contextual actions in the app bar

This way the app design surface isn't cluttered with controls, and no matter where a user is, they can swipe the app bar from the bottom or top of the screen to see relevant actions. All Metro style apps can use the app bar for their commands. Because users will be familiar with app bar interactions, it also increases the usability of our app and makes the whole system feel cohesive.


Use Search contract to centralize the search experience

By using the Search contract, users can invoke the Search charm from anywhere in the system to look for content from apps that support the contract.
Windows 8 Metro UI search contract

  • The user opens the charm bar and accesses the Search charm. The Photo journal app is selected by default because the user is currently inside the app.
  • When the user starts typing, the app supplies search suggestions to the pane. This way users can quickly see which terms will generate search results. After the user submits their query, they see a search results view and select the result they want.


Edge swiping for app and system commands

Using Windows 8, a user can swipe from edges to access commands and navigate between apps.
edge-swiping-metro ui-apps
  • App commands are revealed by swiping from the bottom or top edge of the screen. The app bar should always be used to display app commands.
  • Swiping from the right edge of the screen reveals the charms bar that contains system commands.
  • Swiping from the left edge switches to previously used apps.
  • Swiping from the top edge toward the bottom edge of the screen lets you dock or close apps.

Pinch and stretch to semantic zoom

 Semantic zoom enables the user to zoom out to see data in related groups and provides a quick way to dive back in. Instead of providing navigation for reviewing long lists of content, use semantic zoom when possible for this type of interaction.

Orientation and views

Design adaptive layout for orientation and screen sizes

When redesigning the Photo journal app, we considered how the app would look in two device orientations, taking into account screen resolutions and device sizes. The grid layout makes it easy to scale the design for both portrait layout and high resolution screens
Orientation view for metro UI

Use snap view to engage your users

Windows 8 lets users multitask by "snapping" an app next to another app. The snapped view is a great way to increase the app's time on screen and engage users for longer periods.


Use tiles for persistent and dynamic updates

Unlike the notifications in iOS which have a fixed format, Metro style app tiles have a rich collection of templates for designers to choose from.

Use toasts for app notifications

It's best to let users opt-in to notifications during their first run of the app. If applicable, show recent toast notifications on tiles while they are still relevant.
Notification design guidelines for metro UI

Source: MSDN

WCF concepts implementation with examples and interview questions

[Windows Communication Foundation]

Know about:
What is WCF Service?
Use and implentation of WCF service with ASP .Net 4.0
Difference between WCF and Web Service
WCF examples for multiple binding
Types of contracts in WCF Service
Advantage and disadvantage of WCF Service

WCF is a programming platform and runtime system for building, configuring and deploying network-distributed services. It is the latest service oriented technology; Interoperability is the fundamental characteristics of WCF. It is unified programming model provided in .Net Framework 3.0. WCF is a combined feature of Web Service, Remoting, MSMQ and COM+. WCF provides a common platform for all .NET communication.

A WCF Service is composed of three components parts viz,

1) Service Class - A WCF service class implements some service as a set of methods.

2) Host Environment - A Host environment can be a Console application or a Windows Service or a Windows Forms application or IIS as in case of the normal asmx web service in .NET.

3) Endpoints - All communications with the WCF service will happen via the endpoints. The endpoint is composed of 3 parts (collectively called as ABC's of endpoint) as defines below:

The endpoints specify an Address that defines where the endpoint is hosted. It’s basically url.

Ex:      http://localhost/WCFServiceSample/Service.svc

The endpoints also define a binding that specifies how a client will communicate with the service and the address where the endpoint is hosted. Various components of the WCF are depicted in the figure below.
·         "A" stands for Address: Where is the service?
·         "B" stands for Binding: How can we talk to the service?
·         "C" stands for Contract: What can the service do for us?

Different bindings supported by WCF:

Basic Web service communication. No security by default
Web services with WS-* support. Supports transactions
Web services with duplex contract and transaction support
Web services with federated security. Supports transactions
Communication directly with MSMQ applications. Supports transactions
Communication between WCF applications by using queuing. Supports transactions
Communication between WCF applications on same computer. Supports duplex contracts and transactions
Communication between computers across peer-to-peer services. Supports duplex contracts
Communication between WCF applications across computers. Supports duplex contracts and transactions

The endpoints specify a Contract that defines which methods of the Service class will be accessible via the endpoint; each endpoint may expose a different set of methods.

Types of contracts in WCF

Service Contract
Service contracts describe the operation that service can provide. For Eg, a Service provide to know the temperature of the city based on the zip code, this service is called as Service contract. It will be created using Service and Operational Contract attribute.

Data Contract
Data contract describes the custom data type which is exposed to the client. This defines the data types, which are passed to and from service. Data types like int, string are identified by the client because it is already mention in XML schema definition language document, but custom created class or data types cannot be identified by the client e.g. Employee data type. By using DataContract we can make client to be aware of Employee data type that are returning or passing parameter to the method.

Message Contract
Default SOAP message format is provided by the WCF runtime for communication between Client and service. If it is not meeting your requirements then we can create our own message format. This can be achieved by using Message Contract attribute.

Fault Contract
Suppose the service I consumed is not working in the client application. I want to know the real cause of the problem. How I can know the error? For this we are having Fault Contract. Fault Contract provides documented view for error occurred in the service to client. This helps us to easy identity, what error has occurred.

Delete [OperationContract] attribute:
When we delete  [OperationContract] attribute we get an exception
“Contract OR Binding mismatch between the sender and receiver”

Saturday, August 11, 2012

Binary Soap XML and Custom Serialization in Dot Net

Find the solution of following Questions:
Ques: What is serialization and deserialization?
Ques: Why we use serialization?
Ques: How to serialize an object?
Ques: Define: Custom,XML, Binary Soap and XML serialization.

Why Serialization:
·     To persist the state of an object to a storage medium so an exact copy can be recreated at a later stage. Although it can be done without serialization but Serialization provides a convenient mechanism for achieving this objective with minimal effort when we have a large application with thousands of objects
·         To send the object by value from one application domain to another.

1: serialization is used to save session state in ASP.NET and to copy objects to the clipboard in Windows Forms.
2: It is also used by remoting to pass objects by value from one application domain to another

What is Serialization:
Serialization can be defined as the process of storing the state of an object instance to a storage medium. During this process, the public and private fields of the object and the name of the class, including the assembly containing the class, is converted to a stream of bytes, which is then written to a data stream. When the object is subsequently deserialized, an exact clone of the original object is created

1. Serialization is a process of converting an object into a stream of data so that it can be is easily transmittable over the network or can be continued in a persistent storage location.  This storage location can be a physical file, database or ASP.NET Cache.
2. Serialization is the technology that enables an object to be converted into a linear stream of data that can be easily passed across process boundaries and machines.  This stream of data needs to be in a format that can be understood by both ends of a communication channel so that the object can be serialized and reconstructed easily.

Using serialization is the ability to transmit data across the network in a cross-platform-compatible format, as well as saving it in a persistent or non-persistent storage medium in a non-proprietary format.

Serialization is used by Remoting, Web Services SOAP for transmitting data between a server and a client.  The Remoting technology of .NET makes use of serialization to pass objects by value from one application domain to another.

De-serialization is the reverse; it is the process of reconstructing the same object later.

Figure :
Dot net serialization and deserialization

The Serializable Attribute
In order for a class to be serializable, it must have the attribute SerializableAttribute set and all its members must also be serializable, except if they are ignored with the attribute NonSerialized  Attribute.  However, the private and public members of a class are always serialized by default.  The SerializationAttribute is only used for the binary serialization.  The code snippet below shows the usage of Serializable attribute.
public class MyObject 
  public int n1 = 0;
  public int n2 = 0;
  public String str = null;

Selective Serialization

By default, all members of a class are serialized, including private members. To reduce the amount of data serialized to the stream, you can inhibit serialization of members that are not required to reconstitute the class by attaching the NonSerialized attribute to those members

public class MyObject 
  public int n1;
  [NonSerialized] public int n2;
  public String str;

Types of Serialization

Serialization can be of the following types:
1.     Binary Serialization
2.     SOAP Serialization
3.     XML Serialization
4.     Custom Serialization

Binary Serialization

The necessary information that is required to create an exact binary copy of the object is saved onto the storage media.

Public void BinarySerialize(string filename, Employee emp)


  FileStream fileStreamObject;

    fileStreamObject =new FileStream(filename, FileMode.Create);

    BinaryFormatter binaryFormatter =new BinaryFormatter();

    binaryFormatter.Serialize(fileStreamObject, emp);

The following code listing shows how we can implement binary de-serialization.

Public static object BinaryDeserialize(string filename)


  FileStream fileStreamObject; 



    fileStreamObject =new FileStream(filename, FileMode.Open);

    BinaryFormatter binaryFormatter =new BinaryFormatter();

    return (binaryFormatter.Deserialize(fileStreamObject));



SOAP Serialization
In order to use SOAP serialization in .NET we have to add a reference to System.Runtime.Serialization.Formatters.Soap in the application.  The basic advantage of SOAP serialization is portability.  The SoapFormatter serializes objects into SOAP messages or parses SOAP messages and extracts serialized objects from the message. 

publicvoid SOAPSerialize(string filename,Employee employeeObject)


  FileStream fileStreamObject =new FileStream(filename, FileMode.Create);

  SoapFormatter soapFormatter =new SoapFormatter();

  soapFormatter.Serialize(fileStreamObject, employeeObject);
The following code listing shows how we can implement de-serialization using the SOAP protocol.

publicstaticobject SOAPDeserialize(string filename)


  FileStream fileStreamObject =new FileStream(filename, FileMode.Open);

  SoapFormatter soapFormatter =new SoapFormatter();

  object obj = (object)soapFormatter.Deserialize(fileStreamObject);

  return obj;


Xml  Serialization
XML serialization results in strongly typed classes with public properties and fields that are converted to a serial format (in this case, XML) for storage or transport. Because XML is an open standard, the XML stream can be processed by any application, as needed, regardless of platform

Note: XmlSerializer does not use the ISerializable interface; rather, it uses the IXmlSerializable interface.  The XmlSerializer class can only serialize the public properties of the class

publicvoid XMLSerialize(Employee emp, String filename)


  XmlSerializer serializer =null;

  FileStream stream =null;


    serializer =new XmlSerializer(typeof(Employee));

    stream =new FileStream(filename, FileMode.Create, FileAccess.Write);

    serializer.Serialize(stream, emp);

    if (stream !=null)


The following code listing shows how we can implement XML de-serialization.

public static Employee XMLDeserialize(String filename)


  XmlSerializer serializer =null;

  FileStream stream =null;

  Employee emp =new Employee();


    serializer =new XmlSerializer(typeof(Employee));

    stream =new FileStream(filename, FileMode.Open);

    emp = (Employee)serializer.Deserialize(stream);


    if (stream !=null)

  return emp;


Custom Serialization
In some cases, the default serialization techniques provided by .NET may not be sufficient in real life.  This is when we require implementing custom serialization.  It is possible to implement custom serialization in .NET by implementing the ISerializable interface..  This interface allows an object to take control of its own serialization and de-serialization process.  It gives us a great deal of flexibility in the way we can save and restore objects.  The ISerializable interface consists of a single method, GetObjectData, which accepts two parameters.
The SerializationInfo class serves as the container for all the data we want to serialize.  The AddValue method is called to add the objects we want to serialize to this container.  The implementing class needs to have the GetObjectData method and a special constructor which is used by the common language runtime during the process of de-serialization.  The following code listing shows how we can implement Custom Serialization.

public class Employee: ISerializable


  private int empCode;

  private string empName;

  protected Employee(SerializationInfo serializationInfo, StreamingContext

    this.empCode = serializationInfo.GetInt32("empCode");

    this.empName = serializationInfo.GetString("empName");


  public void ISerializable.GetObjectData(SerializationInfo serializationInfo,

  StreamingContext streamingContext)



More related links:

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Powered by Code Imagine