Toast notifications do not work when user is in a different window

Viewed 20

I am using making a cheat for minecraft, and I am using toast notifications to let the user know when it is toggled on or off. However, these notifications work in every app I've tried so far except minecraft. ToggleBtn_MouseDown is still called, but there is no notification. ToggleBtn_MouseDown is also called by a keyboard hook, if that is of relevance. Any ideas on why this is occuring?

 private async void ToggleBtn_MouseDown(object? sender, MouseButtonEventArgs? e)
        {
            await Task.Delay(20);
            if (ToggleBtn.Content.ToString() == "Enable")
            {
                ToggleBtn.Content = "Disable";
                clicker.Start();
            }
            else
            {
                ToggleBtn.Content = "Enable";
                clicker.Stop();
            }
            new ToastContentBuilder()
                .AddText($"1337 is {ToggleBtn.Content}d")
                .AddText("Disable these notifications in settings")
                .Show();
            await Task.Delay(1000);
            ToastNotificationManagerCompat.History.Clear();
        }
0 Answers
Related