Friday, December 30, 2011

System.Math Class in C#

Namespace: System

Assembly: mscorlib (mscorlib.dll)

Here is a recap from Math Class in MSDN and is depend on .NET Framework version 4.5. You can switch to the other versions once you navigate to the MSND website.

Methods:

Monday, December 19, 2011

Create Your Metro Style App Package and Share It with your Friends

In this topic, I would like to talk about how to easily create a Metro Style App Package and deploy it to the other developer-enabled Windows 8 PC .

Wednesday, November 30, 2011

Monday, October 17, 2011

Using Windows Phone 7 Emulator

Windows Phone Emulator is a desktop application that emulates a Windows Phone 7 or a Windows Phone 7.1 device. Here is a list of topics that I found on the Internet and thought it is useful for me. Hope you enjoy it.

Thursday, September 22, 2011

Parallel Programming in the .NET Framework

.Net Framework 4.0 brought a new feature to simplify parallel development that runs your application on computers and workstations that have two or more cores. Still, unlike mainframe systems this is not going to enable you to run your application on a specific core (CPU). However, it does provide a lot more easier way to develop your multi-thread application. Let's see what it can do now.

Tuesday, September 13, 2011

Gesture in Windows Phone 7

Here are some  interesting information I found on the Internet.

Monday, September 12, 2011

Publish your Windows Phone 7 Apps

Here are links will very helpful for myself hope it will help you on your work.

"The Application Development Lifecycle" in Application Platform Overview for Windows Phone

Windows Phone 7 Silverlight Controls

First, check these sites for a look about Silverlight controls: Silverlight 3 Toolkit Demo, Silverlight Toolkit. This toolkit is that it’s completely compatible with Windows Phone 7 applications that use Silverlight.

Friday, September 9, 2011

Using the Bing Map Control on Windows Phone 7

 

Related Topics:

Network services for Windows Phone 7

Please take a look at MSDN documents first. I will add my thought later.

The WebClient and HttpWebRequest classes can be used for a wide range of HTTP-based programming, from general HTTP requests to programming web and data services.

A Demonstration About How to Consuming Windows Phone Services Series by using WebClint class:
Part 1 - Web Client Basics
Part 2 - HttpWebRequest Fundamentals
Part 3 - Parsing REST based XML Data - Part A - Single Result
Part 4 - Parsing REST based XML Data - Part B - Multiple Results

Another example in 31 Days of Windows Phone | Days #25: Talking to External APIs

Push Notification for Windows Phone 7

You can take a look at the related topics below and then here is a simple demonstration: 31 Days of Windows Phone | Day #19: Push Notifications

Thursday, September 8, 2011

WebBrowser Control for Windows Phone 7

About how to use the WebBrowser control in your Windows Phone 7 application you can take a look at the related topics below.

Panorama Control and Pivot Control

Panoramic experiences offer a unique way to view controls, data, and services by using a long horizontal canvas that extends beyond the confines of the screen.

The Windows Phone Pivot control provides a quick way to manage views or pages. It can be used for filtering large datasets, viewing multiple data sets, or switching application views.

Isolated Storage in Windows Phone

Depending on the type of data to be stored, Windows Phone applications can use isolated storage in the following ways:

  • Settings: Store data as key/value pairs by using the IsolatedStorageSettings class.
  • Files and folders: Store files and folders by using the IsolatedStorageFile class.
  • Relational data: Store relational data in a local database by using LINQ to SQL.

Life Cycle in Windows Phone 7

This is a sample for saving and restoring your state on deactivation and reactivation respectively. The follow code is a copy from my App.xaml.cs file.

Using Location Services on Windows Phone 7

GeoCoordinateWatcher class lives in System.Device.dll and in System.Device.Location namespace. To use it you have to add a reference in your project’s References fold and add a using reference in you .cs file if you wish.

How to Make the Phone Vibrate

VibrateController virbate = VibrateController.Default

virbate.Start(TimeSpan.FromMilliseconds(100));

