mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-13 17:22:48 -05:00
More modernization
- Split generic "common" libraries into specific libraries - Use other packages in lieu of custom code - General cleanup
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
using FeedCenter.Properties;
|
||||
using DebounceThrottle;
|
||||
using FeedCenter.Properties;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using Common.Helpers;
|
||||
|
||||
namespace FeedCenter
|
||||
{
|
||||
@@ -90,25 +90,22 @@ namespace FeedCenter
|
||||
SaveWindowSettings();
|
||||
|
||||
// Save settings
|
||||
_database.SaveChanges(() => Settings.Default.Save());
|
||||
_database.SaveChanges(Settings.Default.Save);
|
||||
|
||||
// Get rid of the notification icon
|
||||
NotificationIcon.Dispose();
|
||||
}
|
||||
|
||||
private DelayedMethod _windowStateDelay;
|
||||
private readonly DebounceDispatcher _updateWindowSettingsDispatcher = new(500);
|
||||
|
||||
private void HandleWindowSizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
_windowStateDelay ??= new DelayedMethod(500, UpdateWindowSettings);
|
||||
|
||||
_windowStateDelay.Reset();
|
||||
_updateWindowSettingsDispatcher.Debounce(() => Dispatcher.Invoke(UpdateWindowSettings));
|
||||
}
|
||||
|
||||
private void HandleWindowLocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
_windowStateDelay ??= new DelayedMethod(500, UpdateWindowSettings);
|
||||
|
||||
_windowStateDelay.Reset();
|
||||
_updateWindowSettingsDispatcher.Debounce(() => Dispatcher.Invoke(UpdateWindowSettings));
|
||||
}
|
||||
|
||||
private void UpdateBorder()
|
||||
@@ -152,6 +149,7 @@ namespace FeedCenter
|
||||
}
|
||||
|
||||
private bool _activated;
|
||||
|
||||
protected override void OnActivated(EventArgs e)
|
||||
{
|
||||
base.OnActivated(e);
|
||||
@@ -172,4 +170,4 @@ namespace FeedCenter
|
||||
Settings.Default.PropertyChanged += HandlePropertyChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user