Advertisement
Guest User

Untitled

a guest
Jul 28th, 2022
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. public class ContextMenu
  2. {
  3.     private bool LockDeactivated;
  4.  
  5.     public async Task ShowDialogAsync(CornerRadius Corners)
  6.     {
  7.         Show();
  8.         while (!LockDeactivated){ await Task.Delay(100); }
  9.     }
  10.  
  11.  
  12.     private void StackPanel_MouseUp(object sender, MouseButtonEventArgs e)
  13.     {
  14.         LockDeactivated = true;
  15.         Close();
  16.     }
  17.  
  18.     private void Window_Deactivated(object sender, EventArgs e)
  19.     {
  20.         if (!LockDeactivated) { Close(); }
  21.     }
  22.  
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement