|
7 | 7 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
8 | 8 | xmlns:TBFX="using:TextBlockFX.Win2D.UWP"
|
9 | 9 | xmlns:effects="using:TextBlockFX.Win2D.UWP.Effects"
|
| 10 | + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" |
| 11 | + xmlns:controls="using:Sample.Win2D.UWP.Controls" |
10 | 12 | mc:Ignorable="d"
|
11 | 13 | Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}">
|
12 | 14 |
|
13 | 15 | <Grid>
|
14 |
| - <Grid.RowDefinitions> |
15 |
| - <RowDefinition Height="*"/> |
16 |
| - <RowDefinition Height="Auto"/> |
17 |
| - <RowDefinition Height="*"/> |
18 |
| - </Grid.RowDefinitions> |
| 16 | + <Grid.ColumnDefinitions> |
| 17 | + <ColumnDefinition Width="400"/> |
| 18 | + <ColumnDefinition Width="*"/> |
| 19 | + </Grid.ColumnDefinitions> |
| 20 | + |
| 21 | + <Border |
| 22 | + Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" |
| 23 | + BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 24 | + BorderThickness="1" |
| 25 | + CornerRadius="4" |
| 26 | + Padding="10" |
| 27 | + Margin="10"> |
| 28 | + <ScrollViewer> |
| 29 | + <StackPanel Orientation="Vertical" Spacing="10"> |
| 30 | + <muxc:Expander |
| 31 | + IsExpanded="True" |
| 32 | + HorizontalAlignment="Stretch" |
| 33 | + Header="Effects"> |
| 34 | + <StackPanel Orientation="Vertical" |
| 35 | + Spacing="10" |
| 36 | + HorizontalAlignment="Stretch"> |
| 37 | + <ComboBox x:Name="EffectComboBox" |
| 38 | + HorizontalAlignment="Stretch" |
| 39 | + ItemsSource="{x:Bind BuiltInEffects}" |
| 40 | + DisplayMemberPath="Name" |
| 41 | + SelectedValuePath="Effect" |
| 42 | + SelectedValue="{x:Bind SelectedEffect, Mode = TwoWay}" |
| 43 | + Loaded="EffectComboBox_OnLoaded"/> |
| 44 | + </StackPanel> |
| 45 | + </muxc:Expander> |
| 46 | + <muxc:Expander |
| 47 | + IsExpanded="True" |
| 48 | + HorizontalAlignment="Stretch" |
| 49 | + Header="Text Format"> |
| 50 | + <StackPanel Orientation="Vertical" |
| 51 | + Spacing="10" |
| 52 | + HorizontalAlignment="Stretch"> |
| 53 | + <controls:FontPickerBox x:Name="FontPicker" HorizontalAlignment="Stretch"/> |
| 54 | + <muxc:NumberBox x:Name="FontSizeNumBox" |
| 55 | + Header="Font size" |
| 56 | + Value="36" |
| 57 | + SpinButtonPlacementMode="Inline" |
| 58 | + Maximum="72" |
| 59 | + Minimum="9" |
| 60 | + SmallChange="1" |
| 61 | + LargeChange="10"/> |
| 62 | + <ComboBox x:Name="FontStretchComboBox" |
| 63 | + HorizontalAlignment="Stretch" |
| 64 | + Header="Font Stretch" |
| 65 | + ItemsSource="{x:Bind FontStretches}" |
| 66 | + DisplayMemberPath="Name" |
| 67 | + SelectedValuePath="Value"/> |
| 68 | + <ComboBox x:Name="FontStyleComboBox" |
| 69 | + HorizontalAlignment="Stretch" |
| 70 | + Header="Font Style" |
| 71 | + ItemsSource="{x:Bind FontStyles}" |
| 72 | + DisplayMemberPath="Name" |
| 73 | + SelectedValuePath="Value"/> |
| 74 | + <ComboBox x:Name="FontWeightComboBox" |
| 75 | + HorizontalAlignment="Stretch" |
| 76 | + Header="Font Weight" |
| 77 | + ItemsSource="{x:Bind FontWeightsList}" |
| 78 | + DisplayMemberPath="Name" |
| 79 | + SelectedValuePath="Value"/> |
| 80 | + </StackPanel> |
| 81 | + </muxc:Expander> |
| 82 | + <muxc:Expander |
| 83 | + IsExpanded="True" |
| 84 | + HorizontalAlignment="Stretch" |
| 85 | + Header="Text"> |
| 86 | + <StackPanel Orientation="Vertical" Spacing="10" HorizontalAlignment="Stretch"> |
| 87 | + <ComboBox x:Name="TextComboBox" |
| 88 | + Margin="5,0" |
| 89 | + MinWidth="200" |
| 90 | + HorizontalAlignment="Stretch" |
| 91 | + SelectedIndex="{x:Bind SelectedSampleTextIndex, Mode = TwoWay}" |
| 92 | + Loaded="TextComboBox_OnLoaded"> |
| 93 | + <x:String>In Other Words</x:String> |
| 94 | + <x:String>Mencius (in Chinese)</x:String> |
| 95 | + </ComboBox> |
| 96 | + <ToggleButton x:Name="AutoPlayButton" |
| 97 | + Margin="5,0" |
| 98 | + Click="AutoPlayButton_OnClick" |
| 99 | + HorizontalAlignment="Center"> |
| 100 | + <StackPanel Orientation="Horizontal" Spacing="5"> |
| 101 | + <SymbolIcon Symbol="Play"/> |
| 102 | + <TextBlock Text="Play sample texts"/> |
| 103 | + </StackPanel> |
| 104 | + </ToggleButton> |
| 105 | + <TextBox x:Name="InputBox" |
| 106 | + Grid.Row="2" |
| 107 | + Grid.ColumnSpan="2" |
| 108 | + Margin="10" |
| 109 | + AcceptsReturn="True" |
| 110 | + TextWrapping="Wrap" |
| 111 | + HorizontalAlignment="Stretch" |
| 112 | + ScrollViewer.HorizontalScrollMode="Disabled" |
| 113 | + ScrollViewer.VerticalScrollMode="Auto" |
| 114 | + ScrollViewer.HorizontalScrollBarVisibility="Hidden" |
| 115 | + ScrollViewer.VerticalScrollBarVisibility="Auto" |
| 116 | + TextChanged="InputBox_OnTextChanged"/> |
| 117 | + </StackPanel> |
| 118 | + </muxc:Expander> |
| 119 | + </StackPanel> |
| 120 | + </ScrollViewer> |
| 121 | + </Border> |
| 122 | + |
19 | 123 | <TBFX:TextBlockFX x:Name="TBFX"
|
20 |
| - Margin="10" |
21 |
| - TextWrapping="Wrap" |
22 |
| - FontSize="36" |
23 |
| - TextAlignment="Center" |
24 |
| - TextTrimming="CharacterEllipsis" |
25 |
| - RedrawStateChanged="TBFX_OnRedrawStateChanged"> |
| 124 | + Grid.Column="1" |
| 125 | + Margin="10" |
| 126 | + MinHeight="300" |
| 127 | + MaxHeight="600" |
| 128 | + FontFamily="{Binding ElementName=FontPicker, Path=FontFamily,Mode=OneWay}" |
| 129 | + FontSize="{Binding ElementName=FontSizeNumBox, Path=Value, Mode=OneWay}" |
| 130 | + FontStyle="{Binding ElementName=FontStyleComboBox, Path=SelectedValue, Mode= OneWay}" |
| 131 | + FontStretch="{Binding ElementName=FontStretchComboBox, Path=SelectedValue, Mode=OneWay}" |
| 132 | + FontWeight="{Binding ElementName=FontWeightComboBox, Path=SelectedValue, Mode=OneWay}" |
| 133 | + TextAlignment="Center" |
| 134 | + TextTrimming="CharacterEllipsis" |
| 135 | + TextWrapping="Wrap" |
| 136 | + RedrawStateChanged="TBFX_OnRedrawStateChanged"> |
26 | 137 | </TBFX:TextBlockFX>
|
27 |
| - |
28 |
| - <CommandBar Grid.Row="1" |
29 |
| - IsOpen="False" |
30 |
| - DefaultLabelPosition="Right" |
31 |
| - HorizontalAlignment="Center"> |
32 |
| - <AppBarElementContainer VerticalContentAlignment="Center"> |
33 |
| - <ComboBox x:Name="TextComboBox" |
34 |
| - Margin="5,0" |
35 |
| - MinWidth="200" |
36 |
| - SelectedIndex="{x:Bind SelectedSampleTextIndex, Mode = TwoWay}" |
37 |
| - Loaded="TextComboBox_OnLoaded"> |
38 |
| - <x:String>In Other Words</x:String> |
39 |
| - <x:String>Mencius (in Chinese)</x:String> |
40 |
| - </ComboBox> |
41 |
| - </AppBarElementContainer> |
42 |
| - <AppBarSeparator/> |
43 |
| - <AppBarElementContainer VerticalContentAlignment="Center"> |
44 |
| - <TextBlock Text="Effect:" Margin="5,0"/> |
45 |
| - </AppBarElementContainer> |
46 |
| - <AppBarElementContainer VerticalContentAlignment="Center"> |
47 |
| - <ComboBox x:Name="EffectComboBox" |
48 |
| - Margin="5,0" |
49 |
| - MinWidth="200" |
50 |
| - ItemsSource="{x:Bind BuiltInEffects}" |
51 |
| - DisplayMemberPath="Name" |
52 |
| - SelectedValuePath="Effect" |
53 |
| - SelectedValue="{x:Bind SelectedEffect, Mode = TwoWay}" |
54 |
| - Loaded="EffectComboBox_OnLoaded"/> |
55 |
| - </AppBarElementContainer> |
56 |
| - <AppBarSeparator/> |
57 |
| - <AppBarToggleButton x:Name="AutoPlayButton" |
58 |
| - Margin="5,0" |
59 |
| - Icon="Play" |
60 |
| - Label="Play sample texts" |
61 |
| - Click="AutoPlayButton_OnClick"/> |
62 |
| - </CommandBar> |
63 |
| - <TextBox x:Name="InputBox" |
64 |
| - Grid.Row="2" |
65 |
| - Grid.ColumnSpan="2" |
66 |
| - Margin="10" |
67 |
| - AcceptsReturn="True" |
68 |
| - TextWrapping="Wrap" |
69 |
| - ScrollViewer.HorizontalScrollMode="Disabled" |
70 |
| - ScrollViewer.VerticalScrollMode="Auto" |
71 |
| - ScrollViewer.HorizontalScrollBarVisibility="Hidden" |
72 |
| - ScrollViewer.VerticalScrollBarVisibility="Auto" |
73 |
| - TextChanged="InputBox_OnTextChanged"/> |
74 | 138 | </Grid>
|
75 | 139 | </Page>
|
0 commit comments