I am looking for a nice code solution for the following problem.
I have a List which I want to bind to a couple of labels. The MyObject class only contains a few fields (strings and ints). This list contains of 3 elements. In my view I would like to have the following layout
- Element 1
- Element 2
- Element 3
Where “Element 1”, “Element 2” and “Element 3” is a property of the MyObject class.
Note that the view is already defined in Blend as follows (I prefer not to change the view-code, but if I have no choice … 😉 ):
<Label Content="1." RenderTransformOrigin="0,0.404" Foreground="Black" FontSize="16" VerticalContentAlignment="Bottom" HorizontalContentAlignment="Right" FontFamily="Segoe UI Semibold"/>
<Label Content="2." RenderTransformOrigin="0,0.404" Foreground="Black" FontSize="16" VerticalContentAlignment="Bottom" HorizontalContentAlignment="Right" Grid.Row="1" FontFamily="Segoe UI Semibold"/>
<Label Content="3." Margin="0,0,0,1.077" RenderTransformOrigin="0,0.404" Foreground="Black" FontSize="16" VerticalContentAlignment="Bottom" HorizontalContentAlignment="Right" Grid.Row="2" FontFamily="Segoe UI Semibold"/>
<Label Content="Login bug startup (6 days)" Foreground="Black" FontSize="14.667" VerticalContentAlignment="Bottom" Grid.Column="1"/>
<Label Content="Setup screen exception (4 days)" Foreground="Black" FontSize="14.667" VerticalContentAlignment="Bottom" Grid.Column="1" Grid.Row="1"/>
<Label Content="No users available bug (1 day)" Foreground="Black" FontSize="14.667" VerticalContentAlignment="Bottom" Grid.Column="1" Grid.Row="2"/>
What is the best way to do this ? I am sure I can do this with some loose code, but I prefer a neat solution.
Thank you very much !!
Number and Element are properties of your MyObject.