Building a Metro App Part 2: Listing 3

SharingFeed Class XAML

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.ApplicationModel.DataTransfer;
using VSMWinRTDemo.RSS;

namespace VSMWinRTDemo.UI
{
    public sealed partial class SharingFeed
    {
        public SharingFeed()
        {
            InitializeComponent();
        }

        public void Activate(ShareTargetActivatedEventArgs args)
        {
            ViewModel.SharedFeed sharedFeed = new ViewModel.SharedFeed(args.ShareOperation.Data);
            this.DataContext = sharedFeed;


            Window.Current.Content = this;
            Window.Current.Activate();
        }
    }
}

About the Author

Eric Vogel is a Sr. Software Developer at Kunz, Leigh, & Associates in Okemos, MI. He is the president of the Greater Lansing User Group for .NET. Eric enjoys learning about software architecture and craftsmanship, and is always looking for ways to create more robust and testable applications. Contact him at vogelvision@gmail.com.