rafallopatka / ToastNotifications

Toast notifications for WPF allows you to create and display rich notifications in WPF applications. It's highly configurable with set of built-in options like positions, behaviours, themes and many others. It's extendable, it gives you possibility to create custom and interactive notifications in simply manner.
GNU Lesser General Public License v3.0
718 stars 171 forks source link

'Application' does not contain a definition for 'Current' #129

Open TwangyMoney opened 1 year ago

TwangyMoney commented 1 year ago

Library version

ToastNotifications 2.5.1 | ToastNotifications.Messages 2.5.1

Expected behavior

No errors and smooth work.

Actual behavior

Errors and no smooth work, some variables are missing.

Steps to reproduce behavior

Install ToastNotifications 2.5.1 and ToastNotifications.Messages 2.5.1 then (maybe wrongly) remove them and try to reinstall them

Code to reproduce behavior

using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using Csharp_HUD;
using DiscordRpcDemo;
using System.Windows.Controls;
using System.Configuration;
using ToastNotifications;
using ToastNotifications.Lifetime;
using ToastNotifications.Position;

namespace TwangSploit
{
    public partial class TwangSploit : Form
    {
        private DiscordRpc.EventHandlers handlers;
        private DiscordRpc.RichPresence presence;
        private const string V = "TwangSploit - Open Script";
        private const string N = "TwangSploit - Save Script";
        private const string I = "";
        private const string I2 = "";
        private const string I3 = "";

        Notifier notifier = new Notifier(cfg =>
        {
            cfg.PositionProvider = new WindowPositionProvider(
                parentWindow: Application.Current.MainWindow,
                corner: Corner.TopRight,
                offsetX: 10,
                offsetY: 10);

            cfg.LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor(
                notificationLifetime: TimeSpan.FromSeconds(3),
                maximumNotificationCount: MaximumNotificationCount.FromCount(5));

            cfg.Dispatcher = Application.Current.Dispatcher;
        });
        public TwangSploit()

        {
            InitializeComponent();
        }

Questions

How could this be fixed? The only problem that's showing is the statement "Current" in the code. Screenshot is provided. I needed to get this to a stable state so I can build my application again. Needed swift answers.

image image