Windows Store App – Focus on TextBox when Navigated To The Page

Some time you want to make your app more user friendly by automatically focus on specify control for example search text box so that when user open the page, they can start typing the keyword they want to search rather than click on the search text box first then only start typing.

I try to use TextBox.Focus() in OnNavigatedTo, but it nothing happen. So I try to use the same method use in Silverlight by creating a DispatcherTimer and delay the focus by 0.5 second. Well, this method work out in Windows Store App. If you are interested, below are the code.

// timer to create initial focus on control
DispatcherTimer initialFocusDispatcherTimer = new DispatcherTimer();
initialFocusDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
initialFocusDispatcherTimer.Tick += (tickSender, tickEvent) =>
    {
        initialFocusDispatcherTimer.Stop();

    // focus on search bar
    SearchTextBox.Focus(Windows.UI.Xaml.FocusState.Keyboard);
    };
initialFocusDispatcherTimer.Start();

 

 

by Ooi Keng Siang via Ooiks’s Blog

Get Ready for WOWZAPP 2012 in Malaysia

 

A few more days to go before WOWZAPP Malaysia 2012 kick start! So what is this WOWZAPP first? Just in case if you don’t know what is WOWZAPP, it is a worldwide hackathon for developers to get building cool apps for Windows 8. There are thousands of developers around the world building apps for the next generation of Windows during this event. WOWZAPP in Malaysia will be on 10-11 Nov 2012 at MMU, Cyberjaya. Music, free food, expert help, free resources will be available there to assist your learning and coding without sleep. Maybe a bit of sleep.

For more information: http://aka.ms/mywowzapp2012

Continue reading Get Ready for WOWZAPP 2012 in Malaysia

Windows Store App – Check If File Exist or Not

Before Windows 8, to check a file exist or not on Windows Phone 7.5 or .NET can be as simple as calling the file.IsFileExist() and it will return a simple boolean indicated whatever the file exist or not. But Windows 8 team decided to have a totally different way and I had no idea why Microsoft or Windows 8 team decided to re-write it.

Anyway, here is how it work out in Windows 8 app (C# code):

public async Task<bool> IsFileExist(string path)
{
    try
    {
        await Windows.Storage.StorageFile.GetFileFromPathAsync(path);

        // file found
        return (true);
    }
    catch
    {
        // file not found
        return (false);
    }
}

 

by Ooi Keng Siang via Ooiks’s Blog

Windows 8 – Screen Brightness Problem

A lot of peoples including myself can’t wait to try out the latest version of Windows which is the Windows 8 Release Preview. Everything work like a charm expect the screen brightness issue which cause a lot of trouble to me since the Consumer Preview version. Every time after my computer resume from sleep, hibernate or boot up after a shutdown, the screen’s brightness will automatically adjust to the lowest. No matter how hard I punch on the brightness increase button, it will automatically go down to zero again.

After some research and try-error, I finally able to fix this troublesome problem. If you are facing the same problem, you might want to go through the list one by one. Some might work for you, some might not, depending on your computers.

Continue reading Windows 8 – Screen Brightness Problem

Building Windows Phone 7 App on Windows 8

With the release of Windows Phone SDK 7.1.1 Update, building Windows Phone 7 app on Windows 8 is now possible. I decided to jump on and try out Windows 8 while building my Windows Phone app, but I hit the wall right after I install Windows 8, Visual Studio and all the SDK then compile my Windows Phone app. Visual Studio told me that Microsoft.Xna.Framework.dll (which is use to play sound in my Silverlight app) is not found.

Aren’t the new 7.1.1 update suppose to make everything all right? It turn out that there are some problems with XNA which didn’t get installed when I run Windows Phone SDK 7.1. After some searching on the net and I found the solution for this. Just simple follow the following step by step:

  1. Download and install Zune Software (if you haven’t install)
  2. Download and install Games for Windows Marketplace Client
  3. Download and install Windows Phone SDK 7.1
  4. Download and install Windows Phone SDK 7.1.1 Update

Oh, just in case you installed everything but without the  Games for Windows Marketplace Client, you will need to repeat the step 2 to 4 (if you haven’t install Zune, then you need to repeat step 1 to 4).

Although everything work perfectly OK, but the emulator is a little bit lag compare running on Windows 7 which was a known issue in Windows 8.

 

Source

 

by Ooi Keng Siang via Ooiks’s Blog

Imagine Cup 2012 – Windows Metro Style App Challenge

As we all know Windows 8 is on the way and is going to be the next big product of Microsoft in this year, so this year Microsoft Imagine Cup bring a new challenge to the student call Windows Metro Style App Challenge. Microsoft challenge the student to be at the forefront of those creating applications for this new platform. Apps are the center of the Windows 8 experience and great apps start with you. This Challenge will test students ability to prototype a Metro style app that takes advantage of Windows 8 features and design principles to deliver an experience that solves one of the world’s toughest problems and wows not only the judges but those across the globe. So sign up and get ready to take your first quiz!

The first round is super duper simple. Just grab your 3 smartest friends and join in the quiz. Your team just need to score more than 50% in order to get into the next round. Simple enough! Just select any one of the time during the 24 hour quiz session and join in.

  • Quiz 1 – 31 January 2012
  • Quiz 2 – 7 February 2012
  • Quiz 3 – 14 February 2012
  • Quiz 4 – 21 February 2012
  • Quiz 5 – 28 February 2012
  • Quiz 6  -6 March 2012

 

So you still have questions and doubt about this challenge? Then get your questions ready! Join Windows Metro Style App Challenge Captain Jura Clapman on 15 February at 16:00 GMT or 16 February at 03:00 GMT via Live Meeting and ask her about competing in the Windows Metro Style App Challenge. There are two ways to join Live Meeting, found it out at  Windows Metro Style App Challenge page.

Sources: http://www.imaginecup.com/Competition/mycompetitionportal.aspx?competitionId=70

 

by Ooi Keng SiangMSPSMT via Ooiks’s Blog