예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            var configurationDictionary = JsonConvert.DeserializeObject<Dictionary<string, object>>(File.ReadAllText("configuration.json"));

            var configurationReader = new ToastrConfigurationReader();
            var configuration = configurationReader.Get(configurationDictionary);

            var actionsExecutor = new ActionsExecutor(Dispatcher);
            _controller = new NotificationsController(
                (uint)SystemParameters.PrimaryScreenWidth,
                (uint)SystemParameters.PrimaryScreenHeight,
                actionsExecutor,
                configuration,
                (notification, config) =>
                {
                    var notificationWindow = new NotificationWindow(notification, config);
                    notificationWindow.Show();
                    return notificationWindow;
                });

            Closing += (sender, args) =>
            {
                actionsExecutor.Dispose();
            };
        }
 public ToastrConfigurationReaderTest()
 {
     _reader = new ToastrConfigurationReader();
 }