|
| 1 | +<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> |
| 2 | +<Page x:Class="MarqueeExperiment.Samples.MarqueeSample" |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:controls="using:CommunityToolkit.WinUI.Controls" |
| 6 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 7 | + xmlns:local="using:MarqueeExperiment.Samples" |
| 8 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 9 | + mc:Ignorable="d"> |
| 10 | + |
| 11 | + <StackPanel Padding="16"> |
| 12 | + <controls:Marquee Behavior="{x:Bind ConvertStringToMarqueeBehavior(MQBehavior), Mode=OneWay}" |
| 13 | + Content="{x:Bind Data}" |
| 14 | + Direction="{x:Bind ConvertStringToMarqueeDirection(MQDirection), Mode=OneWay}" |
| 15 | + FontSize="18" |
| 16 | + RepeatBehavior="Forever" |
| 17 | + Speed="{x:Bind MQSpeed, Mode=OneWay}"> |
| 18 | + <controls:Marquee.ContentTemplate> |
| 19 | + <DataTemplate x:DataType="local:MarqueeSampleItems"> |
| 20 | + <ItemsControl ItemsSource="{x:Bind Items}"> |
| 21 | + <ItemsControl.ItemsPanel> |
| 22 | + <ItemsPanelTemplate> |
| 23 | + <StackPanel Orientation="Horizontal" |
| 24 | + Spacing="8" /> |
| 25 | + </ItemsPanelTemplate> |
| 26 | + </ItemsControl.ItemsPanel> |
| 27 | + <ItemsControl.ItemTemplate> |
| 28 | + <DataTemplate x:DataType="local:MarqueeSampleItem"> |
| 29 | + <Border Width="100" |
| 30 | + Height="48" |
| 31 | + Background="{x:Bind Brush}"> |
| 32 | + <TextBlock Text="{x:Bind Name}" /> |
| 33 | + </Border> |
| 34 | + </DataTemplate> |
| 35 | + </ItemsControl.ItemTemplate> |
| 36 | + </ItemsControl> |
| 37 | + </DataTemplate> |
| 38 | + </controls:Marquee.ContentTemplate> |
| 39 | + </controls:Marquee> |
| 40 | + |
| 41 | + <Button Click="AddItem_Click" |
| 42 | + Content="Add something" /> |
| 43 | + </StackPanel> |
| 44 | +</Page> |
0 commit comments