Microsoft.Phone.Controls.ListPicker.PrepareContainerForItemOverride C# (CSharp) Method

PrepareContainerForItemOverride() protected method

Prepares the specified element to display the specified item.
protected PrepareContainerForItemOverride ( DependencyObject element, object item ) : void
element System.Windows.DependencyObject The element used to display the specified item.
item object The item to display.
return void
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            base.PrepareContainerForItemOverride(element, item);

            // Hook up to interesting events
            ContentControl container = (ContentControl)element;
            container.Tap += OnContainerTap;
            container.SizeChanged += OnListPickerItemSizeChanged;

            // Size for selected item if it's this one
            if (object.Equals(item, SelectedItem))
            {
                SizeForAppropriateView(false);
            }
        }