我想从每个类别中选择最后3条新闻,
我尝试在此SQL代码中进行限制,但它只给了我所有类别中的最后3条新闻
private HorizontalAlignment _CategoryHorizontalAlignment;
public HorizontalAlignment CategoryHorizontalAlignment
{
get { return _CategoryHorizontalAlignment; }
set
{
_CategoryHorizontalAlignment = value;
NotifyPropertyChanged("CategoryHorizontalAlignment");
}
}
CategoryHorizontalAlignment = HorizontalAlignment.Right;
<DataTemplate x:Key="GantButtonObservableClassTemplate" >
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Bottom">
<Label Content="{Binding Category}" Height="20"
Width="{Binding Duration}"
Margin="{Binding Margin, UpdateSourceTrigger=PropertyChanged}"
Background="{Binding CustomBackgroundColor}"
FontSize="{Binding GantChartFontSize, UpdateSourceTrigger=PropertyChanged}" Foreground="Black" FontWeight="DemiBold"
VerticalAlignment="Center" VerticalContentAlignment="Center" >
<Label.Style>
<Style TargetType="Label">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Label">
<Border x:Name="_brdMain"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
CornerRadius="7,7,7,7" Padding="{Binding CategoryPadding, UpdateSourceTrigger=PropertyChanged}">
<ContentPresenter HorizontalAlignment="{Binding CategoryHorizontalAlignment, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Label.Style>
</Label>
</StackPanel>
</DataTemplate>
任何解决方案吗?