WPF Listview 排序加分页
2021-02-15 13:22
标签:center width for 初始 panel sts resource temp less 分页 添加在listview 下面 WPF Listview 排序加分页 标签:center width for 初始 panel sts resource temp less 原文地址:https://www.cnblogs.com/candyzhmm/p/12713831.htmlRadioButton radio = sender as RadioButton;
courseHoursList.Items.SortDescriptions.Clear();
if (radio.Name == "sort_asc")
{
courseHoursList.Items.SortDescriptions.Add(new SortDescription("create_time", ListSortDirection.Ascending));
}
else
{
courseHoursList.Items.SortDescriptions.Add(new SortDescription("create_time", ListSortDirection.Descending));
}
#region 分页
private void but_Pages_Click(object sender, RoutedEventArgs e)
{
Fun_Pager(((sender as Button).DataContext as Page).PageSize);
}
private int _number;
public int Number
{
get { return _number; }
set
{
_number = value;
OnPropertyChanged("Number");
}
}
private int _currentSize;
public int CurrentSize
{
get { return _currentSize; }
set
{
_currentSize = value;
OnPropertyChanged("CurrentSize");
}
}
private int _total;
public int Total
{
get { return _total; }
set
{
_total = value;
OnPropertyChanged("Total");
}
}
private List
StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
StackPanel Orientation="Horizontal">
Button Content="首页" Style="{DynamicResource PageNumButton}" Click="btnHome_Click" Margin="0,0,10,0" Foreground="#393838" Background="White" FontSize="12" Width="40" Height="22" Cursor="Hand"/>
Button Content="上一页" Style="{DynamicResource PageNumButton}" Click="btnLast_Click" Margin="0,0,10,0" Foreground="#393838" Background="White" FontSize="12" Width="40" Height="22" Cursor="Hand"/>
Button Content="下一页" Style="{DynamicResource PageNumButton}" Click="btnNext_Click" Margin="0,0,10,0" Foreground="#393838" Background="White" FontSize="12" Width="40" Height="22" Cursor="Hand"/>
Button Content="尾页" Style="{DynamicResource PageNumButton}" Click="btnEnd_Click" Foreground="#393838" Background="White" FontSize="12" Width="40" Height="22" Cursor="Hand"/>
StackPanel>
TextBlock VerticalAlignment="Center" Margin="20,0,0,0" FontSize="10">
TextBlock Text="【共"/>
TextBlock Text="{Binding Total}" Foreground="#329FEE"/>
TextBlock Text="页】"/>
TextBlock Text="【当前第"/>
TextBlock Text="{Binding CurrentSize}" Foreground="#329FEE" />
TextBlock Text="页】"/>
TextBlock>
StackPanel>
文章标题:WPF Listview 排序加分页
文章链接:http://soscw.com/index.php/essay/55675.html