Wednesday, February 20, 2013

Windows Phone toolkit 4 (How to install)

Here is how you can install the Windows Phone 8 version of the 

toolkit 



Windows Phone toolkit provides a collection of controls, extension methods and page animations to help create beautiful and consistent Windows Phone user interfaces and make common progamming tasks easier. Documentation and source are on CodePlex at http://phone.codeplex.com.
NO. 1) To install Windows Phone toolkit, run the following command in the Package Manager Console

PM> Install-Package WPtoolkit

NO. 2) via NuGet in an easy way using only Visual Studio.

Step1. Create a new Widows Phone 8 Application Project in Visual Studio:
image
Step2. If you have not used NuGet before then go to "VisualStudio Tools-> Extentions and Updates.." as demonstrated below:
image
Step3.Go to "Visual Studio Gallery" tab and type "Nuget" in the search box. Next  install "NuGet Package Manager"  as demonstrated below:
image
image image
NOTE: Once the installation has finished, you must restart Visual Studio, in order for the changes to take effect!
image
Step4. After you have installed the NuGet Package Manager just right-click the References folder in your project and from the context menu select the "Manage NuGet Packages.." option:
image
Step5-a. A new window will appear where you can search for a particular package. So just start typing "windows phone toolkit"  in the search box and you should see the "Windows Phone Toolkit " package on top. Next press install.
image
Step5-b: Alternatively you can Installing he "Windows Phone Toolkit " package using the command line:
Just go to View ->Other Windows -> Package Manager Console:
image
Next type the following code in the console:
PM> Install-Package WPtoolkit
Step6. After the installation has finished you should see the following:
image
Step7. That was all. You will notice that your project now references the Windows Phone Toolkit  assemblies and a new Toolkit.Content Model folder has been automatically added to your project. Your project is now set up and  you are ready to start using the Windows Phone Toolkit  in your application..
image
Step8. Later if you want to update to a new  version of  the Windows Phone Toolkit  , you can use the following NuGet command:
PM> Update-Package WPtoolkit
That was all about how to install Windows Phone Toolkit - October 2012 (8.0 SDK) via NuGet.

Tuesday, February 19, 2013

Windows Phone : ShareStatusTask and ShareLinkTask


In this post I am going to talk about ShareLinkTask and ShareStatusTask that come with the Windows Phone Mango update of the developer tools.
Note: ShareLinkTask and ShareStatusTask do not work on the emulator. So you will need real Mango device connected to Facebook,Windows Live, etc. in order to test them.
ShareLinkTask
Basically ShareLinkTask launches a dialog that enables the user to share a link on the social networks like for example Facebook, Windows Live, etc.
To start using it you will need to include the following namespace:
Namespace:  Microsoft.Phone.Tasks 
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
 
All you need to do in order to this launchers in your application is:
Step1: Create an instance of  ShareLinkTask,
Step2: Set desired propertied: Title, LinkUri, Message.
Step3. Call Show():

ShareLinkTask shareLinkTask = new ShareLinkTask();
shareLinkTask.Title = "WindowsPhoneGeek";
shareLinkTask.LinkUri = new Uri("http://windowsphonegeek.com", UriKind.Absolute);
shareLinkTask.Message = "The ultimate resource for Windows Phone Development.";
shareLinkTask.Show();

ShareStatusTask
Basically  ShareStatusTask launches a dialog that enables the user to share a status message on the social networks (Facebook, Windows Live, etc.).
To start using it you will need to include the following namespace:
Namespace:  Microsoft.Phone.Tasks 
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
All you need to do in order to this launchers in your application is:
Step1: Create an instance of  ShareStatusTask,
Step2: Set desired propertied: Status.
Step3. Call Show():

ShareStatusTask shareStatusTask = new ShareStatusTask();
shareStatusTask.Status = "Current Status: Developing WP7 apps.";
shareStatusTask.Show();

That was all about using ShareLinkTask and ShareStatusTask in a Windows Phone Mango application. You can find the full source code of the demo here:



Monday, February 18, 2013

Flip Tile template for Windows Phone 8



Applies to: Windows Phone 8 only
The flip Tile template flips from front to back.
This template is specific to Windows Phone 8. For more info about Tiles in Windows Phone OS 7.1, see Windows Phone OS 7.1 Tile template.

