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