static void PageStage_ScaleChanged(object sender, RoutedEventArgs e) { DispatcherTimer timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 0, 0, 50); if (ScaleChanged != null) { ScaleChanged(sender, e); } timer.Tick += (a, b) => { _windowAssetShow = new windowAssetShow(AssetType.Movie, null); ((ControlMediaElement)sender).Pause(); _windowAssetShow.Position = ((ControlMediaElement)sender).Position; _windowAssetShow.AssetPath = ((ControlMediaElement)sender).Source.OriginalString; _windowAssetShow.ShowDialog(); ((ControlMediaElement)sender).btnZoomChecked = true; ((ControlMediaElement)sender).Position = _windowAssetShow.Position; ((ControlMediaElement)sender).Play(); timer.Stop(); }; timer.Start(); }
static void item_showAsset(UIElement item, ObservableCollection <string> liststring) { windowAssetShow windowAssetShow = new windowAssetShow(AssetType.Image, liststring); windowAssetShow.item = item; windowAssetShow.ShowDialog(); }