Попробуйте это:
MainPage.xaml
<Page x:Name="page"
x:Class="MyApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Canvas Background="Red">
<Grid>
<!--Your layout-->
</Grid>
<Grid x:Name="swipingContent" Canvas.Left="0" Background="Black" Width="{Binding ActualWidth, ElementName=page, Mode=OneWay}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Thumb x:Name="thumb" Height="35" ManipulationMode="TranslateY" IsEnabled="True" ManipulationDelta="Thumb_ManipulationDelta"/>
<TextBlock Foreground="Black" FontSize="22" Text="Heading" VerticalAlignment="Center"/>
<CheckBox Grid.Row="1" IsChecked="True" Content="Some CheckBox"/>
<!--and other layout-->
</Grid>
</Canvas>
</Page>
MainPage.xaml.cs:
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
this.NavigationCacheMode = NavigationCacheMode.Required;
this.SizeChanged += MainPage_SizeChanged;
}
private void MainPage_SizeChanged(object sender, SizeChangedEventArgs e)
{
swipingContent.SetValue(Canvas.TopProperty, e.NewSize.Height - thumb.ActualHeight);
}
private void Thumb_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
var maxSwipedHeight = swipingContent.Height;
var currentPosition = (double)swipingContent.GetValue(Canvas.TopProperty);
var distanceFromBottom = this.ActualHeight - currentPosition;
var targetDistance = distanceFromBottom - e.Delta.Translation.Y;
double targetPosition;
if (targetDistance <= thumb.ActualHeight)
{
targetPosition = this.ActualHeight - thumb.ActualHeight;
}
else if (targetDistance >= maxSwipedHeight)
{
targetPosition = this.ActualHeight - maxSwipedHeight;
}
else
{
targetPosition = this.ActualHeight - targetDistance;
}
swipingContent.SetValue(Canvas.TopProperty, targetPosition);
}
}
Почему вы не просто использовать AppBar? –