Remove feed reading async code

Update to new binding expression code on options dialog
Update to .NET framework 4.5.1
This commit is contained in:
2014-07-11 20:40:47 -04:00
parent 6cdc334d53
commit 7e3eedd844
8 changed files with 63 additions and 83 deletions

View File

@@ -1,12 +1,10 @@
using System.Collections.Generic;
using Common.Wpf.Extensions;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using Common.Wpf.Extensions;
namespace FeedCenter.Options
{
public partial class FeedWindow
@@ -36,11 +34,8 @@ namespace FeedCenter.Options
private void HandleOkayButtonClick(object sender, RoutedEventArgs e)
{
// Get a dictionary of all framework elements and explicit binding expressions
Dictionary<FrameworkElement, BindingExpression> bindingExpressionDictionary = this.GetExplicitBindingExpressions();
// Get just the binding expressions
var bindingExpressions = bindingExpressionDictionary.Values;
// Get a list of all framework elements and explicit binding expressions
var bindingExpressions = this.GetBindingExpressions(new[] { UpdateSourceTrigger.Explicit });
// Loop over each binding expression and clear any existing error
this.ClearAllValidationErrors(bindingExpressions);
@@ -49,19 +44,19 @@ namespace FeedCenter.Options
this.UpdateAllSources(bindingExpressions);
// See if there are any errors
bool hasError = bindingExpressions.Any(b => b.HasError);
var hasError = bindingExpressions.Any(b => b.BindingExpression.HasError);
// If there was an error then set focus to the bad controls
if (hasError)
{
// Get the first framework element with an error
FrameworkElement firstErrorElement = bindingExpressionDictionary.First(pair => pair.Value.HasError).Key;
var firstErrorElement = bindingExpressions.First(b => b.BindingExpression.HasError).FrameworkElement;
// Loop over each tab item
foreach (TabItem tabItem in optionsTabControl.Items)
{
// Cast the content as visual
Visual content = (Visual) tabItem.Content;
var content = (Visual) tabItem.Content;
// See if the control with the error is a descendant
if (firstErrorElement.IsDescendantOf(content))