Skip to content

Commit c062ed7

Browse files
committed
refactored windows code
1 parent 1e9c883 commit c062ed7

File tree

6 files changed

+324
-268
lines changed

6 files changed

+324
-268
lines changed

BarcodeScanning.Native.Maui/BarcodeScanning.Native.Maui.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1111
<IsAotCompatible>true</IsAotCompatible>
1212
<Nullable>enable</Nullable>
13-
<Version>3.0.0-beta</Version>
13+
<Version>3.0.0-beta2</Version>
1414
<Authors>Alen Friščić</Authors>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<PackageReadmeFile>README.md</PackageReadmeFile>
@@ -22,7 +22,7 @@
2222
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
2323
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
2424
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.1</SupportedOSPlatformVersion>
25-
<!--SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion-->
25+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
2626
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
2727
</PropertyGroup>
2828

BarcodeScanning.Native.Maui/CameraViewHandler.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,19 @@ public CameraViewHandler() : base(CameraViewMapper, CameraCommandMapper)
2828
{
2929
}
3030

31+
#if WINDOWS
32+
protected override async void DisconnectHandler(BarcodeView barcodeView)
33+
{
34+
if (_cameraManager is not null)
35+
await _cameraManager.DisposeAsync();
36+
37+
base.DisconnectHandler(barcodeView);
38+
}
39+
#else
3140
protected override void DisconnectHandler(BarcodeView barcodeView)
3241
{
3342
_cameraManager?.Dispose();
3443
base.DisconnectHandler(barcodeView);
3544
}
45+
#endif
3646
}

0 commit comments

Comments
 (0)