Hi all,
I have created the access token in the windows c# application. Like the below code,
C#
result = await app.AcquireTokenInteractive(scopes)
.WithAccount(firstAccount)
.WithParentActivityOrWindow(new WindowInteropHelper(this).Handle)
.WithPrompt(Prompt.SelectAccount)
.ExecuteAsync();In this, the WindowInteropHelper got error because it contains the "System.Windows.window" as parameter. Is there any option to set this WindowInteropHelper in the "System.Windows.Forms.Form" page?
Thanks.


Tamil RkRank #4,239 · 356 reputationPosted Jul 20, 2021, 9:25 AM EDT
Hello RAJA PRIYA,
For windows form we can use like below:
.WithParentActivityOrWindow(Handle)
Windows wpf :
.WithParentActivityOrWindow(new WindowInteropHelper(this).Handle)
Shweta LodhaRank #31 · 39.8K reputationPosted Jul 19, 2021, 7:14 PM EDT