Wednesday, 18 March 2015

Page Navigation in Windows Phone 8.1

Hello Every One,


How to Page Navigation  in Windows phone 8.1 application?

This Post shows you how to navigate pages in windows phone 8.1 and how to pass parameter in other pages also.

Step 1:

Open Visual Studio 2013 create new Project in windows phone app. Select Blank App(Windows Phone) and give application name and location.

Step 2:

Open MainPage.xaml file and select one Button from toolbox panel, set Button content with "go to page 2".

Button is for navigate to second page.



Step 3:

Now Add one new Bank Page form Solution Explorer right-click, add new item. Give Page name as "Page2.xaml".



Step 4:

Now in Page.xaml add one Button and one Textblock from toolbox, set Button content with "go to page 1" and Textblock Text with "Value : ".

Button is for navigate to first page and textblock will show the parameter value.



Step 5:

Now go to MainPage.xaml and add Button click event and write code like this :



Step 6:

Same as go to Page2.xaml and add Button click event write code like this :


Now Run the Project and click on button you will navigate form one Page to another.

Step 7:

Now how to pass parameter in other page?

In Button event of MainPage.xaml write code like this :



Now go to Page2.xaml.cs file in OnNavigated Method write code like this :



Now Run the Project again and click on button you will receive value in textblock ; 



Step 8:

You can send multiple value or object as a parameter.
for that you have to add one Class file and give name as MyClass. And declare two variable inside the class like this :



Now go to MainPage.xaml.cs file in button click event declare MyClass Object and pass as parameter like this :


Step 9:

Now go to Page2.xaml.cs in OnNavigated Method write code to get object value like this :

Now again Run the Project and click on button you will navigate on Page2.xaml and get Output like this: 
Thank You.

Tuesday, 10 March 2015

Progress Bar and Progress Ring Control for Windows Phone 8.1

Hello Every One,

Progress Bar and Progress Ring Control in Windows phone 8.1 application.

Progress Bar and Progress Ring control shows the progress of an operation, or shows that an operation is in progress.

Let's see how Progress Bar and Progress Ring work. Follow below Steps.

Step 1:

Open Visual Studio 2013 create new Project in windows phone app. Select Blank App(Windows Phone) and give application name and location.

Step 2:

Now move on to Mainpage.xml drag textblock control set text="Progress Bar" and  drag Progress Bar Control  from Toolbox, set property minimum, maximum, value if required. By Default minimum is 0 maximum is  100 and value is 25.



Step 3:

Now add one another Progress Bar and now set IsIndeterminate="True" or  in properties IsIndeterminate  checked it.



Step 4:

Now drag Progress Ring Control from Toolbox and set IsActive="True" or in properties IsActive checked it.
And finally your Progress Bar and Progress Ring demo is created, Now run it.




Thank You.

Friday, 27 February 2015

MessageBox Popup in Windows Phone 8.1

Hello Every One,

How to Popup MessageBox in Windows phone 8.1 application?

MessageBox is used when your tast or activity will done then show a popup screen in windows phone 8.1 application.

Let's see how MessageBox will Popup. Follow below Steps.

Step 1:

Open Visual Studio 2013 create new Project in windows phone app. Select Blank App(Windows Phone) and give application name and location.

Step 2:

Open MainPage.xaml file and select one Button from toolbox panel, set Button content with "Popup MessageBox" like this :



Step 3:

Now goto MainPage.xaml.cs file and add new namespace.

using Windows.UI.Popups;

Step 4:

Now in button click event write below code :
Make your click event as async.

 private async void Button_Click(object sender, RoutedEventArgs e)
        {
            // MessageDialog msg = new MessageDialog("Hello World.");
            MessageDialog msg = new MessageDialog("Hello World.","MessageBox");
            await msg.ShowAsync();
        }



The MessageDialog class will create Messagebox  to popup and it take one or two argument.
"Hello World." is Message content or Message Body part.
"MessageBox" is Title of MessageBox.

