Skip to content

fix #13599 A warning dialog pops up when trying to switch the values for the FormScreenCaptureMode property #13662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2025

Conversation

Epica3055
Copy link
Member

@Epica3055 Epica3055 commented Jun 27, 2025

Fixes #13599

Root Cause

At design time TopLevel is false

    public ScreenCaptureMode FormScreenCaptureMode
    {
        get => Properties.GetValueOrDefault(s_propFormScreenCaptureMode, ScreenCaptureMode.Allow);
        set
        {
            if (FormScreenCaptureMode == value)
            {
                return;
            }

            if (!TopLevel)
            {
                throw new InvalidOperationException(SR.FormScreenCaptureModeRequiresTopLevel);
            }

            SourceGenerated.EnumValidator.Validate(value);
            Properties.AddOrRemoveValue(s_propFormScreenCaptureMode, value);

            if (IsHandleCreated)
            {
                SetScreenCaptureModeInternal(value);
            }
        }
    }

Proposed changes

  • Add another condition to check if the control is in design mode
Microsoft Reviewers: Open in CodeFlow

…alues for the FormScreenCaptureMode property Exclude DesignTime
@Epica3055 Epica3055 requested a review from a team as a code owner June 27, 2025 09:24
@github-actions github-actions bot added the area-controls-PropertyGrid PropertyGrid and editor related issues label Jun 27, 2025
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.69604%. Comparing base (08485db) to head (f30cfaa).
Report is 17 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13662         +/-   ##
===================================================
+ Coverage   76.60828%   76.69604%   +0.08776%     
===================================================
  Files           3253        3255          +2     
  Lines         640996      641599        +603     
  Branches       47439       47490         +51     
===================================================
+ Hits          491056      492081       +1025     
+ Misses        146290      145863        -427     
- Partials        3650        3655          +5     
Flag Coverage Δ
Debug 76.69604% <0.00000%> (+0.08776%) ⬆️
integration 18.99105% <0.00000%> (-0.00279%) ⬇️
production 51.21705% <0.00000%> (+0.14804%) ⬆️
test 97.41503% <ø> (+0.00328%) ⬆️
unit 48.59564% <0.00000%> (+0.14874%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LeafShi1 LeafShi1 added the priority-1 Work that is critical for the release, but we could probably ship without label Jul 2, 2025
@LeafShi1 LeafShi1 requested a review from KlausLoeffelmann July 2, 2025 00:47
Copy link
Member

@KlausLoeffelmann KlausLoeffelmann left a comment

Choose a reason for hiding this comment

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

Works for now for this as a quick workaround.
But we need to address the version issue for different .NET Server versions, anyway.

@Epica3055 Epica3055 merged commit f95971e into dotnet:main Jul 4, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-PropertyGrid PropertyGrid and editor related issues priority-1 Work that is critical for the release, but we could probably ship without
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A warning dialog pops up when trying to switch the values for the FormScreenCaptureMode property
3 participants