Showing posts with label windows phone 8. Show all posts
Showing posts with label windows phone 8. Show all posts

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