优化关注模块和登陆功能

This commit is contained in:
muqing 2024-12-06 09:29:28 +08:00
parent 3da0341de8
commit e3b741f07d
2 changed files with 4 additions and 12 deletions

View File

@ -40,7 +40,6 @@
Grid.Column="0" Grid.Column="0"
ItemTemplate="{StaticResource ConCernItem}" ItemTemplate="{StaticResource ConCernItem}"
ItemsSource="{x:Bind communitylist}" ItemsSource="{x:Bind communitylist}"
Loaded="ListViewA_Loaded"
ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"
SelectionChanged="ListViewA_SelectionChanged" SelectionChanged="ListViewA_SelectionChanged"

View File

@ -64,8 +64,10 @@ public sealed partial class ConcernPage : Page
communitylist.Add(item); communitylist.Add(item);
} }
if (ListViewA.Items.Count > 0)
ListViewA.SelectedIndex = 0; {
ListViewA.SelectedIndex = 0;
}
} }
catch (Exception e) catch (Exception e)
{ {
@ -124,13 +126,4 @@ public sealed partial class ConcernPage : Page
gj.sc(selectedItem); gj.sc(selectedItem);
dongtaixiaoxi(); dongtaixiaoxi();
} }
private void ListViewA_Loaded(object sender, RoutedEventArgs e)
{
// 检查是否有项目并设置默认选中项为第一个项
if (ListViewA.Items.Count > 0)
{
ListViewA.SelectedIndex = 0;
}
}
} }