From 9c605aa118138509d4aba8a58d80b013fae6b313 Mon Sep 17 00:00:00 2001 From: Martin Finkel Date: Mon, 20 Jul 2026 17:05:26 +0300 Subject: [PATCH 1/4] build: centralize Windows App SDK dependency floor Use Windows App SDK 1.7 for WinUI and Uno so MAUI 9 consumers do not resolve the incompatible 1.8 build targets. Newer consumers remain free to resolve higher versions through NuGet. --- src/Directory.Build.props | 4 ++++ src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj | 4 ++-- src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 5929cac1..2b742b4c 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -45,6 +45,10 @@ + + 1.7.250909003 + 10.0.22621.756 en 9.0 enable diff --git a/src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj b/src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj index 484ff0c3..d789052f 100644 --- a/src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj +++ b/src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj @@ -58,7 +58,7 @@ It also contains a VLC MediaPlayerElement for the Uno Platform (UWP, Android, iO - - + + diff --git a/src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj b/src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj index fc74fa47..d7646a62 100644 --- a/src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj +++ b/src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj @@ -34,8 +34,8 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.Windows. - - + + From 41b28653ee4c629fe9ba8fd378df790325280724 Mon Sep 17 00:00:00 2001 From: "joshua.sells" Date: Mon, 3 Aug 2026 18:38:53 +0300 Subject: [PATCH 2/4] Uno: support the WinUI 3 Windows target --- src/LibVLCSharp.Uno/PlaybackControls.UWP.cs | 8 ++----- src/LibVLCSharp.Uno/PlaybackControlsBase.cs | 8 +++---- src/LibVLCSharp.Uno/StringResourceLoader.cs | 21 +++++++++++++++++++ src/LibVLCSharp.Uno/Themes/Generic.xaml | 4 +++- src/LibVLCSharp.Uno/Themes/VideoView.UWP.xaml | 15 +++++++++++++ src/LibVLCSharp.Uno/VideoView.UWP.cs | 5 +++++ 6 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 src/LibVLCSharp.Uno/StringResourceLoader.cs create mode 100644 src/LibVLCSharp.Uno/Themes/VideoView.UWP.xaml diff --git a/src/LibVLCSharp.Uno/PlaybackControls.UWP.cs b/src/LibVLCSharp.Uno/PlaybackControls.UWP.cs index 6c20c248..2fedc5b4 100644 --- a/src/LibVLCSharp.Uno/PlaybackControls.UWP.cs +++ b/src/LibVLCSharp.Uno/PlaybackControls.UWP.cs @@ -21,12 +21,8 @@ protected override void SetToolTip(DependencyObject? element, string? resource, { return; } - var resourceLoader = ResourceLoader; - if (resourceLoader != null) - { - ToolTipService.SetToolTip(element, string.Format(resourceLoader.GetString(resource), - args.Select(arg => resourceLoader.GetString(arg)).Cast().ToArray())); - } + ToolTipService.SetToolTip(element, string.Format(StringResourceLoader.GetString(resource), + args.Select(StringResourceLoader.GetString).Cast().ToArray())); } } } diff --git a/src/LibVLCSharp.Uno/PlaybackControlsBase.cs b/src/LibVLCSharp.Uno/PlaybackControlsBase.cs index fbfa6210..3140a413 100644 --- a/src/LibVLCSharp.Uno/PlaybackControlsBase.cs +++ b/src/LibVLCSharp.Uno/PlaybackControlsBase.cs @@ -684,7 +684,7 @@ private void AddAspectRatioMenu(Button? zoomButton) { var menuItem = new ToggleMenuFlyoutItem { - Text = ResourceLoader.GetString($"{nameof(AspectRatio)}{aspectRatio}"), + Text = StringResourceLoader.GetString($"{nameof(AspectRatio)}{aspectRatio}"), IsChecked = aspectRatio == currentAspectRatio, Command = new ActionCommand(AspectRatioMenuItemClick), CommandParameter = aspectRatio @@ -778,7 +778,7 @@ private void AddTracksMenu(Button? trackButton, TracksManager manager, string av private void AddNoneItem(MenuFlyout menuflyout) { - AddTrack(menuflyout, null, ResourceLoader.GetString("None") ?? string.Empty); + AddTrack(menuflyout, null, StringResourceLoader.GetString("None")); } private void AddTrack(MenuFlyout menuflyout, int? trackId, string trackName) @@ -969,7 +969,7 @@ private void CastButton_Click(object sender, RoutedEventArgs e) { AddCastMenuItem(items, renderer.Name); } - AddCastMenuItem(items, ResourceLoader.GetString("Disconnect"), true); + AddCastMenuItem(items, StringResourceLoader.GetString("Disconnect"), true); ((Button)sender).Flyout = castMenu; } @@ -1034,7 +1034,7 @@ private void ShowError() var errorTextBlock = ErrorTextBlock; if (errorTextBlock != null) { - errorTextBlock.Text = string.Format(ResourceLoader.GetString("Error") ?? string.Empty, Manager.Get().MediaResourceLocator); + errorTextBlock.Text = string.Format(StringResourceLoader.GetString("Error"), Manager.Get().MediaResourceLocator); VisualStateManager.GoToState(this, ErrorState, true); } } diff --git a/src/LibVLCSharp.Uno/StringResourceLoader.cs b/src/LibVLCSharp.Uno/StringResourceLoader.cs new file mode 100644 index 00000000..664168a8 --- /dev/null +++ b/src/LibVLCSharp.Uno/StringResourceLoader.cs @@ -0,0 +1,21 @@ +namespace LibVLCSharp.Uno +{ + internal static class StringResourceLoader + { + private const string ResourceMap = "LibVLCSharp.Uno/Resources"; + +#if WINDOWS + private static readonly Microsoft.Windows.ApplicationModel.Resources.ResourceLoader ResourceLoader = + new Microsoft.Windows.ApplicationModel.Resources.ResourceLoader( + Microsoft.Windows.ApplicationModel.Resources.ResourceLoader.GetDefaultResourceFilePath(), + ResourceMap); + + internal static string GetString(string resource) => ResourceLoader.GetString(resource); +#else + internal static string GetString(string resource) => + Windows.ApplicationModel.Resources.ResourceLoader + .GetForCurrentView(ResourceMap) + .GetString(resource) ?? string.Empty; +#endif + } +} diff --git a/src/LibVLCSharp.Uno/Themes/Generic.xaml b/src/LibVLCSharp.Uno/Themes/Generic.xaml index c7117a53..0cf9c08f 100644 --- a/src/LibVLCSharp.Uno/Themes/Generic.xaml +++ b/src/LibVLCSharp.Uno/Themes/Generic.xaml @@ -1,6 +1,8 @@ - + + diff --git a/src/LibVLCSharp.Uno/Themes/VideoView.UWP.xaml b/src/LibVLCSharp.Uno/Themes/VideoView.UWP.xaml new file mode 100644 index 00000000..3f55b6f6 --- /dev/null +++ b/src/LibVLCSharp.Uno/Themes/VideoView.UWP.xaml @@ -0,0 +1,15 @@ + + + + diff --git a/src/LibVLCSharp.Uno/VideoView.UWP.cs b/src/LibVLCSharp.Uno/VideoView.UWP.cs index 267809d3..571563eb 100644 --- a/src/LibVLCSharp.Uno/VideoView.UWP.cs +++ b/src/LibVLCSharp.Uno/VideoView.UWP.cs @@ -9,6 +9,11 @@ namespace LibVLCSharp.Uno /// public class VideoView : VideoView, IVideoView, IVideoControl { + public VideoView() + { + DefaultStyleKey = typeof(VideoView); + } + /// /// Creates args for event /// From 59ca943ba6c8380b9f19be42a193e63ea24d66a5 Mon Sep 17 00:00:00 2001 From: "joshua.sells" Date: Mon, 3 Aug 2026 18:39:01 +0300 Subject: [PATCH 3/4] samples: add a Windows head to the Uno sample --- .../Uno/LibVLCSharp.Uno.WinUI.Sample/App.xaml.cs | 4 ++++ .../LibVLCSharp.Uno.WinUI.Sample.csproj | 16 +++++++++++----- .../MainViewModel.cs | 2 ++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/samples/Uno/LibVLCSharp.Uno.WinUI.Sample/App.xaml.cs b/samples/Uno/LibVLCSharp.Uno.WinUI.Sample/App.xaml.cs index f5fba4dd..ff947a62 100644 --- a/samples/Uno/LibVLCSharp.Uno.WinUI.Sample/App.xaml.cs +++ b/samples/Uno/LibVLCSharp.Uno.WinUI.Sample/App.xaml.cs @@ -15,8 +15,10 @@ public partial class App : Application public App() { this.InitializeComponent(); +#if HAS_UNO Suspending += OnSuspending; Resuming += OnResuming; +#endif } protected Window? MainWindow { get; private set; } @@ -140,6 +142,7 @@ public static void InitializeLogging() /// /// The source of the suspend request. /// Details about the suspend request. +#if HAS_UNO private void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); @@ -151,4 +154,5 @@ private void OnResuming(object? sender, object e) { ViewModel?.Resume(); } +#endif } diff --git a/samples/Uno/LibVLCSharp.Uno.WinUI.Sample/LibVLCSharp.Uno.WinUI.Sample.csproj b/samples/Uno/LibVLCSharp.Uno.WinUI.Sample/LibVLCSharp.Uno.WinUI.Sample.csproj index 7d2b6e1a..5b1279b0 100644 --- a/samples/Uno/LibVLCSharp.Uno.WinUI.Sample/LibVLCSharp.Uno.WinUI.Sample.csproj +++ b/samples/Uno/LibVLCSharp.Uno.WinUI.Sample/LibVLCSharp.Uno.WinUI.Sample.csproj @@ -1,9 +1,9 @@  - - net9.0-android; - net9.0-ios; - + net9.0-android;net9.0-ios + $(TargetFrameworks);net9.0-windows10.0.19041.0 + + None Exe true @@ -28,6 +28,9 @@ enable false + 1.8.260710003 + 10.0.26100.7175 +