Controls with Custom Styles Fall Back to the Old Look Under the WPF Fluent Theme
Why controls carrying a custom Style keep the legacy look under the Fluent theme, how BasedOn fixes it, and which placements leave BasedOn unresolved.
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.
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 separate enum groups into one. 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 inside a StackPanel does not scroll because the StackPanel never constrains its height. This 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 its value at XAML load time, so runtime changes have no effect. Use DynamicResource when the value must update at runtime.
Why rendering slows down when many WPF Labels are used, explained through measured visual tree data. Covers the gap against TextBlock, the extra cost imposed...
When a string containing an underscore (_) is set on a WPF Label, the character disappears from the screen. This article explains the underlying ContentPrese...
Use DataGridTemplateColumn with CellTemplate and CellEditingTemplate to separate display UI from editing UI in WPF DataGrid.
This article explains how TreePaste resolved a tray ContextMenu that stayed visible until an item was clicked by combining StaysOpen=false with SetForeground...
This article explains how to apply Fluent styling in WPF using only built-in features, with App.xaml theme setup and SystemColors-based color tracking.
Learn how to use a read-only TextBox as a TextBlock replacement in WPF so text remains selectable and copyable without allowing edits.
The correct combination of DisplayMemberPath, SelectedItem, SelectedValue, and SelectedValuePath depends on the element type bound to ItemsSource. This artic...
Why ListBox selection appears to vanish under UI virtualization, and how an IsSelected-based MVVM pattern keeps it stable. Includes measured evidence that th...
Learn the basics of DataGrid sorting and practical implementation patterns for real-world WPF applications.
A practical guide to changing the date display format of WPF DatePicker from XAML, code-behind, and a value converter.