/// <summary> /// Handles the SizeChanged event of the CollectionSingleCardRoot control. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="EventArgs"/> instance containing the event data. /// </param> private void CollectionSingleCardGroupedRoot_SizeChanged(object sender, EventArgs e) { Contract.Requires(sender != null); CollectionSingleCardGrouped t = sender as CollectionSingleCardGrouped; NumColumns = (Int32)(t.Width / CardSizes.Current.CardSmallWidth + 1); // +1 for padding }
/// <summary> /// Called when [item template changed]. /// </summary> /// <param name="argSource"> /// The argument source. /// </param> /// <param name="oldValue"> /// The old value. /// </param> /// <param name="newValue"> /// The new value. /// </param> public static void OnItemTemplateChanged(BindableObject argSource, object oldValue, object newValue) { Contract.Requires(argSource != null); Contract.Requires(newValue != null); CollectionSingleCardGrouped layout = argSource as CollectionSingleCardGrouped; Contract.Requires(layout != null); DataTemplate iTemplate = newValue as DataTemplate; layout.theCollectionView.ItemTemplate = iTemplate; }