static void OnFlipTileSizeChanged(object sender, SizeChangedEventArgs e) { FlipTile flipTile = (FlipTile)sender; flipTile.SizeChanged -= OnFlipTileSizeChanged; // In order to avoid getting into a bad state, we'll shift the FlipTile // back to the Expanded state. If we were already in the Expanded state, // then we'll manually shift the title panel to the right location, // since the visual state manager won't do it for us in that case. if (flipTile.State != FlipState.Expanded) { flipTile.State = FlipState.Expanded; VisualStateManager.GoToState(flipTile, Expanded, false); } FlipTileService.InitializeReference(flipTile); }
/// <summary> /// This event handler gets called as soon as a flip tile is added to the visual tree. /// A reference of this flip tile is passed on to the service singleton. /// </summary> /// <param name="sender">The flip tile.</param> /// <param name="e">The event information.</param> void FlipTile_Loaded(object sender, RoutedEventArgs e) { FlipTileService.InitializeReference(this); }