I am trying to make a simple grid layout where the text (first name and last name) gets centered. https://dl.dropboxusercontent.com/s/zydf2ge5m8qww8b/shot_160408_125232.jpg
I am using the WrapPanel with Alignment=“Center” and in my full app (not the demo file attached) I am only receiving the texts as separate properties and don’t know how to merge them. That is why I’m using 3 different text elements here.
The WrapPanel works nicely when the text is short but when the text is longer and wrapping comes into play, the layout breaks.
<App>
<JavaScript>
var data = [
{firstName: 'Leo', lastName: 'Huub'},
{firstName: 'James', lastName: 'Holloway'},
{firstName: 'Camille Jessica', lastName: 'Frazier'},
{firstName: 'Manuela Pancho Consuela', lastName: 'Velacruz'}
];
module.exports = {
data: data
};
</JavaScript>
<StackPanel>
<Grid Columns="1,1,1*" Padding="10">
<Each Items="{data}">
<StackPanel Background="#ddd" Margin="5" Padding="5" Height="100" >
<WrapPanel Padding="5" Background="#8EBD8A" Alignment="Center" >
<Text Value="{firstName}" TextWrapping="Wrap" FontSize="13" Background="#D19D9D" />
<Text Value=" " FontSize="13"/>
<Text Value="{lastName}" TextWrapping="Wrap" FontSize="13" Background="#D15959" />
</WrapPanel>
</StackPanel>
</Each>
</Grid>
</StackPanel>
</App>