//------------------------------------------------------ // // Public Properties // //------------------------------------------------------ private static void PlayerPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { VideoDrawing target = ((VideoDrawing)d); MediaPlayer oldV = (MediaPlayer)e.OldValue; MediaPlayer newV = (MediaPlayer)e.NewValue; System.Windows.Threading.Dispatcher dispatcher = target.Dispatcher; if (dispatcher != null) { DUCE.IResource targetResource = (DUCE.IResource)target; using (CompositionEngineLock.Acquire()) { int channelCount = targetResource.GetChannelCount(); for (int channelIndex = 0; channelIndex < channelCount; channelIndex++) { DUCE.Channel channel = targetResource.GetChannel(channelIndex); Debug.Assert(!channel.IsOutOfBandChannel); Debug.Assert(!targetResource.GetHandle(channel).IsNull); target.ReleaseResource(oldV, channel); target.AddRefResource(newV, channel); } } } target.PropertyChanged(PlayerProperty); }
private static void RectPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { VideoDrawing target = ((VideoDrawing)d); target.PropertyChanged(RectProperty); }