Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/app/ShadersCamera.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<PropertyGroup>

<!--<TargetFrameworks>net9.0-ios;</TargetFrameworks>-->
<TargetFrameworks>net9.0-android;</TargetFrameworks>
<!--<TargetFrameworks>net9.0-android;</TargetFrameworks>-->

<!--<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>-->
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TargetFrameworks now always includes net9.0-ios and net9.0-maccatalyst. On non-macOS environments (e.g., Windows dev machines), a plain dotnet build src/app/ShadersCamera.csproj will attempt to build all TFMs and typically fail for iOS/MacCatalyst. Consider conditioning iOS/MacCatalyst TFMs on IsOSPlatform('osx') (similar to how Windows is conditional) or otherwise ensuring the default build path on Windows/Linux doesn’t include Apple TFMs unless explicitly requested.

Suggested change
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks>net9.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">$(TargetFrameworks);net9.0-ios;net9.0-maccatalyst</TargetFrameworks>

Copilot uses AI. Check for mistakes.
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>

<OutputType>Exe</OutputType>
<RootNamespace>ShadersCamera</RootNamespace>
Expand Down Expand Up @@ -101,8 +101,8 @@
</ItemGroup>-->

<ItemGroup>
<!--<PackageReference Include="DrawnUi.Maui.Camera" Version="1.9.1.1" />-->
<PackageReference Include="AppoMobi.Maui.FastPopups" Version="1.2.1" />
<PackageReference Include="DrawnUi.Maui.Camera" Version="1.9.4.1" />
<PackageReference Include="AppoMobi.Maui.FastPopups" Version="1.10.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.70" />
</ItemGroup>
Expand Down Expand Up @@ -156,12 +156,6 @@
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\..\DrawnUi.Maui\src\Maui\Addons\DrawnUi.Maui.Camera\DrawnUi.Maui.Camera.csproj" />
</ItemGroup>



<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
Expand Down
8 changes: 4 additions & 4 deletions src/app/ViewModels/CameraViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public TimeSpan RecordingDuration
if (TouchEffect.CheckLockAndSet())
return;

if (Camera?.State == CameraState.On && !Camera.IsBusy)
if (Camera?.State == HardwareState.On && !Camera.IsBusy)
{
_ = Camera.TakePicture().ConfigureAwait(false);
}
Expand All @@ -267,7 +267,7 @@ public TimeSpan RecordingDuration
if (TouchEffect.CheckLockAndSet())
return;

if (Camera?.State != CameraState.On || Camera.IsBusy)
if (Camera?.State != HardwareState.On || Camera.IsBusy)
return;

if (Mode == CaptureUIMode.Photo)
Expand Down Expand Up @@ -355,9 +355,9 @@ private void OnNewPreviewSet(object sender, LoadedImageSource source)
// was used in detection mode
}

private void OnCameraStateChanged(object sender, CameraState state)
private void OnCameraStateChanged(object sender, HardwareState state)
{
if (state == CameraState.On)
if (state == HardwareState.On)
{
if (Camera?.Display != null)
{
Expand Down
8 changes: 4 additions & 4 deletions src/app/Views/MainPageCameraFluent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@
/// </summary>
private bool StartupSuccessChecked;

private void OnCameraStateChanged(object sender, CameraState state)
private void OnCameraStateChanged(object sender, HardwareState state)
{
if (state == CameraState.On)
if (state == HardwareState.On)
{
Debug.WriteLine($"[CameraApp] State in ON!");

Expand Down Expand Up @@ -238,7 +238,7 @@

private void TappedTurnCamera()
{
if (CameraControl.State == CameraState.On)
if (CameraControl.State == HardwareState.On)
{
CameraControl.IsOn = false;
}
Expand All @@ -251,7 +251,7 @@

private async void TappedTakePicture(object sender, SkiaGesturesParameters skiaGesturesParameters)
{
if (CameraControl.State == CameraState.On && !CameraControl.IsBusy)
if (CameraControl.State == HardwareState.On && !CameraControl.IsBusy)
{
CameraControl.FlashScreen(Color.Parse("#EEFFFFFF"));
await CameraControl.TakePicture().ConfigureAwait(false);
Expand Down Expand Up @@ -358,7 +358,7 @@

if (!formats.Any())
{
await App.Current.MainPage.DisplayAlert("Error", "No capture formats available", "OK");

Check warning on line 361 in src/app/Views/MainPageCameraFluent.cs

View workflow job for this annotation

GitHub Actions / build

'Application.MainPage.get' is obsolete: 'This property has been deprecated. For single-window applications, use Windows[0].Page. For multi-window applications, identify and use the appropriate Window object to access the desired Page. Additionally, each element features a Window property, accessible when it's part of the current window.'
return;
}

Expand All @@ -367,7 +367,7 @@
$"{format.Width}x{format.Height}, {format.AspectRatioString}"
).ToArray();

var result = await App.Current.MainPage.DisplayActionSheet(

Check warning on line 370 in src/app/Views/MainPageCameraFluent.cs

View workflow job for this annotation

GitHub Actions / build

'Application.MainPage.get' is obsolete: 'This property has been deprecated. For single-window applications, use Windows[0].Page. For multi-window applications, identify and use the appropriate Window object to access the desired Page. Additionally, each element features a Window property, accessible when it's part of the current window.'
"Capture Photo Quality",
ResStrings.BtnCancel,
null,
Expand All @@ -393,7 +393,7 @@
}
catch (Exception ex)
{
await App.Current.MainPage.DisplayAlert("Error", $"Failed to get capture formats: {ex.Message}",

Check warning on line 396 in src/app/Views/MainPageCameraFluent.cs

View workflow job for this annotation

GitHub Actions / build

'Application.MainPage.get' is obsolete: 'This property has been deprecated. For single-window applications, use Windows[0].Page. For multi-window applications, identify and use the appropriate Window object to access the desired Page. Additionally, each element features a Window property, accessible when it's part of the current window.'
"OK");
Debug.WriteLine($"[CameraApp] Format selection error: {ex}");
}
Expand Down
Loading