Skip to content

Commit d25988e

Browse files
committed
fixed logout flyout
1 parent 2d6408b commit d25988e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Microsoft.Toolkit.Graph.Controls/Controls/LoginButton/LoginButton.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System;
66
using System.ComponentModel;
77
using System.Threading.Tasks;
8-
using Microsoft.Graph.Auth;
98
using Microsoft.Toolkit.Graph.Providers;
109
using Windows.UI.Xaml;
1110
using Windows.UI.Xaml.Controls;
@@ -181,6 +180,12 @@ public async Task LoginAsync()
181180
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
182181
public async Task LogoutAsync()
183182
{
183+
// Close Menu
184+
if (FlyoutBase.GetAttachedFlyout(_loginButton) is FlyoutBase flyout)
185+
{
186+
flyout.Hide();
187+
}
188+
184189
var cargs = new CancelEventArgs();
185190
LogoutInitiated?.Invoke(this, cargs);
186191

@@ -206,12 +211,6 @@ public async Task LogoutAsync()
206211

207212
LogoutCompleted?.Invoke(this, new EventArgs());
208213
}
209-
210-
// Close Menu
211-
if (FlyoutBase.GetAttachedFlyout(_loginButton) is FlyoutBase flyout)
212-
{
213-
flyout.Hide();
214-
}
215214
}
216215
}
217216
}

0 commit comments

Comments
 (0)