Fix ThreadContext CurrentForm to reflect ApplicationContext MainForm changes#14724
Open
abineshPalanisamy wants to merge 4 commits into
Open
Fix ThreadContext CurrentForm to reflect ApplicationContext MainForm changes#14724abineshPalanisamy wants to merge 4 commits into
abineshPalanisamy wants to merge 4 commits into
Conversation
Added fix for the Fix_Issue_3260
Addressed the review correction and updated the test cases
Updated the changes for Fix_Issue_3260
Added the unit test cases for Fix_Issue_3260
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3260
Proposed changes
Application.ThreadContext.CurrentFormto resolve fromApplicationContext.MainFormwhen no temporary form override is active.CurrentFormreflects changes toApplicationContext.MainFormwithout requiring explicit synchronization fromApplicationContext.CurrentForm.CurrentFormupdates whenApplicationContext.MainFormchanges.Root cause
ApplicationContext.MainFormis allowed to change at runtime.Application.ThreadContextmaintained a cachedCurrentFormreference.CurrentFormcould become stale afterApplicationContext.MainFormwas reassigned.Customer Impact
ThreadContext.CurrentFormreflects the latestApplicationContext.MainForm.MainFormis changed.Regression?
Risk
Application.ThreadContext.ApplicationContext.MainFormcontinues to behave as documented.Screenshots
Test methodology
ApplicationContext.MainFormafter the message loop was initialized.ApplicationContext.MainFormchanged to the new form,ThreadContext.CurrentFormcontinued to reference the old form.ThreadContext.CurrentFormreflects the updatedApplicationContext.MainForm.ApplicationContext.MainFormtonullis reflected byCurrentForm.MainFormchanges are reflected correctly.ThreadContext_CurrentForm_ReflectsChangedMainFormThreadContext_CurrentForm_ReflectsNullMainFormThreadContext_CurrentForm_ReflectsMultipleMainFormChangesThreadContext_CurrentForm_OverrideTakesPriorityOverMainFormAccessibility testing
Test environment(s)
Microsoft Reviewers: Open in CodeFlow