Labs-Windows icon indicating copy to clipboard operation
Labs-Windows copied to clipboard

Auto-format displayed XAML for sample source code

Open Arlodotexe opened this issue 2 years ago • 2 comments

Problem

Source code for each sample is bundled into the final app output. This step is done manually, with one exception: UWP in release mode.

Under release mode, UWP already emits the XAML source files, but these files are slightly different than the original, with extra whitespace and an added x:ConnectionId.

The whitespace is especially problematic, as it breaks formatting and makes the XAML hard to read.

See this example: (click to expand)

image

Solution

Rather than spending the time trying to custom emit these files to a different location, we can simply use a XAML formatter to fix the whitespace issue while unifying the formatting for all samples.

Arlodotexe avatar Mar 25 '22 20:03 Arlodotexe

We probably want to prune parts of the shown code or something too, or maybe have a 'partial vs. full' option for viewing too?

michael-hawker avatar Mar 25 '22 22:03 michael-hawker

Definitely need a way to only show the relevant part of the file. I think this should be filed as a separate issue.

Arlodotexe avatar Mar 25 '22 22:03 Arlodotexe