Exemplo n.º 1
0
        static void OnHubTileSizeChanged(object sender, SizeChangedEventArgs e)
        {
            HubTile hubTile = (HubTile)sender;

            hubTile.SizeChanged -= OnHubTileSizeChanged;

            // In order to avoid getting into a bad state, we'll shift the HubTile
            // 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 (hubTile.State != ImageState.Expanded)
            {
                hubTile.State = ImageState.Expanded;
                VisualStateManager.GoToState(hubTile, Expanded, false);
            }
            else if (hubTile._titlePanel != null)
            {
                CompositeTransform titlePanelTransform = hubTile._titlePanel.RenderTransform as CompositeTransform;

                if (titlePanelTransform != null)
                {
                    titlePanelTransform.TranslateY = -hubTile.Height;
                }
            }

            HubTileService.InitializeReference(hubTile);
        }
Exemplo n.º 2
0
 /// <summary>
 /// This event handler gets called as soon as a hub tile is added to the visual tree.
 /// A reference of this hub tile is passed on to the service singleton.
 /// </summary>
 /// <param name="sender">The hub tile.</param>
 /// <param name="e">The event information.</param>
 void HubTile_Loaded(object sender, RoutedEventArgs e)
 {
     HubTileService.InitializeReference(this);
 }