Category Archives: XAML

Building Metro style apps with XAML and C++

With Tim Heuer

http://channel9.msdn.com/Events/Windows-Camp/Developing-Windows-8-Metro-style-apps-in-Cpp/Building-Metro-style-apps-with-XAML-and-Cpp/player?w=640&h=480

Write NATIVE C++ Code with XAML Event

image

The Channel 9 Event is happening live today on Channel 9.. Catch it today live right now..
(Editor’s Note: Since the event is past now  All sessions will be available for on demand viewing on 5/21 or 5/22.)

http://channel9.msdn.com/Events/Windows-Camp/Developing-Windows-8-Metro-style-apps-in-Cpp

Tweet questions to #ch9live.
Whether you are a new C++ developer ready to learn about writing Metro style apps, an intermediate developer who wants to hone your code and skills, or an experienced C++ developer eager to squeeze every ounce of performance out of your Metro style app, this event is for you.  We will have pragmatic advice for every developer writing Metro style apps and games with XAML and/or DirectX and C++.
Note: These Windows-specific talks will use both portable ISO C++ and Visual C++-specific compiler extensions.

image

The MetroPad Project: Designing and Building for Win 8

An Ode to Arktronics TextCraft

When I was a young kid in high school, I was quite the computer geek.  Nastier people in high school called me a nerd. Nowadays the jocks that I know, nicknamed me “Super Techie”.. I was a very lucky kid though. My first real computer (that did more than BASIC language programming) was called the Commodore-Amiga 1000.  It’s pictured below. I scanned a picture of it below from original specification sheets I still kept today..  And, yes, I am an Amiga collector today..

image

I loved this computer because BASIC didn’t show up when you loaded it up, you got the multi-tasking AmigaDOS though I spent many hours learning programming in Amiga Lattice C and finally SAS C, . Computers didn’t multi-task back then or really even task switch. Computers usually had 4 to 16 colors, and this one had 4096 that you could see on screen at once. It had a BIMMER (A super “blitter”) and three separate chips that ran independent of the CPU most of the time. These days we call this kind of thing a GPU..

a_scuzz_nov14_02The first GUI word processor I got for this was called TextCraft, in those days software wasn’t sold and licensed in quite the same way as it is today and Commodore-Amiga released for the Amiga 1000 under AmigaDOS 1.0-1.3..  The first time I saw TextCraft my first thoughts were I want to reach right out and touch the buttons on the screen.

