我对 silverlight 完全陌生,我被赋予了修改它的任务。我的问题很简单(如果在 asp.net webforms 中完成)。基本上,在网格中,我想将年份附加到这样的东西上。
Jan + "-" + DateTime.Now.Year.ToString()
Feb + "-" + DateTime.Now.Year.ToString()
等等..等等..
xaml 看起来像这样
<Grid x:Name="ContentGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0">
<Grid.Resources>
<DataTemplate x:Key="mykey1">
<Grid >....</Grid>
</DataTemplate>
<DataTemplate x:Key="mykey2">
<Grid >....</Grid>
</DataTemplate>
<DataTemplate x:Key="mykey3">
<Grid >
<StackPanel Orientation="Vertical">
<Border BorderBrush="{StaticResource LogicaPebbleBlackBrush}" BorderThickness="1">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Style="{StaticResource HeaderStackPanel}">
<TextBlock Style="{StaticResource HeaderTextBlock}" Text="Jan-2013" Width="75" TextAlignment="Center"/>
<TextBlock Style="{StaticResource HeaderTextBlock}" Text="Feb-2013" Width="75" TextAlignment="Center"/>
</StackPanel>
</StackPanel>
</Grid>
</DataTemplate>
</ Grid>
</DataTemplate>
我只想让这一年充满活力,让它每年都在变化。请帮忙。