Whitespace preservation in XAML
Fil asked about Collapsed Spaces Around <Run />
Using XamlPad, I was not able to reproduce this problem…all 6 hello worlds have spaces in them.
What is your repro?
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:System="clr-namespace:System;assembly=mscorlib"> <StackPanel> <TextBlock>Hello World</TextBlock> <TextBlock><Run>Hello</Run> <Run>World</Run></TextBlock> <TextBlock><Bold>Hello</Bold> <Italic>World</Italic></TextBlock> <FlowDocumentPageViewer> <FlowDocument> <Paragraph>Hello World</Paragraph> <Paragraph><Run>Hello</Run> <Run>World</Run></Paragraph> <Paragraph><Bold>Hello</Bold> <Italic>World</Italic></Paragraph> </FlowDocument> </FlowDocumentPageViewer> </StackPanel> </Page>
The SDK documents Whitespace Processing in XAML
Update: Corrado Cavalli, an MVP from Italy that I met last week, sent me mail pointing out a sample that reproed for him. Since it didn’t repro for me in XamlPad, but he sent a picture, I decided to check to see if compiled xaml had the problem. It turns out that xaml and baml are consistent however I believe that this only repros in "Cider" in the March CTP. I’ll work with the Cider team. Thanks!