mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-13 17:22:48 -05:00
Better (but not yet done) toolbar button updating
This commit is contained in:
@@ -337,7 +337,7 @@ namespace FeedCenter
|
||||
|
||||
#region Feed display
|
||||
|
||||
private void InitializeFeed()
|
||||
private void UpdateToolbarButtonState()
|
||||
{
|
||||
// Cache the feed count to save (a little) time
|
||||
var feedCount = _database.Feeds.Count();
|
||||
@@ -350,7 +350,15 @@ namespace FeedCenter
|
||||
openAllToolbarButton.IsEnabled = (feedCount > 0);
|
||||
markReadToolbarButton.IsEnabled = (feedCount > 0);
|
||||
feedLabel.Visibility = (feedCount == 0 ? Visibility.Hidden : Visibility.Visible);
|
||||
feedButton.Visibility = (feedCount > 1 ? Visibility.Hidden : Visibility.Visible);
|
||||
feedButton.Visibility = (feedCount > 1 ? Visibility.Hidden : Visibility.Visible);
|
||||
}
|
||||
|
||||
private void InitializeFeed()
|
||||
{
|
||||
UpdateToolbarButtonState();
|
||||
|
||||
// Cache the feed count to save (a little) time
|
||||
var feedCount = _database.Feeds.Count();
|
||||
|
||||
// Clear the link list
|
||||
linkTextList.Items.Clear();
|
||||
@@ -826,11 +834,13 @@ namespace FeedCenter
|
||||
private void ResetDatabase()
|
||||
{
|
||||
// Get the ID of the current feed
|
||||
var currentId = _currentFeed.ID;
|
||||
var currentId = _currentFeed == null ? Guid.Empty : _currentFeed.ID;
|
||||
|
||||
// Create a new database object
|
||||
_database = new FeedCenterEntities();
|
||||
|
||||
UpdateToolbarButtonState();
|
||||
|
||||
// Get a list of feeds ordered by name
|
||||
var feedList = _database.Feeds.OrderBy(f => f.Name).ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user