|
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
5 | 5 | xmlns:behaviors="using:CommunityToolkit.App.Shared.Behaviors" |
| 6 | + xmlns:converters="using:CommunityToolkit.WinUI.Converters" |
6 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
7 | 8 | xmlns:interactions="using:Microsoft.Xaml.Interactions.Core" |
8 | 9 | xmlns:interactivity="using:Microsoft.Xaml.Interactivity" |
|
34 | 35 | <local:DocOrSampleTemplateSelector x:Key="DocOrSampleTemplateSelector" |
35 | 36 | Document="{StaticResource DocumentTemplate}" |
36 | 37 | Sample="{StaticResource SampleTemplate}" /> |
| 38 | + <converters:DoubleToVisibilityConverter x:Name="doubleToVisibilityConverter" |
| 39 | + FalseValue="Collapsed" |
| 40 | + GreaterThan="1" |
| 41 | + NullValue="Collapsed" |
| 42 | + TrueValue="Visible" /> |
37 | 43 | </Page.Resources> |
38 | 44 |
|
39 | 45 | <Grid> |
|
89 | 95 |
|
90 | 96 | <!-- Header grid --> |
91 | 97 | <Grid x:Name="HeaderGrid" |
92 | | - Margin="40,24,40,40" |
93 | | - VerticalAlignment="Top"> |
| 98 | + Margin="40,24,40,24" |
| 99 | + VerticalAlignment="Top" |
| 100 | + ColumnSpacing="8"> |
| 101 | + <Grid.ColumnDefinitions> |
| 102 | + <ColumnDefinition Width="*" /> |
| 103 | + <ColumnDefinition Width="Auto" /> |
| 104 | + </Grid.ColumnDefinitions> |
94 | 105 | <Grid.RowDefinitions> |
95 | 106 | <RowDefinition Height="Auto" /> |
96 | 107 | <RowDefinition Height="Auto" /> |
|
106 | 117 | <TextBlock Grid.Row="1" |
107 | 118 | Margin="0,8,0,0" |
108 | 119 | HorizontalAlignment="Left" |
| 120 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
109 | 121 | Text="{x:Bind Metadata.Description, Mode=OneWay}" |
110 | 122 | TextWrapping="WrapWholeWords" /> |
111 | 123 |
|
112 | | - <Grid Grid.Row="2" |
113 | | - Margin="0,16,0,0" |
114 | | - ColumnSpacing="8"> |
115 | | - |
116 | | - <StackPanel x:Name="ButtonPanel" |
117 | | - x:Load="{x:Bind renderer:ToolkitDocumentationRenderer.IsProjectPathValid()}" |
118 | | - Orientation="Horizontal" |
119 | | - Spacing="8"> |
120 | | - <Button Visibility="{x:Bind renderer:ToolkitDocumentationRenderer.IsIdValid(Metadata.DiscussionId), Mode=OneWay}"> |
121 | | - <StackPanel Orientation="Horizontal"> |
122 | | - <FontIcon FontSize="14" |
123 | | - Glyph="" /> |
124 | | - <TextBlock Margin="8,0,0,0" |
125 | | - Text="Discussion" /> |
126 | | - </StackPanel> |
127 | | - <interactivity:Interaction.Behaviors> |
128 | | - <interactions:EventTriggerBehavior EventName="Click"> |
129 | | - <behaviors:NavigateToUriAction NavigateUri="{x:Bind renderer:ToolkitDocumentationRenderer.ToGitHubUri('discussions', Metadata.DiscussionId), Mode=OneWay}" /> |
130 | | - </interactions:EventTriggerBehavior> |
131 | | - </interactivity:Interaction.Behaviors> |
132 | | - </Button> |
133 | | - <Button Visibility="{x:Bind renderer:ToolkitDocumentationRenderer.IsIdValid(Metadata.IssueId), Mode=OneWay}"> |
134 | | - <StackPanel Orientation="Horizontal"> |
135 | | - <PathIcon Margin="-3" |
136 | | - VerticalAlignment="Center" |
137 | | - Data="{StaticResource GithubIcon}"> |
138 | | - <PathIcon.RenderTransform> |
139 | | - <CompositeTransform ScaleX="0.65" |
140 | | - ScaleY="0.65" |
141 | | - TranslateX="-5" |
142 | | - TranslateY="5" /> |
143 | | - </PathIcon.RenderTransform> |
144 | | - </PathIcon> |
145 | | - <TextBlock Margin="-4,0,0,0" |
146 | | - Text="Tracking Issue" /> |
147 | | - </StackPanel> |
148 | | - <interactivity:Interaction.Behaviors> |
149 | | - <interactions:EventTriggerBehavior EventName="Click"> |
150 | | - <behaviors:NavigateToUriAction NavigateUri="{x:Bind renderer:ToolkitDocumentationRenderer.ToGitHubUri('issues', Metadata.IssueId), Mode=OneWay}" /> |
151 | | - </interactions:EventTriggerBehavior> |
152 | | - </interactivity:Interaction.Behaviors> |
153 | | - </Button> |
154 | | - </StackPanel> |
155 | | - |
156 | | - <StackPanel HorizontalAlignment="Right" |
157 | | - VerticalAlignment="Center" |
158 | | - Orientation="Horizontal" |
159 | | - Spacing="8"> |
160 | | - <TextBlock VerticalAlignment="Center" |
| 124 | + <StackPanel x:Name="ButtonPanel" |
| 125 | + Grid.Row="2" |
| 126 | + Margin="0,16,0,0" |
| 127 | + x:Load="{x:Bind renderer:ToolkitDocumentationRenderer.IsProjectPathValid()}" |
| 128 | + Orientation="Horizontal" |
| 129 | + Spacing="8"> |
| 130 | + <Button Visibility="{x:Bind renderer:ToolkitDocumentationRenderer.IsIdValid(Metadata.DiscussionId), Mode=OneWay}"> |
| 131 | + <StackPanel Orientation="Horizontal"> |
| 132 | + <FontIcon FontSize="14" |
| 133 | + Glyph="" /> |
| 134 | + <TextBlock Margin="8,0,0,0" |
| 135 | + Text="Discussion" /> |
| 136 | + </StackPanel> |
| 137 | + <interactivity:Interaction.Behaviors> |
| 138 | + <interactions:EventTriggerBehavior EventName="Click"> |
| 139 | + <behaviors:NavigateToUriAction NavigateUri="{x:Bind renderer:ToolkitDocumentationRenderer.ToGitHubUri('discussions', Metadata.DiscussionId), Mode=OneWay}" /> |
| 140 | + </interactions:EventTriggerBehavior> |
| 141 | + </interactivity:Interaction.Behaviors> |
| 142 | + </Button> |
| 143 | + <Button Visibility="{x:Bind renderer:ToolkitDocumentationRenderer.IsIdValid(Metadata.IssueId), Mode=OneWay}"> |
| 144 | + <StackPanel Orientation="Horizontal"> |
| 145 | + <PathIcon Margin="-3" |
| 146 | + VerticalAlignment="Center" |
| 147 | + Data="{StaticResource GithubIcon}"> |
| 148 | + <PathIcon.RenderTransform> |
| 149 | + <CompositeTransform ScaleX="0.65" |
| 150 | + ScaleY="0.65" |
| 151 | + TranslateX="-5" |
| 152 | + TranslateY="5" /> |
| 153 | + </PathIcon.RenderTransform> |
| 154 | + </PathIcon> |
| 155 | + <TextBlock Margin="-4,0,0,0" |
| 156 | + Text="Tracking Issue" /> |
| 157 | + </StackPanel> |
| 158 | + <interactivity:Interaction.Behaviors> |
| 159 | + <interactions:EventTriggerBehavior EventName="Click"> |
| 160 | + <behaviors:NavigateToUriAction NavigateUri="{x:Bind renderer:ToolkitDocumentationRenderer.ToGitHubUri('issues', Metadata.IssueId), Mode=OneWay}" /> |
| 161 | + </interactions:EventTriggerBehavior> |
| 162 | + </interactivity:Interaction.Behaviors> |
| 163 | + </Button> |
| 164 | + </StackPanel> |
| 165 | + <ComboBox x:Name="SampleSelectionBox" |
| 166 | + Grid.RowSpan="2" |
| 167 | + Grid.Column="1" |
| 168 | + MinWidth="160" |
| 169 | + HorizontalAlignment="Right" |
| 170 | + VerticalAlignment="Bottom" |
| 171 | + ItemsSource="{x:Bind Samples, Mode=OneWay}" |
| 172 | + SelectedIndex="0" |
| 173 | + SelectionChanged="SampleSelectionBox_SelectionChanged" |
| 174 | + Visibility="{x:Bind Samples.Count, Converter={StaticResource doubleToVisibilityConverter}}"> |
| 175 | + <ComboBox.Header> |
| 176 | + <TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
161 | 177 | Style="{StaticResource CaptionTextBlockStyle}" |
162 | | - Text="Sample:" /> |
163 | | - <ComboBox x:Name="SampleSelectionBox" |
164 | | - MinWidth="160" |
165 | | - ItemsSource="{x:Bind Samples, Mode=OneWay}" |
166 | | - SelectedIndex="0" |
167 | | - SelectionChanged="SampleSelectionBox_SelectionChanged"> |
168 | | - <ComboBox.ItemTemplate> |
169 | | - <DataTemplate x:DataType="metadata:ToolkitSampleMetadata"> |
170 | | - <TextBlock Text="{Binding DisplayName, Mode=OneWay}" /> |
171 | | - </DataTemplate> |
172 | | - </ComboBox.ItemTemplate> |
173 | | - </ComboBox> |
174 | | - </StackPanel> |
175 | | - </Grid> |
| 178 | + Text="Go to sample:" /> |
| 179 | + </ComboBox.Header> |
| 180 | + <ComboBox.ItemTemplate> |
| 181 | + <DataTemplate x:DataType="metadata:ToolkitSampleMetadata"> |
| 182 | + <TextBlock Text="{Binding DisplayName, Mode=OneWay}" /> |
| 183 | + </DataTemplate> |
| 184 | + </ComboBox.ItemTemplate> |
| 185 | + </ComboBox> |
| 186 | + |
176 | 187 | <muxc:InfoBar Title="Experimental" |
177 | 188 | Grid.Row="3" |
| 189 | + Grid.ColumnSpan="2" |
178 | 190 | Margin="0,16,0,0" |
179 | 191 | IsClosable="False" |
180 | | - IsOpen="True"> |
| 192 | + Visibility="Collapsed"> |
181 | 193 | <muxc:InfoBar.ActionButton> |
182 | 194 | <HyperlinkButton Content="Learn how you can use this experiment in your app" |
183 | 195 | NavigateUri="https://aka.ms/wct/wiki/previewpackages" /> |
|
186 | 198 | </Grid> |
187 | 199 | </Grid> |
188 | 200 | </Page> |
| 201 | + |
0 commit comments