Windows Phone Flip Tile template showcase image
The following image shows the API name associated with each aspect of the Tile template. You use theFlipTileData class to update any of these properties.
Windows Phone Flip Tile template properties
The following image describes sizing info for the flip Tile template.
Windows Phone Flip Tile template size information


You can create or update a flip Tile using either XML or code. There’s no way to know which Tile size your customer has pinned to Start, so you should include all elements.

Creating or updating a flip Tile using XML

The following code example shows how to create or update a flip Tile using XML.
xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification" Version="2.0">
  <wp:Tile Id="[Tile ID]" Template="FlipTile">
    [small Tile size URI]</wp:SmallBackgroundImage>
    <wp:WideBackgroundImage Action="Clear">[front of wide Tile size URI]</wp:WideBackgroundImage>
    <wp:WideBackBackgroundImage Action="Clear">[back of wide Tile size URI]</wp:WideBackBackgroundImage>
    <wp:WideBackContent Action="Clear">[back of wide Tile size content]</wp:WideBackContent>
    <wp:BackgroundImage Action="Clear">[front of medium Tile size URI]</wp:BackgroundImage>
    <wp:Count Action="Clear">[count]</wp:Count>
    <wp:Title Action="Clear">[title]</wp:Title>
    <wp:BackBackgroundImage Action="Clear">[back of medium Tile size URI]</wp:BackBackgroundImage>
    <wp:BackTitle Action="Clear">[back of Tile title]</wp:BackTitle>
    <wp:BackContent Action="Clear">[back of medium Tile size content]</wp:BackContent>
  </wp:Tile>
</wp:Notification>

Creating or updating a flip Tile using code

The following code example shows how to create or update a flip Tile using C# code.
FlipTileData TileData = new FlipTileData()
{
   Title = "[title]",
   BackTitle = "[back of Tile title]",
   BackContent = "[back of medium Tile size content]",
   WideBackContent = "[back of wide Tile size content]",
   Count = [count],
   SmallBackgroundImage = [small Tile size URI],
   BackgroundImage = [front of medium Tile size URI],
   BackBackgroundImage = [back of medium Tile size URI],
   WideBackgroundImage = [front of wide Tile size URI],
   WideBackBackgroundImage = [back of wide Tile size URI],
};

Clearing a flip Tile

To clear a value for a property in XML, set the Action attribute to Clear for that property. To clear a value for a property in code, set the value to an empty string.














ref : http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206971(v=vs.105).aspx

Wednesday, February 6, 2013

Make IIS not render pages as WML. Ever!

i have hosted my website on IIS server, sometimes my pages shows the html sorce code on the browser.

i was unable to understand WTF was really happening,

i was trying to findout the solution on google by searching queries like
- how to stop rendering html source code on browser or iis
....

after some time i came to know that is called a s WML .. .

and so on i have found this link..

1st solution
-------------

If you want a no-code/no-aspx change, you can add a browser capabilities file into the folder App_Browsers directly under your application root (if the folder's not there, just create it). To disable WML, simply put a file named ForceHtml.browser (anything ending in .browser) containing the following XML:

   refID="Default">
    
       name="preferredRenderingMime" value="text/html" />
       name="preferredRenderingType" value="html32" />
       name="preferredImageMime" value="image/gif" />
       name="tagwriter" value="System.Web.UI.HtmlTextWriter" />
    
markupTextWriterType="System.Web.UI.HtmlTextWriter" />
answered by Ruben

2nd solution
---------------------

We had this, and since we are using razor with html, the pages can't adapt automatically. For me, the simplest fix was to change the content-type in the _ViewStart.cshtml:
Response.ContentType = "text/html";
The "figure out the content-type yourself" insanity only happens when nothing is set explicitly. So... set it.
Your actual views can still override this:
@{
    Layout = null;
    Response.ContentType = "application/atom+xml";
}

answered by Marc Gravell

i have followed the 2nd solution today lets c is it fixing my problem or not ....


ref - http://stackoverflow.com/questions/1261144/make-iis-not-render-pages-as-wml-ever/5909281#5909281