/// <summary> /// Triggers the transition between visual states. /// </summary> /// <param name="obj">The dependency object.</param> /// <param name="e">The event information.</param> private static void OnSizeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { HubTile hubTile = (HubTile)obj; // And now we'll update the width and height to match the new size. switch (hubTile.Size) { case TileSize.Default: hubTile.Width = 173; hubTile.Height = 173; break; case TileSize.Small: hubTile.Width = 99; hubTile.Height = 99; break; case TileSize.Medium: hubTile.Width = 210; hubTile.Height = 210; break; case TileSize.Large: hubTile.Width = 432; hubTile.Height = 210; break; } hubTile.SizeChanged += OnHubTileSizeChanged; HubTileService.FinalizeReference(hubTile); }
/// <summary> /// This event handler gets called as soon as a hub tile is removed from the visual tree. /// Any existing reference of this hub tile is eliminated from the service singleton. /// </summary> /// <param name="sender">The hub tile.</param> /// <param name="e">The event information.</param> void HubTile_Unloaded(object sender, RoutedEventArgs e) { HubTileService.FinalizeReference(this); }