-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAboutPage.xaml.cpp
More file actions
38 lines (32 loc) · 1.27 KB
/
AboutPage.xaml.cpp
File metadata and controls
38 lines (32 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "pch.h"
#include "AboutPage.xaml.h"
#if __has_include("AboutPage.g.cpp")
#include "AboutPage.g.cpp"
#endif
using namespace winrt;
using namespace Microsoft::UI::Xaml;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace winrt::SSnake::implementation
{
void AboutPage::ScrollToEndButton_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&)
{
AboutPage_ScrollView().ScrollTo(0.0, AboutPage_ScrollView().ScrollableHeight());
}
void AboutPage::AboutPage_ScrollView_ViewChanged(winrt::Microsoft::UI::Xaml::Controls::ScrollView const&, winrt::Windows::Foundation::IInspectable const&)
{
if (AboutPage_ScrollView().VerticalScrollBarVisibility() == Controls::ScrollingScrollBarVisibility::Hidden)
{
AboutPage_ScrollView().VerticalScrollBarVisibility(Controls::ScrollingScrollBarVisibility::Visible);
}
double threshold = 2.0;
if (AboutPage_ScrollView().VerticalOffset() + threshold < AboutPage_ScrollView().ScrollableHeight())
{
ScrollToEndButton().Visibility(winrt::Microsoft::UI::Xaml::Visibility::Visible);
}
else
{
ScrollToEndButton().Visibility(winrt::Microsoft::UI::Xaml::Visibility::Collapsed);
}
}
}