Skip to content

Commit

Permalink
动态页TopBar宽度随视图模式变化
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmoyue committed Apr 20, 2024
1 parent d22b36a commit c2ed8b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@
</Storyboard>
</ResourceDictionary>
</Page.Resources>
<Grid >
<Grid>
<!--背景图-->
<Image Visibility="Collapsed" Stretch="UniformToFill" Source="https://i0.hdslb.com/bfs/album/[email protected]"></Image>
<Grid >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid x:Name="gridTopBar" MaxWidth="800" Margin="8 0">
<Border x:Name="borderTopBar" Margin="12 4" CornerRadius="4" Background="{ThemeResource CardColor}">
<Grid x:Name="GridTopBar" MaxWidth="800" Margin="8 0">
<Border x:Name="BorderTopBar" Margin="12 4" CornerRadius="4" Background="{ThemeResource CardColor}">
<Pivot x:Name="DynPivot" SelectionChanged="Pivot_OnSelectionChanged">
<Pivot.RightHeader>
<StackPanel Orientation="Horizontal">
Expand Down
12 changes: 12 additions & 0 deletions src/BiliLite.UWP/Pages/Home/UserDynamicAllPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ private void SetGridCore()
BtnList.Visibility = Visibility.Visible;
//XAML
ListDyn.ItemsPanel = (ItemsPanelTemplate)this.Resources["GridPanel"];

//顶部
GridTopBar.MaxWidth = double.MaxValue;
GridTopBar.Margin = new Thickness(0, 0, 0, 4);
BorderTopBar.CornerRadius = new CornerRadius(0);
BorderTopBar.Margin = new Thickness(0);
}

private void SetListCore()
Expand All @@ -83,6 +89,12 @@ private void SetListCore()
BtnList.Visibility = Visibility.Collapsed;
//XAML
ListDyn.ItemsPanel = (ItemsPanelTemplate)this.Resources["ListPanel"];

//顶部
GridTopBar.MaxWidth = 800;
GridTopBar.Margin = new Thickness(8, 0, 8, 0);
BorderTopBar.CornerRadius = new CornerRadius(4);
BorderTopBar.Margin = new Thickness(12, 4, 12, 4);
}

private async void BtnRefreshDynamic_OnClick(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit c2ed8b7

Please sign in to comment.