A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

58 lines
2.9 KiB

<!-- Not a ScrollPage: the canvas has to fill the page, and touch drags must draw rather than scroll. -->
<ContentPage x:Class="ControlCatalog.Pages.PointersPage"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ControlCatalog.Pages"
Header="Pointers">
<DockPanel>
<!-- Settings and stats sit above the canvas rather than over it, so they never block input and canvas repaints
never redraw them. The stats keep a fixed height, so updating them never resizes the canvas. -->
<Border DockPanel.Dock="Top"
Padding="12,8"
Background="{DynamicResource CatalogStageBackground}"
BorderBrush="{DynamicResource CatalogCardBorderBrush}"
BorderThickness="0,0,0,1">
<StackPanel Spacing="6">
<WrapPanel ItemSpacing="16" LineSpacing="4">
<StackPanel Width="180">
<TextBlock Classes="sample-options-title"
Text="{Binding #ThreadSleepSlider.Value, StringFormat='Sleep in handler: {0} ms'}" />
<Slider x:Name="ThreadSleepSlider"
Maximum="500"
IsSnapToTickEnabled="True"
TickFrequency="1" />
</StackPanel>
<StackPanel Width="180">
<TextBlock Classes="sample-options-title"
Text="{Binding #LoadWorkSlider.Value, StringFormat='Load: {0} ms per 100 ms'}" />
<Slider x:Name="LoadWorkSlider"
Maximum="90"
IsSnapToTickEnabled="True"
TickFrequency="1" />
</StackPanel>
</WrapPanel>
<!-- Tabular digits keep the numbers from jittering as they change. -->
<DockPanel TextElement.FontSize="12" TextElement.FontFeatures="+tnum">
<ToggleButton x:Name="DetailsToggle"
DockPanel.Dock="Right"
Padding="10,2"
Content="Details" />
<TextBlock VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
Text="{Binding #Canvas.Status}"
ToolTip.Tip="Delay is measured relative to the fastest event seen so far" />
</DockPanel>
<TextBlock FontSize="12"
FontFeatures="+tnum"
Foreground="{DynamicResource CatalogSubtleForeground}"
TextTrimming="CharacterEllipsis"
IsVisible="{Binding #DetailsToggle.IsChecked}"
Text="{Binding #Canvas.StatusDetails}" />
</StackPanel>
</Border>
<local:PointerCanvas x:Name="Canvas"
ClipToBounds="True"
ThreadSleep="{Binding #ThreadSleepSlider.Value}"
LoadWork="{Binding #LoadWorkSlider.Value}" />
</DockPanel>
</ContentPage>