Ejemplo n.º 1
0
        /// <summary>
        /// Remove all references of a hub tile before finalizing it.
        /// </summary>
        /// <param name="tile">The hub tile that is to be finalized.</param>
        internal static void FinalizeReference(HubTile tile)
        {
            WeakReference wref = new WeakReference(tile, TrackResurrection);

            HubTileService.RemoveReferenceFromEnabledPool(wref);
            HubTileService.RemoveReferenceFromFrozenPool(wref);
            HubTileService.RemoveReferenceFromStalledPipeline(wref);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes the frozen image from the enabled image pool or the stalled image pipeline.
        /// Adds the non-frozen image to the enabled image pool.
        /// </summary>
        /// <param name="obj">The dependency object.</param>
        /// <param name="e">The event information.</param>
        private static void OnIsFrozenChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            HubTile tile = (HubTile)obj;

            if ((bool)e.NewValue)
            {
                HubTileService.FreezeHubTile(tile);
            }
            else
            {
                HubTileService.UnfreezeHubTile(tile);
            }
        }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
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);
 }