AppStore.MainPage.ShowImage C# (CSharp) Method

ShowImage() private method

Deals with populating images(app icons) in the Featured-Apps section.
private ShowImage ( ListViewBase sender, ContainerContentChangingEventArgs args ) : void
sender ListViewBase Object Sender is a parameter called Sender that contains a reference to the control/object that raised the event.
args ContainerContentChangingEventArgs ContainerContentChangingEventArgs args is a parameter called e that contains the event data, see the ContainerContentChangingEventArgs MSDN page for more information.
return void
        private void ShowImage(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            if (args.Phase != 1)
            {
                throw new Exception("Not in phase 1.");
            }
            Apps app = (Apps)args.Item;
            StackPanel templateRoot = (StackPanel)args.ItemContainer.ContentTemplateRoot;
            Image appIcon = (Image)templateRoot.FindName("appIcon");
            appIcon.Source = new BitmapImage(new Uri(app.AppIcon));
        }