Windows 8 Toast Notifications

What is Toast Notifications?

Windows 8 has a notification system similar to that implemented in mobile operation systems such as Windows Phone, IOS and Android.

A Windows 8 Toast is a notification triggered by an application or the operating system itself that is displayed to the user by way of a small pop-up notification.

A toast is a small, informational window displayed by certain kinds of software, especially instant messaging clients such as Skype and Windows Live Messenger. Toasts notify users of various kinds of events, such as reception of new e-mail, a change in a peer’s availability, or a change in network connectivity.

Toast Templates

Untitled

Demo

Let’s create project and name it “ToastNotificationsDemo”

x

Then open MainPage.xaml from solution explorer

x

Then drag button from toolbox to page designer and give it content “Show Toast” from properties window

x

Then we need to add event handler to button to show toast lets add click event from properties windows as you see and named it “ShowToastClickEvent”

x

Now event created for you in “MainPage.xaml.cs”

Let’s add Microsoft notification extensions from NuGet Packages (you can read more about it from here http://msdn.microsoft.com/en-us/library/windows/apps/hh969156.aspx)

open package manager console Then install notification package using this command

PM> Install-Package NotificationsExtensions.WinRT

x

Now you will find NotificationsExtensions.WinRT referenced in your project

Let’s back to code “MainPage.xaml.cs” and add our name spaces we will use

using NotificationsExtensions.ToastContent;

using Windows.UI.Notifications; 

Then add event body

privatevoid ShowToastClickEvent(object sender, RoutedEventArgs e)

        {

            IToastText02 content = ToastContentFactory.CreateToastText02();

            content.TextBodyWrap.Text = “Hello…Body…”;

            content.TextHeading.Text = “Hello…Header”;

            ToastNotification notification = content.CreateNotification();

            ToastNotificationManager.CreateToastNotifier().Show(notification);

        }

Finally we let’s create notification 

 

            ToastNotification notification = content.CreateNotification();

Then till the notification manager we need to display it now

            ToastNotificationManager.CreateToastNotifier().Show(notification);

Wait don’t Run Now……

We must enable toast capability from Package.appxmanifest file

x

Now It’s time to run the app and the result will come like that …

Untitled

There is more about notifications if you need learn more go to http://msdn.microsoft.com/en-us/library/windows/apps/hh868266.aspx

cropped-windows1.png

Creating A Virtual Windows Store App Development Environment

If you’d like to create a Windows Store App but don’t have access to a Windows 8 computer, you can build a virtual Windows Store app development environment (for free) using taking the following steps.

0216.image_3

If you want the steps in details check this blog:

cropped-windows1.png

Know the steps in details from here

Bing Maps in your Windows 8 XAML applications

Today we will talk about Bing Maps and how to include it in XAML applications

If you are familiar with the Silverlight control, it is similar in nature to how you would use it in your XAML Metro style app.

Here’s some helpful tips that help you to use and integrate Bing Maps easily in your windows 8 applicaion.

Installing

Installing is simple for Visual Studio.  Download the Bing Maps SDK for Metro style apps (VSIX) file and double-click it.  If you have both Express and Ultimate installed it will prompt you to install it for both installations.  That’s it…you are done.  If you had VS running while you did this, it would be a good idea to restart VS.

Capture

Capture

When you do this you will also want to add a reference to the Microsoft Visual C++ Runtime Extension at this time.

the Map control is a native control.  Adding the Microsoft Visual C++ Runtime dependency at this time will add the necessary information in your app’s package manifest noting the dependency and it will install any required package dependencies from the store when your user’s install it.

Using the Map control

You’ll need to get set up with an API key, which the getting started docs inform you about.  Once you have that you are ready to use the control.  I’m a fan of putting the API key in my App.xaml as a resource:

    <Application.Resources>
        <ResourceDictionary>
           <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Common/StandardStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <x:String x:Key="BingMapsApiKey">YOUR KEY HERE</x:String>
        </ResourceDictionary>
    </Application.Resources>

And then in my Map control I can just refer to it:

     <Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
         <bing:Map x:Name="MyMap" Width="640" Height="480" 
             Credentials="{StaticResource BingMapsApiKey}" />
      </Grid>

I’m done and can run my app and get full map interactivity.  Notice the xmlns declaration “using:Bing.Maps”.  Now when I run:

Screenshot (85)

And Then Check for Location in capabilities from package.appxmanifest

Capture

I can quickly add my location and center a push pin to my location

    async protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        Geolocator geo = new Geolocator();
        geo.DesiredAccuracy = PositionAccuracy.Default;
       var currentPosition = await geo.GetGeopositionAsync();
    
       Location loc = new Location() { Latitude = currentPosition.Coordinate.Latitude, 
           Longitude = currentPosition.Coordinate.Longitude };
     
       MyMap.SetView(
          loc, // location
           20, // zoom level
         true); //show animations)
   
   }

And It’s Done , Now you can Develop Applications using Bing Maps SDK for XAML windows 8 C# Apps

cropped-windows1.png

Windows 8.1 Development resources

There are lots of cool features and improvements in Windows 8.1  so I prepared a one pager for Windows 8.1 resources toolkit that includes all links & resources in a one place.

Picture1

Windows 8.1 Pro – You can install Windows 8.1 Preview using the ISO files (.iso) that are provided on this page.

Visual Studio 2013 for Windows 8.1 – Tool to build Windows store apps for Windows 8.1.

200 Win8.1 Sample AppPack– This package contains over 200 Win8.1 samples from Microsoft.

Windows Store App Design Assets– These .psd assets include templates,common controls and components.

Picture2

Bing Maps BETA SDK for Windows 8.1 Store Apps– Binaries & programming ref for the Bing Maps Win8.1 Control

Player Framework – an open source component of the Microsoft Media Platform

Smooth Streaming Client SDK– consume On-Demand and Live Smooth Streaming content w/ PlayReady

Live SDK 5.4– The Live SDK provides a set of controls and APIs that enable applications to integrate Single Sign On
Multilingual App Toolkit for Visual Studio 2013 – Localize your Windows 8 app with translation support

Remote Tools for Visual Studio 2013 Preview –Remote debugging on computers that don’t have VS installed.

Picture3

Upgrading Windows 8 Apps to Windows 8.1  – Breaking changes documentation from release preview

Windows 8.1 Preview: New APIs and features for developers – What’s new for developers in Win8.1 Preview

Get started with Windows 8Apps – get started building exciting apps that are alive with activity.

Get started with Visual Studio 2013 –development documentation for Visual Studio 2013

Get started with Blend for Visual Studio 2013– design UI/UX tool for your Windows Store Apps

Design UX for Windows 8.1 apps – Design principles, UX design patterns, detailed UX guidelines

Picture4

Learn to build Windows 8 apps – This guide walks you through the essentials of writing your first app.

Developer forums – Developer forums for Windows Store apps covering designing, developing, and selling apps.

Selling apps in the Windows Store – Windows Store markets, developer agreements, and checklists to prepare.

Building Windows 8 blog (B8) – An inside look at how, what, and why different features of Win8 are being built.

Windows 8 app developer blog (D8) – Explores best practices for coding and designing Windows Store apps

Build 2013 – Windows 8.1 Sessions  – Windows 8.1 Keynote and all build session videos

cropped-windows1.png