From 8b6341458b742736bf42da0589c10a2bff864a4c Mon Sep 17 00:00:00 2001 From: Mohamed Abdelnour Date: Fri, 14 May 2021 23:59:11 +0200 Subject: Add XAML test file --- tests/syntax-tests/highlighted/XAML/ItemPage.xaml | 264 ++++++++++++++++++++++ tests/syntax-tests/source/XAML/ItemPage.xaml | 264 ++++++++++++++++++++++ tests/syntax-tests/source/XAML/LICENSE.md | 23 ++ 3 files changed, 551 insertions(+) create mode 100644 tests/syntax-tests/highlighted/XAML/ItemPage.xaml create mode 100644 tests/syntax-tests/source/XAML/ItemPage.xaml create mode 100644 tests/syntax-tests/source/XAML/LICENSE.md diff --git a/tests/syntax-tests/highlighted/XAML/ItemPage.xaml b/tests/syntax-tests/highlighted/XAML/ItemPage.xaml new file mode 100644 index 00000000..ea33f0d4 --- /dev/null +++ b/tests/syntax-tests/highlighted/XAML/ItemPage.xaml @@ -0,0 +1,264 @@ + +<Page + x:Class="AppUIBasics.ItemPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:common="using:AppUIBasics.Common" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:data="using:AppUIBasics.Data" + xmlns:local="using:AppUIBasics" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + x:Name="pageRoot" + mc:Ignorable="d"> + +  + <Grid x:Name="rootPanel" d:DataContext="{Binding Groups[0].Items[0], Source={d:DesignData Source=/DataModel/ControlinfoData.json, Type=data:ControlInfoDataSource}}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup> + <VisualState> + <VisualState.StateTriggers> + <local:DeviceFamilyTrigger DeviceFamily="Windows.Xbox" /> +  + <VisualState.Setters> + <Setter Target="svPanel.Margin" Value="0,0,48,27" /> +  +  +  + <VisualStateGroup> + <VisualState x:Name="NormalFrameContent" /> + <VisualState x:Name="WideFrameContent"> + <VisualState.Setters> + <Setter Target="contentFrame.Width" Value="1028" /> + <Setter Target="contentFrame.HorizontalAlignment" Value="Left" /> +  +  +  + <VisualStateGroup x:Name="LayoutVisualStates"> + <VisualState x:Name="LargeLayout"> + <VisualState.StateTriggers> + <AdaptiveTrigger MinWindowWidth="1372" /> +  +  + <VisualState x:Name="WideLayout"> + <VisualState.StateTriggers> + <AdaptiveTrigger MinWindowWidth="{StaticResource Breakpoint640Plus}" /> +  + <VisualState.Setters> + <Setter Target="seeAlsoPanel.Width" Value="Auto" /> + <Setter Target="seeAlsoPanel.(Grid.Row)" Value="3" /> + <Setter Target="seeAlsoPanel.(Grid.Column)" Value="0" /> + <Setter Target="seeAlsoPanel.(Grid.ColumnSpan)" Value="3" /> + + <Setter Target="SourcePanel.(Grid.ColumnSpan)" Value="1" /> + + <Setter Target="DocumentationPanel.(Grid.ColumnSpan)" Value="1" /> + + <Setter Target="RelatedControlsPanel.(Grid.Row)" Value="0" /> + <Setter Target="RelatedControlsPanel.(Grid.Column)" Value="2" /> + <Setter Target="RelatedControlsPanel.(Grid.ColumnSpan)" Value="1" /> + + <Setter Target="FeedbackPanel.(Grid.Row)" Value="1" /> + <Setter Target="FeedbackPanel.(Grid.Column)" Value="2" /> + <Setter Target="FeedbackPanel.(Grid.ColumnSpan)" Value="1" /> +  +  + <VisualState x:Name="NarrowLayout"> + <VisualState.StateTriggers> + <AdaptiveTrigger MinWindowWidth="0" /> +  + <VisualState.Setters> + <Setter Target="seeAlsoPanel.Width" Value="Auto" /> + <Setter Target="seeAlsoPanel.(Grid.Row)" Value="3" /> + <Setter Target="seeAlsoPanel.(Grid.Column)" Value="0" /> + <Setter Target="seeAlsoPanel.(Grid.ColumnSpan)" Value="3" /> + + <Setter Target="SourcePanel.(Grid.ColumnSpan)" Value="1" /> + + <Setter Target="DocumentationPanel.(Grid.ColumnSpan)" Value="1" /> + + <Setter Target="RelatedControlsPanel.(Grid.Row)" Value="0" /> + <Setter Target="RelatedControlsPanel.(Grid.Column)" Value="2" /> + <Setter Target="RelatedControlsPanel.(Grid.ColumnSpan)" Value="1" /> + + <Setter Target="FeedbackPanel.(Grid.Row)" Value="1" /> + <Setter Target="FeedbackPanel.(Grid.Column)" Value="2" /> + <Setter Target="FeedbackPanel.(Grid.ColumnSpan)" Value="1" /> + + <Setter Target="rightMargin.Width" Value="0" /> + <Setter Target="contentRoot.Padding" Value="14,0" /> +  +  +  +  + +  + <ScrollViewer + x:Name="svPanel" + + VerticalScrollBarVisibility="Auto" + VerticalScrollMode="Auto"> + <Grid x:Name="contentRoot" Padding="24,0,0,0" SizeChanged="OnContentRootSizeChanged"> + <Grid.ColumnDefinitions> + <ColumnDefinition x:Name="contentColumn" /> + <ColumnDefinition x:Name="rightMargin" Width="20" /> + <ColumnDefinition x:Name="infoColumn" Width="Auto" /> +  + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + <RowDefinition Height="20" /> + <RowDefinition Height="Auto" /> +  + + <TextBlock + x:Name="descriptionText" + Style="{ThemeResource BodyTextBlockStyle}" + Grid.ColumnSpan="2" + Margin="0,5,24,0" + Text="{x:Bind Item.Description}" /> + + <Frame x:Name="contentFrame" Grid.Row="1" /> + + <Grid + x:Name="seeAlsoPanel" + Grid.Row="0" + Grid.RowSpan="2" + Grid.Column="2" + Width="280" + Margin="0,0,24,24"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> +  + <Grid.ColumnDefinitions> + <ColumnDefinition /> + <ColumnDefinition Width="20" /> + <ColumnDefinition /> +  + + <StackPanel x:Name="SourcePanel" Grid.Row="0" Grid.ColumnSpan="3" Margin="0,0,0,40"> + <TextBlock + x:Name="SourceHeader" + x:Uid="SourceHeader" + Style="{ThemeResource SubtitleTextBlockStyle}" + Text="View page code on GitHub"/> + <HyperlinkButton + x:Name="PageMarkupGitHubLink" + ToolTipService.ToolTip="{x:Bind PageMarkupGitHubLink.NavigateUri, Mode=OneWay}"> + <TextBlock Text="XAML source code"/> +  + <HyperlinkButton + x:Name="PageCodeGitHubLink" + ToolTipService.ToolTip="{x:Bind PageCodeGitHubLink.NavigateUri, Mode=OneWay}" + Margin="0,12,0,0"> + <TextBlock Text="C# source code"/> +  +  + + <StackPanel x:Name="DocumentationPanel" Grid.Row="1" Grid.ColumnSpan="3" Margin="0,0,0,40"> + <TextBlock + x:Name="docHeader" + x:Uid="DocHeader" + Style="{StaticResource SubtitleTextBlockStyle}" /> + <ItemsControl + x:Name="DocsList" + Margin="0,12,0,0" + IsTabStop="False" + ItemsSource="{x:Bind Item.Docs}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Vertical" /> +  +  + <ItemsControl.ItemTemplate> + <DataTemplate x:DataType="data:ControlInfoDocLink"> + <HyperlinkButton NavigateUri="{Binding Uri}" ToolTipService.ToolTip="{Binding Uri}"> + <TextBlock Text="{x:Bind Title}" /> +  +  +  +  +  + + <StackPanel x:Name="RelatedControlsPanel" Grid.Row="2" Grid.ColumnSpan="3" Margin="0,0,0,40"> + <TextBlock + x:Name="relatedControlsHeader" + x:Uid="RelatedControlsHeader" + Style="{StaticResource SubtitleTextBlockStyle}" /> + + <ItemsControl + x:Name="relatedItemsControl" + Margin="0,12,0,0" + IsTabStop="False" + ItemsSource="{x:Bind Item.RelatedControls}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Vertical" /> +  +  + <ItemsControl.ItemTemplate> + <DataTemplate x:DataType="x:String"> +  + <HyperlinkButton AutomationProperties.Name="{x:Bind}" Click="OnRelatedControlClick"> + <RelativePanel> +  + <Image + AutomationProperties.AccessibilityView="Raw" + x:Name="iconImage" + Width="25" + Margin="0,0,15,0" + common:ImageLoader.Source="{Binding}" /> + <TextBlock + AutomationProperties.AccessibilityView="Raw" + Foreground="{ThemeResource HyperlinkButtonForeground}" + RelativePanel.RightOf="iconImage" + Text="{x:Bind}" + TextWrapping="Wrap" /> +  +  +  +  +  +  + + <StackPanel x:Name="FeedbackPanel" Grid.Row="3" Grid.ColumnSpan="3"> + <TextBlock + x:Name="feedbackHeader" + x:Uid="FeedbackHeader" + Style="{StaticResource SubtitleTextBlockStyle}" /> + <HyperlinkButton NavigateUri="https://github.com/microsoft/Xaml-Controls-Gallery/issues/new/choose"  + ToolTipService.ToolTip="https://github.com/microsoft/Xaml-Controls-Gallery/issues/new/choose"> + <TextBlock x:Uid="FeedbackLink" /> +  +  +  +  +  +  + diff --git a/tests/syntax-tests/source/XAML/ItemPage.xaml b/tests/syntax-tests/source/XAML/ItemPage.xaml new file mode 100644 index 00000000..365afcdf --- /dev/null +++ b/tests/syntax-tests/source/XAML/ItemPage.xaml @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +