Esempio n. 1
0
 void captionManager_MarkerLeft(IMarkerManager <CaptionRegion> markerManager, CaptionRegion region)
 {
     if (regions.ContainsKey(region))
     {
         var presenter = regions[region];
         CaptionsPresenterElement.Children.Remove(presenter);
         VisibleCaptions.Remove(region);
         regions.Remove(region);
         presenter.CaptionManager = null;
     }
     OnCaptionRegionLeft(region);
 }
Esempio n. 2
0
        void captionManager_MarkerReached(IMarkerManager <CaptionRegion> markerManager, CaptionRegion region)
        {
            OnCaptionRegionReached(region);
            if (!regions.ContainsKey(region))
            {
#if HACK_XAMLTYPEINFO
                var children = region.Children as MediaMarkerCollection <TimedTextElement>;
#else
                var children = region.Children;
#endif
                var regionBlock = new CaptionBlockRegion();
                if (CaptionBlockRegionStyle != null)
                {
                    regionBlock.Style = CaptionBlockRegionStyle;
                }
                regionBlock.CaptionRegion  = region;
                regionBlock.CaptionManager = regionManagerFactory(children);
                regions.Add(region, regionBlock);
                CaptionsPresenterElement.Children.Add(regionBlock);
                regionBlock.ApplyTemplate();
                VisibleCaptions.Add(region);
            }
        }