Now You can Run the project and click on button to Popup the MessageBox.



Thank You for see this post.

Sunday, 22 February 2015

Let's learn Basic Controls in Windows Phone 8.1

Hello Everyone.

Now let's see about some Basic or Common XAML Controls in this Post.
In this we learn some basic controls like TextBox, Button, TextBlock,

First of launch Visual Studio 2013
FILE -> New -> Project give project name and location.

1) TextBox Control :

TextBox control allow you to enter some input text at run time.

Common properties are like Name, Text, Height, Width, Font properties etc you can change.Drag TextBox from Toolbox panel. The TextBox control in Windows Phone 8.1 supports setting Header text and Placeholder Text.

Header text  Property allow you to set Header of Textbox and Placeholder allow you to set  Watermarked Text in your TextBox control.




2) Button Control :

Button control allow you to Click and perform some task at run time.
It has some common properties like Name, Content, Height, Width etc.



3) CheckBox Control :

CheckBox control is use for choice option to select 'on' and 'off'.
It has some common properties like Name, Content, Height, Width etc.
It has one IsChecked property to checked at design time and to check at run time is
checked or not.



4) RadioButton Control

RadioButton Control is used to choice only one choice from available option.
It has some common properties like Name, Content, Height, Width etc.
It has one IsChecked property to checked at design time and to check at run time is
checked or not and GroupName which is used to give same name for radioname.


Thursday, 12 February 2015

Create First Program " Hello World " in Windows Phone 8.1 Application.

If you want to Create first program in windows phone app then follow below  steps :

Step 1 :

Start Visual Studio Click File -> New -> Project. or you can press shortcut key (Ctrl+Shift+N) which is show in snap short.



Step 2 :

It will open new window "New Project" then you have to select Visual C# -> Windows Phone Apps from sidebar and give application name which you want to give and define Location where you want to store. Here we give Hello World as Name an Location as E:\WindowsPhone\ which is shown as snap short.




    It will open new project with main page.


Step 3 :


Now you have to drag and drop TextBlock control form toolbox which is show in Toolbox. If you can't show Toolbox  then go to VIEW menu and select select Toolbox.



Step 4 :

Click on TextBlock and Go to Properties panel, change Text property to Hello World.
And Then Click on Emulator 8.1 WVGA 4 inch  512MB which is sho in snap short
There are many Emulator available you can run in any emulator as you wish.



Step 5 :

Now it will open One Emulator which you have selected and take some loading process to open and finally you first "Hello World" program is completed .Which you can see. 




Wednesday, 11 February 2015

Windows Phone 8.1 development Tools


Hello Everyone.


                The Windows Phone 8.1 development tools are installed with Visual Studio Express 2013. The SDK for wp8.0 and wp8.1 are already inbulit in it. So, you have to install only vs2013 express.
If you already have a version of Visual Studio 2012 installed, then you have to download the SDK for Windows Phone SDK 8.1.

If you want to download vs2013 then click below.

Visual Studio 2013 Express.


If you want to download sdk for windows phone 8.1 then click below.

Tuesday, 10 February 2015

Introduction about Windows Phone 8.1 development.

Hello Everyone.


Welcome to this Windows Phone 8.1 development for Beginners in my Blogs.
I have try this Blog for windows phone developer. For that you have to install Visual Studio 2013 where SDK for windows phone is inbuilt you have not to install separately. Before windows phone development you already know C#. This Blog may help you to develop Windows Phone Application.

In this we start learning about XAML(Extensible Application Markup Language) is an XML-based markup language developed by Microsoft. XAML is a declarative markup language. XAML files are XML files that have .xaml extension. The files can be encoded by any XML encoding, but encoding as UTF-8 is typical. Lets see one XAML example.


Example :-


<StackPanel>
 <Button Content="Click Me"/>
</StackPanel>


So let's see Windows Phone development tools in next post.