Pages

Wednesday, 22 August 2012

WinRT/Xaml/AKA Metro DataTemplate selection based on Data Types


You may have noticed that WinRT does not have automatic resolution of a DataTemplate based on the data type of object added to an ItemsControl. While unfortunate as this behavior is quite handy, it’s not too difficult to replicate the functionality using a DataTemplateSelector.

WPF for example, could do something like this:

<DataTemplate DataType="{x:Type local:Task}">
  <StackPanel>
    <TextBlock Text="{Binding Path=TaskName}" />
    <TextBlock Text="{Binding Path=Description}"/>
    <TextBlock Text="{Binding Path=Priority}"/>
  </StackPanel>
</DataTemplate>

When the Task type as shown above was found in a list, it would have been rendered as a StackPanel with three TextBlocks automatically. That rocked.

Read full article here

Testing Windows 8 apps using Visual Studio 2012


Testing Windows 8 apps using Visual Studio 2012

As we continue to innovate on the operating system platform with Windows 8, we also enhanced the toolset available in Visual Studio to increase your productivity in testing your Windows 8 apps. Ensuring a top notch quality of your app in this new modern OS environment through thoughtful design and testing will help increase the success of your app. In a previous blog post on Testing Metro style apps in Windows 8, we highlighted some of the key areas you need to take into account for building a high quality Windows 8 app. In this post, we explore a few capabilities in Visual Studio 2012 that will make the testing and verification of your app easier.

Read full article here

Windows Store-apps: WinRT XAML vs. Silverlight XAML


Last weekend I’ve finished the XAML-chapter of my upcoming book about developing Windows Store-apps with XAML and C#. I want to share the things that you should know about the WinRT XAML – the way I call it here – if you’re familiar with Silverlight or WPF.
The WinRT XAML is much like the XAML we know from Silverlight. But there are some differences in WinRT XAML:
  • the way you use your custom namespaces is different
  • there are some missing things (TypeConverters, Custom MarkupExtensions)
Let’s look at the two parts

Read full article here

Using SVG with Windows 8 HTML/JavaScript apps


Using SVG with Windows 8 HTML/JavaScript apps A common scenario when building a touch interface is having a particular UI element that you want to scale seamlessly between different screen sizes.  This is different than having the layout scale.  When scaling a layout, you make sure that content appears in roughly the same place, or in an optimized layout for a given screen real estate.  What I am talking about here is you have a particular interactive element that needs to scale according to screen size.   If you have a simple need, like scaling a logo, you can find examples of how to do that here.

An example would help illustrate what I am talking about.  Imagine I am making a basketball application and I want to allow users to tap an on-screen basketball court to track where shots are taken.  An example of what I am talking about is shown to the right.  My screen layout will be dependent on the court.  The bigger the screen, the bigger the court.  Using SVG is a great way to solve this problem.

Read full article here
Web Informer Button