Using the Accelerometer on Windows Phone 7

There are two articles about this topic that is very helpful and I believe it will very helpful to you too. Go and take a loot at them since mine is an abbreviation of those: 31 Days of Windows Phone | Day #11: Accelerometer and Using the Accelerometer on Windows Phone 7 on The Windows Phone Developer Blog.

There are two major usages of the accelerometer:

  1. Orientation relative to our planet Earth (assuming the device is being held steady)
  2. Detecting movement of the device relative to the initial point (assuming you know the orientation).

Windows Phone 7 Emulator Tips

This page is only some reminders for myself and here is the official document about Windows Phone 7 Emulator.

Wednesday, September 7, 2011

Lunchers and Choosers

Here is the official document about lunchers and choosers overview for Windows Phone.

The difference between lanchers and choosers are: Launchers do not return data or status to your application; Choosers can return data and status to your application. However, if the user presses Start while the new application is open, the calling application may never be reactivated.

Orientation in Windows Phone 7

There are two properties in your Page.xaml file that control your project's orientation:

SupportedOrientations="Portrait" Orientation="Portrait"

Overriding the Back Button

Normally, the back button in your phone will take you backwards through the pages that you have visited. You can override it to make it do what you want.

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)

{

// Your code goes here.

// ...

e.Cancel = true;// Remember to add this to Cancel the default behavior.

}

Page Navigating

There are tow main ways to navigate between pages: use hyperlinks and via code

Thursday, July 28, 2011

What is the different between a StackPanel and a VirtualizingStackPanel

Although it is easy to understand after you’ve tried to use them. I would like to use others explanation about this question. It may help me easy to recall its difference.

First, the original information comes from stackoverflow.com. I reduced its content for easier and faster reading. Go to the original one if you still don’t know what is it mean.

Wednesday, July 27, 2011

How to Bring Parent Window to Front in WPF application

After you close your child window you always like to have your parent window to present in front of you right away. In Windows Form Applications we can use BringToFront() method to bring your window or control to the front of your screen. How can we do in WFP applications?

There is a easy way to make it happen.

In your parent window set it on focus when the child window is closed. How can we know the child window is closed? Just add a closed even handler to your child window after you introduce it and before you use it.

        private void button1_Click(object sender, RoutedEventArgs e)

        {

            YourChildWindow newChildWindow = new YourChildWindow();

            newChilddWindow.Closed += new EventHandler(newChildWindow_Closed);

            newChildWindow.Show();

        }

 

        void newChildWindow_Closed(object sender, EventArgs e)

        {

            this.Focus();

        }

Tuesday, July 26, 2011

Build an ImageButton in a WFP Project

I found a interest article from one of the MSDN blogs.

Here is a easier way to do it if you are in hurry.

        <Button Name="btnClose" ToolTip="Close" Click="btnClose_Click">

            <Image Source="/MyStudyTool;component/Images/CloseButton.png" />

        </Button>

Related Topics:

Using Attached Properties to Create a WPF Image Button

How to Develop Full Screen WPF Applications

As the topic says, here is the answer.

And this is the best solution that I have tried.

Try this in your Window1.xaml in your Window statement:

WindowStyle = "None" to get a window without border

WindowState = "Maximized" to make the window full screen

How to Use the WebBroswer Control

WebBroswer control could be used in WPF applications and Windows Form applications. However, there are quite difference while you try to apply it to these two type of applications. This document will focus on these difference then the complete usage of them.

If you are more interest in more detail about how the control does please go to the MSDN web site : WebBrowser Control (Windows Forms) , WebBrowser Control (WPF) , WebBrowser Control (Windows Phone 7)

How to prevent someone copy information from your website

The first thing that I want to do when I start my blog is how to prevent someone else copy information from my blog. I did some search on the Internet before I dig in to it. Then I realized there are two things we should do to prevent it happen: disable showing context-menu and disable mouse right click and ctrl + c.