dotnet / dotnet/wpf

Feature request: XamlObjectWriter to support IXamlLineInfoConsumer objects

Open
#4,179 0 comments 1 reaction 0 assignees View on GitHub
Feature Request
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

I am loading a XAML file using `System.Windows.Markup.XamlReader.Load` and I would like to keep track of where objects come from for error reporting purposes to the user.

One option is that [`XamlObjectWriter.Logic_BeginInit`](https://github.com/dotnet/wpf/blob/798072ce24336e6f6d9c928793dd623f92c92f22/src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/InfosetObjects/XamlObjectWriter.cs#L1464) would check whether the instance implements `IXamlLineInfoConsumer` and if so, set line info on the object instance.

Alternatively, to avoid performance impact, provide a `System.Windows.Markup.XamlReader.Load` overload that takes `IXamlObjectWriterFactory` argument. User can then provide an implementation of the writer that does the above.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.