O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a SimpleStackPanel

Let’s look at replicating another existing panel, but one that does a bit more work while measuring and arranging. We’ll create a SimpleStackPanel that acts just like StackPanel. The only major difference between SimpleStackPanel and StackPanel is that our version is missing some performance optimizations. Listing 20.2 contains the entire implementation in the context of a Windows Store app.

LISTING 20.2 SimpleStackPanel.cs: The Implementation of SimpleStackPanel

using System;using Windows.Foundation;using Windows.UI.Xaml;using Windows.UI.Xaml.Controls;namespace CustomPanels{  public class SimpleStackPanel : Panel  {    // The direction of stacking    public static readonly DependencyProperty ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required