/// <summary> /// Open property window. /// </summary> private void MenuItem_Properties_Click(object sender, RoutedEventArgs e) { string filePath = this.mediaElement.Source.LocalPath; string fileName = new FileInfo(filePath).Name; MediaInfo mi = this.GetPlayedMediaInfo(); string time = ShortTime.TimeToString(this.mediaElement.NaturalDuration.TimeSpan); this.LibraryManager.ShowProperties(fileName, filePath, mi.MediaType, time, mi.Resolution); }
/// <summary> /// Media opened event handler. /// Set Media size when it opened. /// </summary> /// <param name="milliseconds"></param> void mediaWindow_OnMediaOpened(double milliseconds) { this.positionSlider.Maximum = milliseconds; if (this.mediaWindow.HasVideo) { this.VideoSize = String.Format(" / Video size : {0} x {1}", this.mediaWindow.VideoWidth, this.mediaWindow.VideoHeight); } else { this.VideoSize = null; } string time = ShortTime.TimeToString(new TimeSpan(0, 0, (int)(this.positionSlider.Maximum / 1000))); if (this.listWindow != null && this.listWindow.PlayedMediaItem != null) { ItemContent content = ((ItemContent)this.listWindow.PlayedMediaItem.Content); content.Time = time; MediaInfo mi = this.mediaWindow.GetPlayedMediaInfo(); content.MediaType = mi.MediaType; content.Resolution = mi.Resolution; } }