WindowsPhoneGeek

WPAppInfo

Login | Join (Why?)

rss rss rss
logo

Tips & Tricks rss

5/9/2012

by DiAbLoxx83

In this post I will show how to create a simple function for ask confirm on exit application.

ConfirmOnExit

Step 1. You need to create a function for clear navigation history:

private void ClearBackEntries()
{
    while (NavigationService.BackStack != null & NavigationService.BackStack.Count() > 0)
        NavigationService.RemoveBackEntry();
}

NOTE: in Markeplace there are many applications with an annoying problem when you try exit from main page: you have to navigate all visited pages. With this function you can solve the problem.

...

3/26/2012

by Senthil Kumar

When submitting one of my Apps (Number Converter for Windows Phone) to the Windows Phone Marketplace, I got this error when uploading my .XAP file

clip_image002

The [NeutralResourceLanguage] attribute is missing on the entry assembly.

When searched for this error in Google, I found out that the cause of the error is the wrong NeutralResourceLanguage set in the Windows Phone Project.

...

3/16/2012

by KHK

It looks like the off-the-shelf WP7 SDK, the Silverlight SDK, and even the Coding4Fun suite lack one very basic piece of functionality that you may want to provide your WP7 app users with: selecting the font style (family, bold, italic), color and size.

Since I needed something like that myself, I thought: why won't I just pack it and share with the fellow developers? ;-)

So, here it is: http://wp7textstylepicker.codeplex.com/

ScreenDarkSScreenLightS

...

3/16/2012

by WindowsPhoneGeek

This is the 7th post  from the "Windows Phone Application Development for Beginners" series of articles in which I use a more informal approach in order to explain everything you need to know in order to get started developing Windows Phone applications in a simple and easy to understand way.

NOTE: If you are a professional Windows Phone Developer you should probably stop reading now - this series is for absolute beginners.

In short to create Windows Phone application User Interface in addition to layout panels you use controls as well, such as buttons,checkboxes, shapes, text, and other content presented on the screen. Every Control element is reusable and can be customized by setting different value to its properties (For reference take a look at Windows Phone App Development for Beginners #5 Basic XAML ).

...

3/1/2012

by Kate Brown

In this quick tip I will demonstrate how easy it is to implement Twitter and Facebook sharing when developing for Windows Phone. In fact many people think that it is hard and time consuming implementation but there is a pretty fast and simple alternative using the new aditional launchers that came with Windows Phone Mango.

So the easiest way to add Twitter and Facebook share buttons is to use the ShareLinkTask class. This class allows your Windows Phone  application to launch a dialog that enables the user to share a link on the social networks (of their choice). All you need to do is to use the following code:

ShareLinkTask shareLinkTask = new ShareLinkTask();
shareLinkTask.Title = "Article Title";
shareLinkTask.LinkUri = new Uri("http://www.microsoft.com", UriKind.Absolute);
shareLinkTask.Message = "Some Message to be shared"; 
shareLinkTask.Show();

As it is written in the MSDN documentation:

  • Public propertyLinkUri: Gets or sets the link URI that will be displayed in the link sharing dialog.
  • Public propertyMessage: Gets or sets the message that will accompany the link when it is shared.
  • Public propertyTitle: Gets or sets the title of the link to be shared.

NOTE: You will also have to include the following namespace using Microsoft.Phone.Tasks;

...

2/17/2012

by Waleed Arafa Al-Zoghby

In this article I'm going to talk about "Data Binding" between elements. I will use "Slider" & "TextBox" elements to clarify the idea.

Suppose that you have 2 elements a slider and a TextBox; and you want to bind the value of slider to the text property of textbox element so you will have a binding source: "Slider" and Binding target: "TextBox" .... it's easy....! Add an event handler "ValueChanged" of slider element and write one line of code like ' TextBox1.Text = Slider1.Value.ToString(); '... it's a traditional method to bind! But I want to demonstrate a feature supported by Silverlight for Windows Phone without adding an event handler.

We will create a new Windows Phone application and drag & drop a slider and TextBox elements on the current page like on the screenshot below. Next, select the TextBox and then "Apply Data Binding." from the Properties Window:

61651864.png image

...

2/9/2012

by WindowsPhoneGeek

This is the 6th post  from the "Windows Phone Application Development for Beginners" series of articles in which I use a more informal approach in order to explain everything you need to know in order to get started developing Windows Phone applications in a simple and easy to understand way.

NOTE: If you are a professional Windows Phone Developer you should probably stop reading now - this series is for absolute beginners.

In short you use different Panels to define the layout of your Windows Phone application. The term layout describes the process of sizing and positioning objects in your app. To position UI elements such as buttons,checkboxes, shapes, text, and other content presented on the screen, you must put them in a Panel (or other container object).

NOTE: I will start using the terms "UI element" or "Object" in order to describe elements such as buttons,checkboxes, shapes, text, and other content presented on the screen.

To allow for complex layouts, Silverlight for Windows Phone currently implements panel elements such as Canvas, StackPanel, and Grid discussed below.

imageimageimageimage

...

1/27/2012

by WindowsPhoneGeek

In this quick tip I am going to talk about how to add TiltEffect to the MultilistSelect control(which is part from the Windows Phone Toolkit).

For more information of how to get started using MultiselectList control take a look at:

I will also use the source code from this previously posted article: How to get the Tapped Item in a MultiselectList control

How to add Tilt Effect to MultiselectList?

Usually, the only thing that you have to do in order to use the TiltEffect  is to set toolkit:TiltEffect.IsTiltEnabled="True"  like in the snippet bellow:

...

1/23/2012

by Lorenzin David

As you already know, a pirated xap of your app was probably uploaded to p2p networks after 1 day from publication,  and is now illegally used by lots of people.

In the meantime MS will introduce the server-side-encryption (hopefully soon), hacking a xap is so simple that it is done by automated web applications.

Anyway, you can now turn piracy to your advantage! With this code, you can detect if your app was hacked using the "automated" method, and if so just open the Marketplace pointing to your "real" app.

Basically, an hacked xap is identical as your original xap, lacking a file called WMAppPRHeader.xml (the DRM file), so the phone considers it as a homebrew one and runs it as "full" on unlocked devices.

Just add this code when your app starts and you will be safe for 99.99% of times (this will not protect against reverse engineering and dedicated app attack, but if this happens your app will be famous !). It is a good idea to obfuscate the code too, but first of all implements this trick!

...

1/16/2012

by Tianyu Zhang

While developing my latest WP7 app I came across the question how to add a Panorama to my existing WP7 project. I did not want to use the default Visual Studio templates because they generate too much code(for a simple app like mine) with all the data binding and view models.

In short I had a database and wanted to show some data in a Panorama control without using MVVM or any default VisualStudio template. So here is what I did:

Step1. Lets say that we have an existing Windows Phone application project.

Step2. Add a reference to "Microsoft.Phone.Controls" available under the .NET tab in the "Add Reference" window:

...

Our Top Articles & Free books

Our Top Tips & Samples