WPF Binding Without INotifyPropertyChanged: Why the Source Stays in Memory
With a OneWay or TwoWay binding to a non-INotifyPropertyChanged source, .NET 10 collects the closed window but keeps the source as a PropertyDescriptor key.
Articles on WPF and XAML — data binding, controls, styling, virtualization, and UI behavior. Each one starts from a concrete problem met while building a Windows desktop application, explains why the behavior occurs, and works through the implementation and its trade-offs.
With a OneWay or TwoWay binding to a non-INotifyPropertyChanged source, .NET 10 collects the closed window but keeps the source as a PropertyDescriptor key.
Uncaught button-run AsyncRelayCommand errors hit DispatcherUnhandledException; FlowExceptionsToTaskScheduler held them, view model alive, until a rerun GC.
ObservableValidator shows no error on an empty required field at startup: HasErrors is False until validation runs. ValidateAllProperties fixes it two ways.
The Toolkit RelayCommand and Prism DelegateCommand keep a button disabled even after InvalidateRequerySuggested. Measurements show why, and what updates them.
Blocking on .Result on the WPF UI thread freezes the window when the code after an await must resume there. ConfigureAwait(false) and Task.Run can fail too.
A new Thread exception ends a WPF app despite Handled = true, and an unawaited Task's exception reaches nothing at first. The first layer to catch it decides.
Saving from a ToolBar or Menu while a WPF DataGrid cell is in edit mode stores the old value, and one CommitEdit() call during a cell edit leaves the row open.
Bindings to TreeViewItem.IsExpanded or ColumnDefinition.Width without Mode break after the expander button or a GridSplitter is used. Mode=TwoWay keeps them.
WPF list virtualization turns off silently through placement, the items panel, or scroll settings. Measured with 1,000 items, with diagnosis steps and fixes.
Limits such as MaxLength and DisplayDateStart do not stop values from code or bindings. Three paths are measured on .NET 10, and checks move to the view model.
Parts of a WPF app stay Light after a ThemeMode switch to Dark. Measured causes: a window-level or nested Fluent dictionary, StaticResource, or SystemColors.
Why controls carrying a custom Style keep the legacy look under the Fluent theme, how BasedOn fixes it, and which placements leave BasedOn unresolved.
The filter is correct right after assignment, yet an item property change leaves the list stale. Refresh and live filtering compared on .NET 10.
A ViewModel holds the right enum value, yet its radio button appears cleared. Omitting GroupName merges enum groups under one parent. Measured cause and fix.
The window is gone but the process stays in Task Manager. WPF shutdown has two gates, app shutdown and process exit, and the fix depends on which one stalled.
A dependency property gets its value, yet the internal {Binding Title} stays blank. RelativeSource, ElementName, and inner-root delegation compared on .NET 10.
Validation code runs but nothing appears. The causes are isolated on .NET 10: the ValidatesOnDataErrors default, a missing adorner layer, and update timing.
TreeView.SelectedItem cannot be assigned or data-bound: the selection lives on TreeViewItem. Style binding and ItemContainerGenerator are compared.
Bindings inside a DataTemplate resolve against the item, not the parent view model. Comparing RelativeSource, ElementName, x:Reference, and PlacementTarget.
A style trigger that never applies is usually outranked by a local value in XAML. Covers value precedence and the Setter, SetCurrentValue and ClearValue fixes.
An image file shown through BitmapImage cannot be deleted or overwritten. This covers the default caching behavior behind it and the OnLoad fix.
A custom RelayCommand's button stays stuck when CanExecuteChanged is never raised. This compares delegating to RequerySuggested with raising it manually.
Calling GetBindingExpression().UpdateSource() from the View has pitfalls: null returns, bulk updates, wrong direction, and MVVM, grounded in official docs.
TextBox.Text defaults to LostFocus, so typed input may never reach the ViewModel. This covers the three UpdateSourceTrigger values, their timing, and pitfalls.
Modifying a bound ObservableCollection off the UI thread throws a NotSupportedException from CollectionView affinity. This covers the cause and two fixes.
How to hide the clear button a Fluent-themed WPF TextBox shows on focus, without changing input behavior, on .NET 10 and .NET 9.
A ScrollViewer in a vertical StackPanel does not scroll because the StackPanel never constrains its height. Covers the cause and the Grid and DockPanel fixes.
A practical guide to formatting numbers, currency, and dates with Binding.StringFormat without a converter, including culture and ContentControl constraints.
When a WPF Binding fails silently, Visual Studio logs it as a trace. This article covers reading the message, raising the trace level, and common patterns.
Practical ways to reset WPF DataGrid sorting, including explicit clearing, Sorting-event control, CollectionView handling, and a reusable Behavior.
StaticResource resolves at XAML load time, so replacing the resource at runtime leaves existing references unchanged. DynamicResource follows such replacements.
Why many WPF Labels slow rendering, from measured visual trees: the gap against TextBlock, underscore costs, and whether it survives virtualization.
Why a WPF Label hides underscores: ContentPresenter.RecognizesAccessKey, which other controls are affected, and four measured workarounds with how to choose.
Use DataGridTemplateColumn with CellTemplate and CellEditingTemplate to separate display UI from editing UI in WPF DataGrid.
How TreePaste fixed a tray ContextMenu that stayed open until an item was clicked, by combining StaysOpen=false with SetForegroundWindow() before showing it.
Fluent styling in WPF with built-in features only: App.xaml theme setup, Fluent theme brushes that follow light and dark, and what SystemColors do not follow.
Learn how to use a read-only TextBox as a TextBlock replacement in WPF so text remains selectable and copyable without allowing edits.
The right mix of DisplayMemberPath, SelectedItem, SelectedValue and SelectedValuePath depends on the ItemsSource element type. Covers five binding patterns.
Why ListBox selection appears lost under UI virtualization, why an ItemContainerStyle binding alone fails, and how IsSelected with SelectionChanged fixes it.
Covers built-in column-header sorting in the WPF DataGrid, sorting from code-behind, and custom sort logic with ListCollectionView.CustomSort.
Fixing the WPF DatePicker format with a DatePickerTextBox style, escape separators in XAML, why setting Text in code-behind fails, and when a converter fits.