Skip to content

Commit

Permalink
响应标题栏后退按钮,下一步将去除各页面后退按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWFan authored and ThomasWFan committed Oct 18, 2016
1 parent e69d071 commit 2c193a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bilibili2/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
<Image Grid.Column="0" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/LOGOTITLE.png" Height="24"/>
</Grid>
<AutoSuggestBox Grid.Column="2" Grid.ColumnSpan="2" x:Name="top_txt_find" PlaceholderText="输入关键字或AV号" Visibility="Collapsed" Height="32" Width="180" QueryIcon="Find" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="0" Style="{StaticResource AutoSuggestBoxStyle1}" BorderThickness="1" BorderBrush="#00808080" TextChanged="top_txt_find_TextChanged" QuerySubmitted="top_txt_find_QuerySubmitted" SuggestionChosen="top_txt_find_SuggestionChosen"/>
<Button Grid.Column="0" x:Name="btn_back" Style="{ThemeResource TitleBarBackButtonTheme}" Width="48" Height="32" Background="{ThemeResource Bili-ForeColor}" Foreground="White"/>
<Button Grid.Column="0" x:Name="btn_back" Style="{ThemeResource TitleBarBackButtonTheme}" Width="48" Height="32" Background="{ThemeResource Bili-ForeColor}" Foreground="White" Click="btn_back_Click"/>
<Button Grid.Column="1" x:Name="btn_refresh" Style="{ThemeResource TitleBarRefreshButtonTheme}" Width="48" Height="32" Background="{ThemeResource Bili-ForeColor}" Foreground="White"/>
<Button Grid.Column="2" x:Name="btn_search" Style="{ThemeResource TitleBarSearchButtonTheme}" Width="48" Height="32" Background="{ThemeResource Bili-ForeColor}" Foreground="White" Click="btn_search_Click"/>
</Grid>
Expand Down
9 changes: 9 additions & 0 deletions bilibili2/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,15 @@ private void btn_search_Click(object sender, RoutedEventArgs e)
top_txt_find.Visibility = Visibility.Visible;
top_txt_find.Focus(FocusState.Programmatic);
}

private void btn_back_Click(object sender, RoutedEventArgs e)
{
if (infoFrame.Content != null)
if (infoFrame.CanGoBack)
infoFrame.GoBack();
else
MainPage_BackEvent();
}
}

public class FeedItemDataTemplateSelector : DataTemplateSelector
Expand Down

0 comments on commit 2c193a0

Please sign in to comment.