InvalidOperationException: 序列不包含任何元素 StackTrace: 在 System.Linq.Enumerable.First[TSource](IEnumerable`1 source) 在 DynamicClass.<>c__DisplayClass28.<OnWindowCreated>b__3() 在 DynamicClass.<>c__DisplayClass28.<OnWindowCreated>b__a() 在 DynamicClass.<>c__DisplayClass28.<OnWindowCreated>b__c() 在 DynamicClass.<>c__DisplayClass28.<OnWindowCreated>b__15(Object s, TextChangedEventArgs e) 在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) 在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) 在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) 在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) 在 System.Windows.Controls.Primitives.TextBoxBase.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e) 在 System.Windows.Controls.TextBox.OnTextContainerChanged(Object sender, TextContainerChangedEventArgs e) 在 System.Windows.Documents.TextContainerChangedEventHandler.Invoke(Object sender, TextContainerChangedEventArgs e) 在 System.Windows.Documents.TextContainer.EndChange(Boolean skipEvents) 在 System.Windows.Documents.TextRangeBase.EndChange(ITextRange thisRange, Boolean disableScroll, Boolean skipEvents) 在 System.Windows.Documents.TextRange.ChangeBlock.System.IDisposable.Dispose() 在 System.Windows.Controls.TextBox.OnTextPropertyChanged(String oldText, String newText) 在 System.Windows.Controls.TextBox.OnTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 在 System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 在 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 在 System.Windows.Controls.TextBox.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 在 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) 在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) 在 System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) 在 System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange) 在 System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange) 在 System.Windows.Data.BindingExpression.Activate(Object item) 在 System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt) 在 System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance) 在 MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance) 在 MS.Internal.Data.DataBindEngine.Run(Object arg) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)