Support VideoViewer error text wrapping
Some checks failed
MSBuild / build (push) Has been cancelled
MSBuild / publish (push) Has been cancelled

This commit is contained in:
ema
2025-09-30 22:30:30 +08:00
parent 342f14ebd9
commit a112ea58ac

View File

@@ -204,8 +204,12 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
{ {
((MediaUriElement)sender).Dispatcher.BeginInvoke(new Action(() => ((MediaUriElement)sender).Dispatcher.BeginInvoke(new Action(() =>
{ {
_context.ViewerContent = _context.ViewerContent = new TextBlock()
new Label { Content = e.Exception, VerticalAlignment = VerticalAlignment.Center }; {
Text = e.Exception.ToString(),
TextWrapping = TextWrapping.Wrap,
VerticalAlignment = VerticalAlignment.Center,
};
_context.IsBusy = false; _context.IsBusy = false;
})); }));
} }
@@ -215,7 +219,7 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
if (mediaElement == null) if (mediaElement == null)
return; return;
mediaElement.MediaPosition = 0; mediaElement.MediaPosition = 0L;
if (ShouldLoop) if (ShouldLoop)
{ {
IsPlaying = true; IsPlaying = true;
@@ -233,7 +237,7 @@ public partial class ViewerPanel : UserControl, IDisposable, INotifyPropertyChan
private void ShowViedoControlContainer(object sender, MouseEventArgs e) private void ShowViedoControlContainer(object sender, MouseEventArgs e)
{ {
var show = (Storyboard)videoControlContainer.FindResource("ShowControlStoryboard"); var show = (Storyboard)videoControlContainer.FindResource("ShowControlStoryboard");
if (videoControlContainer.Opacity == 0 || videoControlContainer.Opacity == 1) if (videoControlContainer.Opacity == 0d || videoControlContainer.Opacity == 1d)
show.Begin(); show.Begin();
} }