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.
 
 
 

66 lines
3.0 KiB

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ControlCatalog.Pages.ContentPageEventsPage">
<DockPanel>
<ScrollViewer DockPanel.Dock="Right" Width="260">
<StackPanel Margin="12" Spacing="8">
<TextBlock Text="Configuration" FontSize="16" FontWeight="SemiBold"
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
<TextBlock Text="Navigation" FontSize="13" FontWeight="SemiBold" />
<StackPanel Spacing="6">
<Button Content="Push Page" HorizontalAlignment="Stretch" Click="OnPush" />
<Button Content="Pop Page" HorizontalAlignment="Stretch" Click="OnPop" />
</StackPanel>
<Separator />
<TextBlock Text="Navigating (cancel)" FontSize="13" FontWeight="SemiBold" />
<CheckBox x:Name="BlockNavCheck" Content="Block navigation" />
<TextBlock Text="When checked, the Navigating handler sets Cancel=true and prevents the navigation from proceeding."
TextWrapping="Wrap" FontSize="11" Opacity="0.6" />
<Separator />
<DockPanel>
<TextBlock DockPanel.Dock="Left" Text="Event Log" FontSize="13" FontWeight="SemiBold"
VerticalAlignment="Center" />
<Button DockPanel.Dock="Right" Content="Clear" Click="OnClearLog"
HorizontalAlignment="Right" Padding="8,2" FontSize="11" />
</DockPanel>
<Border Background="{DynamicResource SystemControlBackgroundBaseLowBrush}"
CornerRadius="4" Padding="8" MinHeight="120" MaxHeight="300">
<ScrollViewer x:Name="LogScrollViewer">
<ItemsControl x:Name="EventLogItems">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"
FontFamily="Cascadia Code,Consolas,Menlo,monospace"
FontSize="11" Margin="0,1" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
<Separator />
<TextBlock Text="About" FontSize="13" FontWeight="SemiBold" />
<TextBlock TextWrapping="Wrap" FontSize="12" Opacity="0.7"
Text="ContentPage exposes lifecycle events directly on the page. NavigatedTo fires after the page arrives, providing the previous page and navigation type. NavigatedFrom fires after departure. Navigating fires before leaving and can cancel the navigation by setting Cancel=true." />
</StackPanel>
</ScrollViewer>
<Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
<Border Margin="12"
BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
BorderThickness="1"
CornerRadius="8"
ClipToBounds="True">
<NavigationPage x:Name="DemoNav" />
</Border>
</DockPanel>
</UserControl>