It was done by a small local company called Arktronics (later called the Disc Company) who did the first GUI based word processor called Jane for the Apple ][ and Commodore 128 8-bit computers.  I was asked to come in on Saturday mornings during high school and beta test for them. It was fun and free and I got to meet company founders (back so long ago) like Bobby Kotick who later bought Activision and is now the president of Activision Blizzard.

TCProject

The user interface was simple and effective and what we would consider a spartan text editor today, but as I mentioned before it looked touch friendly and inviting for touch..  Very Mac like but colorful (unlike the Macs of it’s time).  And very touch friendly (even though we didn’t have a touch interface on an Amiga until a few years later (Elographics) and it looked nothing like an Apple iPad today or a Windows 8 Slate PC either..

METRO INFLUENCERS

When I saw the Windows 8 Metro interface for the first time I started doing some free association about what I thought of it as a design language. What it meant for touch and the first time I wanted to touch a computer’s screen.  I got that same feeling again when I started looking at “METRO” apps on a Windows 8 Tablet.

Microsoft Word from the upcoming Office 15 version ??

I don’t need something a complicated as (in the picture above) to process text. The screen shot above is supposedly of the upcoming Microsoft  Word in the upcoming Office 15. My app will be less complex, and be just touch enabled to take notes and process text. This app isn’t to create novels on like I could with the upcoming  “metro” Word update in Office 15.  Check out the WinSuperSite Preview by clicking on the picture above..

By the way, is this a “REAL” METRO APP ? From the pictures, it still seems to use the Windows Desktop Mode for it’s document creation (at least so far as what we have seen so far).

But heck!  I want a “tablet” touch friendly interface experience that I can type right on the screen with to create simple text documents. I don’t even’ really need Rich Text Format for what I am doing just simple “type and go” type .  So that was my impetus for starting to work on a “MetroPad” app for Windows 8, and to also give me a chance to to learn to create a running “metro” style application with Blend for Visual Studio and Visual Studio 11.

Giving our project the “metro” treatment

So I decided to re-imagine TextCraft as it would look had it jumped from 1985 to 2012 in a few hours..

image

Stay away from the feature creep

The first thing that I thought of when I decided to create a Metro app.. What were my tasks ?

  • Basic text editing cut/paste/copy/undo/selection
  • Styling Text: Bold, Italics, and underline
  • Load or Save locally or in the cloud
  • Inserting an image into our text layout
  • Basic printing

Starting our project with Blend for Visual Studio

Why not just get started by opening Visual Studio and getting started coding ? Because we are designing a real METRO app ! That’s why!  Ultimately you should start with wireframes and good design practice.  You might want to start here..

Integrating design as part of the agile development process

 

 

The days of “Make it look pretty..” are gone

lipstikPigIf you are a programmer you are about to get mad at what I am going to say to you..  I am going to take you out of your comfort zone.  Even with WPF and Silverlight there weren’t strict standards for user interface adherence. You could get away with coding everything then going back and hiring a designer to cobble something together to make your code together into something that worked but not something your users’ could live with are gone ..

image
If you started your application for Windows  and it looks like a bad game of tic-tac-toe or the TV show “The Hollywood Squares” you really aren’t getting the point of the METRO design language in the first place.

In this instance a “Live Tile” is not a menu item or a menu button..  This is not how you select something.  Do you think this would sell competitively ?

 

METRO APP TEMPLATES ARE DESIGN FIRST

imageI have been just about crapping in my pants about how ineffectively “METRO” design principles are being conveyed at WIndows 8 bootcamps lately. Yes that means you Microsoft Developer Evangelists, I am calling you out on this..

If you get an introduction to Windows 8 with someone first opening Visual Studio and not Blend FIRST! then you are getting a really bad deal. There is no easier way for a developer to go down the wrong path without this.. The reason that Blend is not Expression Blend but Blend for Visual Studio is that Microsoft feels that Blend is such an integrated part of Visual Studio now it will come integrated into every commercial version of Visual Studio for Windows 8..

Default templates now included with both Visual Studio and Blend are now included a warning message that if you don’t include “METRO” design functionality in your interface that they will not work and will not be accepted to the “Windows Marketplace”..

image

ReadMe.txt:

“The Common directory contains classes and XAML styles that simplify application development. These are not merely convenient, but are required by most Visual Studio project and item templates. Removing, renaming, or otherwise modifying the content of these files may result in a project that does not build, or that will not build once additional pages are added.  If variations on these classes or styles are desired it is recommended that you copy the content under a new name and modify your private copy.”

What is in the common folder that’s so important ?

Value Converters

Boolean Negation: A boolean negation converter for visibility that  translates true to  Visibility.Visible and false to  Visibility.Collapsed

Boolean to Visibility: A value converter that translates true to false and vice versa.

Layout Aware Page Class

A common implementation of “Page” that provides several important conveniences

  • Adds an  application view state to visual state mapping
  • GoBack and GoHome event handlersr
  • A default view model

BindableBase.cs

An implementation of INotifyPropertyChanged that simplifies models. Creates a “multicast” event handler and listener for INotifyPropertyChange events.

RichTextColumns.cs

A wrapper for RichTextBlock that creates as many additional overflow columns as needed to fit the available content.

StandardStyles.xaml

Standard light and dark styles and rules for metro apps. These will be familiar to Blend designers.

Freezing your Application with Suspension Manager Code

image

Because Windows 8 and METRO applications now run on both ARM and Intel devices and can scale to phones, tablet, PCs and even maybe some other types of devices we haven’t thought of yet that can run on batteries,  Microsoft recommends you include code to freeze and unfreeze your application temporarily. In a world where we run on extremely low power devices with batteries being able to suspend your METRO application has become extremely important..

Microsoft provides SuspensionManager.cs sample code that you can use  for handling this process.  I have heard more than one programmer since Windows Phone and Windows 8 suggest that the ability to “Freeze” apps and switch isn’t real multi-tasking. Well my response is this: if you have a device (other than a desktop PC) that you can switch off and switch back on at anytime and you an OS that has to fetch things at odd intervals and must stop what it’s doing then be “instantly” back on you need to be able to do this.

There are many situations where you may loose a data connection as well that the device can’t just sit there eating your battery. Under Windows Mobile battery life was terrible. It was mostly because multi-tasking was a continuous thing and the suspend resume facilities that were added weren’t used effectively by app programmers.

This also affects the user experience and user interface as well. You can’t just really terminate and restart the program and expect the user not to get annoyed when they pick up the device and were not right back where they left it.

It needs to remember what the user was doing and where it was when they left off.  This works well in all cases including when the program is waiting for too long for something (including things like a data request from the internet) and is terminated by the operating system so it’s not caught in a battery eating loop.

Programmers might ask wait, suspending “apps” has to do with design. Well our program must remember what was going on before, context, state, etc. so when it resumes and reactivates the user finds themselves right back where they were when they see your app’s UI.

For more information on lifecycle events check out:

  1. http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465115.aspx
  2. http://blogs.msdn.com/b/windowsappdev/archive/2012/04/10/managing-app-lifecycle-
    so-your-apps-feel-quot-always-alive-quot.aspx

The OnLaunched Lifecycle Event

Adding an OnLaunched event handler code, lets your app can check the PreviousExecutionState on the event arguments. If it equals Terminated, restore the data you saved in the Suspending event. If it is a different value, use your app’s default data.

In our app we could even override the OnLaunched event to handle activation a basic activation from a live tile.

Here’s an example code snippet  that Microsoft provides for creating an OnLaunched Handler to deal with user activation of a stock app that loops through all possible scenarios including resuming from a suspend application:

image

More on this later, but in our own app, the user might be editing or entering text that they haven’t saved, and if the user has suspended work and switched to another app or he has powered down his device we want to be able to fetch the text back to the exact state he was in before.

Starting in Blend for Visual Studio

image

As soon as I am in Blend for Visual Studio I am going to create a new project. For this project I am going to use C# and XAML just as I would have if I were doing a .NET project in the past instead of a WinRT project right now.. I could just as easily do this in JavaScript or C++ native code because Blend supports them both. In a future installment I will look at doing this app in C++.  Unlike past versions of Windows the WinRT XAML controls that we will be using are the same across these different languages and have all the same  capabilities, in both native and managed code, making our development cycle much easier.  Here is a look at the XAML control toolbox in Microsoft Expression Blend..

WinRTControls

Since we are doing text editing and processing in our app I was hoping to find a “rich” textbox control that handled “RTF” (rich text format) text and had methods already established for formatting text.  Unfortunately since we are in the “beta” state there seems to be NO SUCH control as I have seen in previous versions of Windows to make this easier.  I would really love to be able to change the typeface and control formatting text and decorations that adorn the look and style of my users’ text more precisely. 

My options currently are as follows:

image

This forces me again to think about the user experience and which controls I am going to use.. I finally decided to use the RichEditBox because every other option seems to be one way and static one way bindings for data.

imageNext, I started to create the elements I needed on-screen starting with the RichEditBox.. My layout ended up looking like this and there is still some new options needed but let’s focus on our main work area for now the RichEditBox control..

image

After dropping the RichEditBox control in our BlankPage.XAML main grid on the design surface of blend in the main stack panel I named the control RTBEdit and set-up properties for the control.  The XAML code looked like this:

<RichEditBox x:Name=”RTBEdit” Height=”400″ VerticalAlignment=”Top” ScrollViewer.HorizontalScrollBarVisibility=”Disabled” ScrollViewer.VerticalScrollBarVisibility=”Visible” BorderBrush=”Black” Background=”White” FontSize=”26.0″/>

Our next adventure will be wiring up the RichEditBox  to bring in a text file using the file picker.

I will next create the background rectangle for my RULER and create a series of buttons and create a code behind to pick and read the file into the RichEditBox for viewing and editing..

So to get started I create a series of buttons in the main Grid’s StackPanel and set the ordering so it will include a rectangle the RichEditBox and FileDetail TextBlock which will later show us the file name of the text we have currently loaded up.

imageIn the main Grid I will also create a horizontal StackPanel and name it Menus. Here I will add our project menu to load and save files. There will be a few other buttons for Layout, Styling text,  and any Extra capabilities we might implement.  Since this is a text editor that is touch friendly we will only allow one file open at a time.

So this means I will use the Project menu to Load new text and contextually save when necessary. We will automatically check to see if the text is UNSAVED and prompt the user clicking the Project Button.

image

Before we fill the rest of these out, let’s wire up some code to the ProjectBtn so we can pick a file to open and load the text right into the RichEditBox control.

imageWhen we select the ProjectBtn control we notice that it is simply a control derived and inheriting the properties and capabilities of the Windows.UI.Xaml.Controls Class..  and it reacts to the ButtonBase CLICK event.

When this click event fires on our project button we will need it to access the “METRO” file picker and read in the text file into our RichEditBox for user manipulation.

imageMaking sure we have the ProjectBtn Clicked in the design surface, we go over to the properties panel and select the events icon that looks like the symbol for lightning.

This will switch us to the next view to define our code-behind.

imageNext we will  name our “Click“ event UIOpenFile_Click. When we hit enter after typing the name,  Blend will next open us up in code mode away from design mode on BlankPage.XAML.cs  and give us the frame for us to type in the code needed to open up our file picker in the METRO interface and select files..  Be sure to watch for duplicate names in the code.

Here in our code editor we can next enter code for when this event fires.

image

We next add code to pick the file and load up our RichEditBox with the text file..

image

So the first thing we do is create a keyword NEW instance of the FileOpenPicker() function that we will name picker.

var picker = new FileOpenPicker();

Next we define a few of the more important properties to help guide the user along..

picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
picker.ViewMode = PickerViewMode.List;

First should set a start location for this picker to open. We should point it to open up right inside the users own documents library.. Since we are not dealing with loading an image in this case (just opening a text file) I am going to show the picker in the file list mode instead of thumbnails.

picker.FileTypeFilter.Clear();
picker.FileTypeFilter.Add(“.txt”);

// no RTF file support yet in RichEditBox picker.FileTypeFilter.Add(“.rtf”);
picker.FileTypeFilter.Add(“.htm”);   

Next I am going to set our picker to clear any file type  filters that are already set and only show us files ending in .TXT and .HTM format.  We could add more filters  to show only the filetypes we needed. But this works fine for now.

var file = await picker.PickSingleFileAsync();
if (file == null) return;
string fileContent = await FileIO.ReadTextAsync(file);

Next, tell it to wait until the user has chosen a file and make sure there is content in it before trying to read it into memory and store it in the RichEditBox.   Here is our Picker opened up ready to choose a file.

image

After the file is read we pass the name of the file to the TextBlock control’s text property so the user sees the name of the file we are loading.

FileDetail.Text = file.Name.ToString();

Next we call the RichEditBox’s SetText  functionality to pass the file object that the Picker has created for us to pass the content into RichEditBox for editing.

 this.RTBEdit.Document.SetText(Windows.UI.Text.TextSetOptions.None, fileContent.ToString());

and voila!! We can now load text right into our RichEditBox..

image

Introducing Expression Blend for Visual Studio Part 1

image
Introducing Expression Blend for Visual Studio using XAML Part 1

By Don Burnett Expression Blend MVP 2011-2012

Just what is Expression Blend for Visual Studio ? Why is Expression Blend now a Visual Studio product ? Well as most folks familiar with Windows development know, the process is not just about the programmer but it is also about incorporating good design for your user. About six years ago Microsoft Expression Blend was introduced as a what you see is what you get interface design tool and versions of this program have appeared to support not just WPF (Windows Presentation Foundation) tools but also support platforms as Silverlight (for .NET web browser based applications), Phone 7, and Sketchflow prototyping. All of these tools (while containing it’s own code editor) always allowed you to integrate directly with the Visual Studio code IDE (Integrated Development Environment).

Blend Should Be Everywhere!

Late last year when Microsoft decided that it was going to start focusing on putting together a next generation Windows environment that became Windows 8, they decided to promote better synergy between all platform product groups. Blend has always been directly part of that and it made sense that Microsoft could start integrating all of these environments together. Developers find themselves in Blend too.  Out of this (and the fact that Expression Blend and Expression Encoder were tightly part of the same workflow for many users out there and Expression Design had been supplanted by Adobe Photoshop and Adobe Illustrator Importing directly from Blend it made sense that in a revamped environment that Blend would make sense to be part of Visual Studio and a version would come with or be available to every version of Visual Studio available out there including Express Editions. 

When the product groups inside Microsoft were re-organized and integrated Microsoft also began sharing code between the Visual Studio XAML designer group and the Blend Group to make a more consistent environment between Blend and Visual Studio. This has produced some spectacular results. It also meant a version of Blend should make it to all development platforms Microsoft supports.

With the announcement of Windows 8 Microsoft has also integrated HTML 5 designer capabilities optionally instead of XAML, into the mix, for Windows 8 METRO applications (which work much like apps do in Windows Phone 7)

A Tour of The New Blend Beta

image

From the first glance we see that the New Blend is not a METRO app itself, but looks familiar and runs in the “classic desktop” environment for now.. In fact, besides some better more readable icons, it looks very much like the same old Blend we all know and love. However, there are a FEW additions to support HTML 5 and CSS 3.  And yes Virginia there is support for CSS 3 Media Queries before you ask..

The Project Menu

image

The project menu has been re-designed.. In a WinRT/ Metro app you will notice some difference to your “Solution”. There is now a “Common” folder with some new files that MUST be present to make the application work, these include BindableBase.cs, a set of standard XAML styles for the application called “StandardStyles.xaml”, RichText Column support, and LayoutAwarePage.cs. There are also two default converters files present for all metro apps called a BooleanNegation converter and a BooleantoVisibility converter. They help you convert datatypes from the ones you use in code to the types that are required for on-screen manipulation.

Also present in this beta (though creating a sample datasource thus far isn’t present in this beta) is a sample datasource so you do have a template for creating and working with Sample Data. It can be easily modified to support your own data (more on this later).

There is also a package.appxmanifest  file that is required for metro apps. Much like windows phone apps the manifest allows the app to be identified and signed with the appropriate identity information and developer “signatures”.

The package.appxmanifest file

As you can see below the sample app manifest contains identity information, pre-requisites for OS Versioning, a resources section to provide Windows the basic information to hook the application into the METRO environment and a capabilities section much like Windows Phone to identify things like if the application can access the internet or not.

<?xml version=”1.0″ encoding=”utf-8″?>
<Package xmlns=”
http://schemas.microsoft.com/appx/2010/manifest”>

  <Identity Name=”5274dfe2-c8a0-408e-833c-f887ff6a9f1c”
            Publisher=”CN=don”
            Version=”1.0.0.0″ />

  <Properties>
    <DisplayName>GridExampleXAML</DisplayName>
    <PublisherDisplayName>don</PublisherDisplayName>
    <Logo>Assets\StoreLogo.png</Logo>
    <Description>GridExampleXAML</Description>
  </Properties>

  <Prerequisites>
    <OSMinVersion>6.2</OSMinVersion>
    <OSMaxVersionTested>6.2</OSMaxVersionTested>
  </Prerequisites>

  <Resources>
    <Resource Language=”x-generate”/>
  </Resources>

  <Applications>
    <Application Id=”App”
        Executable=”$targetnametoken$.exe”
        EntryPoint=”GridExampleXAML.App”>
        <VisualElements
            DisplayName=”GridExampleXAML”
            Logo=”Assets\Logo.png”
            SmallLogo=”Assets\SmallLogo.png”
            Description=”GridExampleXAML”
            ForegroundText=”light”
            BackgroundColor=”#222222″>
            <DefaultTile ShowName=”allLogos” />
            <SplashScreen Image=”Assets\SplashScreen.png” />
        </VisualElements>
    </Application>
  </Applications>
  <Capabilities>
    <Capability Name=”internetClient” />
  </Capabilities>
</Package>

For more information about setting up these capabilities, check out Microsoft’s information at:

http://msdn.microsoft.com/en-us/library/windows/apps/br211380.aspx

Creating a New Project

Upfront we notice that there are METRO style monochrome icons that are much more readable.. If we go to create a “New Project” we will notice a few new project types and templates.  There is HTML and XAML available for Creating a Windows 8/WinRT  Metro Style Application.

image

 

There are in-built templates for Blank, Grid, Split, Fixed Layout, and Navigation Style Apps.. But more on this a bit later.. Notice the Javascript support above for creating a METRO style app as well..

image

XAML support isn’t forgotten either with it’s own sets of templates.

Grid Applications

image


If you select a “Grid Application”, Blend will provide you with a “Single Page Project that navigates betwee groups of items and has dedicated “Master-Detail” pages to display Items.. Here is a view of the template’s master-detail pages in action.

image

GroupDetailPage.xaml

image

ItemDetailPage.XAML

image

We can deploy this skeleton code either directly to the environment or test it on a Windows Tablet Device Simulator..  We can set this up through a panel in the “Platform”  panel in Blend..

image

You can set the screen size to match a particular on market device’s resolution and DPI when previewing and check your layouts with Horizontal and Vertical functionality (portrait/landscape) as well as scaling.. You can set the deploy target also to your local machine instead of the Emulator/Simulator as shown in the graphic above..

Deployed Locally

image

Deployed to the Simulator

image

Other Blend Features In XAML

The Visual State Manager

In the past if you were not a Silverlight designer you will not notice any default states or defined states in the visual state manager. In a WPF application you had to define all of these yourself..  For METRO apps there are are few already defined states that accommodate different screen modes..

image

These including Landscape (full screen) mode, Filled Mode, Portrait mode, and Snapped mode. I highly recommend you do not delete any of these unless your “METRO” app is only supporting one of these modes which again is HIGHLY NOT recommended..

You can use the state manager to create and handle state management of your own on-screen items, controls and their transitions, by creating more visual state groups for your own elements in XAML

Timeline Animation

You can also create complex animations with the OBJECTS and TIMELINE storyboard option.. In this example I am creating a new storyboard on one of the new METRO “FlipView” controls..

image

image

 

Collections

Collections in XAML for “Metro Apps” have been improved over other versions of XAML you can now create a CollectionView for items that are grouped on to your page.. Setting the source for a Collection of elements to be used on a page is now quite easy in XAML. In our UserControl Resources we just add a CollectionViewSource Element as seen in the XAML  below…

<common:LayoutAwarePage
    x:Name=”pageRoot”
    x:Class=”GridExampleXAML.GroupedItemsPage”
    xmlns=”
http://schemas.microsoft.com/winfx/2006/xaml/presentation”
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
    xmlns:local=”using:GridExampleXAML”
    xmlns:data=”using:GridExampleXAML.Data”
    xmlns:common=”using:GridExampleXAML.Common”
    xmlns:d=”
http://schemas.microsoft.com/expression/blend/2008″
    xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″
    mc:Ignorable=”d”>

    <UserControl.Resources>

        <!– Collection of grouped items displayed by this page –>
       
<CollectionViewSource
            x:Name=”groupedItemsViewSource”
            Source=”{Binding Groups}”
            IsSourceGrouped=”true”
            ItemsPath=”Items”
            d:Source=”{Binding ItemGroups, Source={d:DesignInstance Type=data:SampleDataSource, IsDesignTimeCreatable=True}}”/>
    </UserControl.Resources>


Blend Goes Native with C++ Project Supportimage

Many programmers were shocked to hear that you could create a Windows Metro App UI now in HTML and JavaScript, but may the most exciting and OVERLOOKED support in Blend for Visual Studio is now the ability to create Windows apps directly in Windows own Native C++ environment.. Before Native Code in XAML was impossible unless you had created an App for Windows Embedded with Visual Studio 8 and the “WEST” Toolkit using Silverlight with C++.. Now because of the merge of product groups Microsoft has now enabled non .NET coding. They have also taken most of the pain away of trying to write a SKELETON “metro” app for those new to Native code development with Windows. Microsoft also has documented these templates well for new users.. Here is a link for you:     http://go.microsoft.com/fwlink/?LinkId=234232

Lets take a look at our ItemDetailPage.xaml’s C plus plus (.CPP) and header (.h) files..

ItemDetailPage.xaml.h

//
// ItemDetailPage.xaml.h
// Declaration of the ItemDetailPage class
//

#pragma once

#include “pch.h”
#include “Common\LayoutAwarePage.h” // Required by generated header
#include “Common\RichTextColumns.h” // Required by generated header
#include “ItemDetailPage.g.h”

#include <collection.h>

namespace Application13
{
    /// <summary>
    /// A page that displays details for a single item within a group while allowing gestures to
    /// flip through other items belonging to the same group.
    /// </summary>
    public ref class ItemDetailPage sealed
    {
    public:
        ItemDetailPage();

    protected:
        virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
    };
}

ItemDetailPage.xaml.cpp

//
// ItemDetailPage.xaml.cpp
// Implementation of the ItemDetailPage class
//

#include “pch.h”
#include “ItemDetailPage.xaml.h”
#include “DataModel\SampleDataSource.h”

using namespace Application13;
using namespace Application13::Data;

using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Graphics::Display;
using namespace Windows::UI::ViewManagement;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;

// The Item Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234232

ItemDetailPage::ItemDetailPage()
{
    InitializeComponent();
}

/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name=”e”>Event data that describes how this page was reached.  The
/// Parameter property provides the initial item to be displayed.</param>
void ItemDetailPage::OnNavigatedTo(NavigationEventArgs^ e)
{
    auto item = safe_cast<SampleDataItem^>(e->Parameter);
    DefaultViewModel->Insert(“Group”, item->Group);
    DefaultViewModel->Insert(“Items”, item->Group->Items);
    flipView->SelectedItem = item;
}

The code isn’t that much different than .NET code for the skeleton and the new templates take much of the guess workout and make doing a C++ native app even for beginning programmers a doable thing.

One of the first things I noticed about C++ apps is that they are already nicely touch enabled and on the properties panel there are some new options..

image

To Be Continued…

Part two will continue our look at Blend for Visual Studio and what’s missing from Blend Ultimate and will look at Visual Studio 11 Integration and HTML 5/CSS 3 layout based applications for Windows 8..

Remembering Popfly

image

Wow so the market churns and changes, it seems like it was just last year, well actually it was 2007 when Microsoft started creating Silverlight based Web Mashup Applications under the banner of Microsoft Popfly. It lasted until 2009.

image

Since then web based work flows and mashup applications have become the norm..

Microsoft has since released other workflow mashup tools including the new Data Explorer CTP that lets you get information on “Big Data” and public data sources on the web.

image

The Microsoft Expression Blend Team launch BlendInsider

This is very cool, check this out.. The Blend Team just launched their new blog at BlendInsider.com

image

Videos Include XAML and HTML

http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-504T/player?w=601&h=327

http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-486T/player?w=601&h=327