|
| 1 | +<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.CanvasPathGeometryPage" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 5 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 6 | + xmlns:win2d="using:Microsoft.Graphics.Canvas.UI.Xaml" |
| 7 | + mc:Ignorable="d"> |
| 8 | + |
| 9 | + <Grid Padding="10"> |
| 10 | + <Grid.RowDefinitions> |
| 11 | + <RowDefinition Height="32" /> |
| 12 | + <RowDefinition Height="48" /> |
| 13 | + <RowDefinition Height="0.1*" /> |
| 14 | + <RowDefinition Height="48" /> |
| 15 | + <RowDefinition Height="0.9*" /> |
| 16 | + </Grid.RowDefinitions> |
| 17 | + <TextBlock Margin="12,3" |
| 18 | + VerticalAlignment="Center" |
| 19 | + Text="Samples: " /> |
| 20 | + <Grid Grid.Row="1"> |
| 21 | + <Grid.ColumnDefinitions> |
| 22 | + <ColumnDefinition Width="*" |
| 23 | + MinWidth="145" /> |
| 24 | + <ColumnDefinition Width="*" |
| 25 | + MinWidth="145" /> |
| 26 | + <ColumnDefinition Width="*" |
| 27 | + MinWidth="145" /> |
| 28 | + <ColumnDefinition Width="*" |
| 29 | + MinWidth="145" /> |
| 30 | + <ColumnDefinition Width="*" |
| 31 | + MinWidth="145" /> |
| 32 | + </Grid.ColumnDefinitions> |
| 33 | + <Button Grid.Column="0" |
| 34 | + Width="120" |
| 35 | + Height="36" |
| 36 | + Margin="10,3" |
| 37 | + HorizontalAlignment="Center" |
| 38 | + Click="{x:Bind OnShowRoundedStarSample}" |
| 39 | + Content="Rounded Star" /> |
| 40 | + <Button Grid.Column="1" |
| 41 | + Width="120" |
| 42 | + Height="36" |
| 43 | + Margin="10,3" |
| 44 | + HorizontalAlignment="Center" |
| 45 | + Click="{x:Bind OnShowStarSample}" |
| 46 | + Content="Star" /> |
| 47 | + <Button Grid.Column="2" |
| 48 | + Width="120" |
| 49 | + Height="36" |
| 50 | + Margin="10,3" |
| 51 | + HorizontalAlignment="Center" |
| 52 | + Click="{x:Bind OnShowSpiralSample}" |
| 53 | + Content="Spiral" /> |
| 54 | + <Button Grid.Column="3" |
| 55 | + Width="120" |
| 56 | + Height="36" |
| 57 | + Margin="10,3" |
| 58 | + HorizontalAlignment="Center" |
| 59 | + Click="{x:Bind OnShowFlowerSample}" |
| 60 | + Content="Flower" /> |
| 61 | + <Button Grid.Column="4" |
| 62 | + Width="120" |
| 63 | + Height="36" |
| 64 | + Margin="10,3" |
| 65 | + HorizontalAlignment="Center" |
| 66 | + Click="{x:Bind OnShowGearSample}" |
| 67 | + Content="Gear" /> |
| 68 | + |
| 69 | + </Grid> |
| 70 | + <TextBox x:Name="InputData" |
| 71 | + Grid.Row="2" |
| 72 | + Margin="10,3" |
| 73 | + FontFamily="Courier New" |
| 74 | + FontSize="14" |
| 75 | + PlaceholderText="Enter SVG/XAML Path Data and press Parse. (Or click on one of the Samples from above)" |
| 76 | + ScrollViewer.VerticalScrollBarVisibility="Auto" |
| 77 | + SelectionHighlightColor="#007aff" |
| 78 | + Text="{Binding InputText, Mode=TwoWay}" |
| 79 | + TextChanged="{x:Bind OnInputTextChanged}" |
| 80 | + TextWrapping="Wrap" /> |
| 81 | + <Button Grid.Row="3" |
| 82 | + Width="120" |
| 83 | + Height="36" |
| 84 | + Margin="10,3" |
| 85 | + HorizontalAlignment="Left" |
| 86 | + Click="{x:Bind OnClearCanvas}" |
| 87 | + Content="Clear" /> |
| 88 | + <Pivot x:Name="RootPivot" |
| 89 | + Grid.Row="4"> |
| 90 | + <PivotItem Foreground="Black" |
| 91 | + Header="Canvas"> |
| 92 | + <ScrollViewer x:Name="RenderScroll" |
| 93 | + HorizontalScrollBarVisibility="Auto" |
| 94 | + VerticalScrollBarVisibility="Auto"> |
| 95 | + <win2d:CanvasControl x:Name="RenderCanvas" |
| 96 | + Width="{Binding ElementName=RenderScroll, Path=ActualWidth}" |
| 97 | + Height="{Binding ElementName=RenderScroll, Path=ActualHeight}" |
| 98 | + MinWidth="1200" |
| 99 | + MinHeight="800" |
| 100 | + HorizontalAlignment="Stretch" |
| 101 | + VerticalAlignment="Stretch" |
| 102 | + HorizontalContentAlignment="Stretch" |
| 103 | + VerticalContentAlignment="Stretch" |
| 104 | + ClearColor="#A7A7A7" |
| 105 | + Draw="{x:Bind OnCanvasDraw}" /> |
| 106 | + </ScrollViewer> |
| 107 | + </PivotItem> |
| 108 | + <PivotItem Foreground="Black" |
| 109 | + Header="Commands"> |
| 110 | + <ScrollViewer Background="#272727" |
| 111 | + HorizontalScrollBarVisibility="Disabled" |
| 112 | + VerticalScrollBarVisibility="Auto"> |
| 113 | + <TextBlock x:Name="CommandsList" |
| 114 | + Padding="10" |
| 115 | + FontFamily="Courier New" |
| 116 | + FontSize="16" |
| 117 | + Foreground="White" |
| 118 | + IsTextSelectionEnabled="True" |
| 119 | + SelectionHighlightColor="#007aff" |
| 120 | + TextWrapping="Wrap" /> |
| 121 | + </ScrollViewer> |
| 122 | + </PivotItem> |
| 123 | + </Pivot> |
| 124 | + <StackPanel Grid.Row="4" |
| 125 | + HorizontalAlignment="Right" |
| 126 | + VerticalAlignment="Top" |
| 127 | + Orientation="Horizontal"> |
| 128 | + <TextBlock Margin="10,10,5,-10" |
| 129 | + Text="StrokeThickness" /> |
| 130 | + <Slider x:Name="StrokeThickness" |
| 131 | + Width="150" |
| 132 | + Height="30" |
| 133 | + Margin="0,4,10,4" |
| 134 | + Background="White" |
| 135 | + Foreground="White" |
| 136 | + Maximum="10" |
| 137 | + Minimum="0" |
| 138 | + StepFrequency="0.1" |
| 139 | + ValueChanged="{x:Bind OnStrokeThicknessChanged}" /> |
| 140 | + <TextBlock Margin="10,10,5,-10" |
| 141 | + Text="Stroke Color: " /> |
| 142 | + <ComboBox x:Name="StrokeList" |
| 143 | + Width="150" |
| 144 | + Height="30" |
| 145 | + Margin="0,4,10,4" |
| 146 | + SelectionChanged="{x:Bind OnStrokeColorChanged}" /> |
| 147 | + <TextBlock Margin="10,10,5,-10" |
| 148 | + Text="Fill Color: " /> |
| 149 | + <ComboBox x:Name="FillList" |
| 150 | + Width="150" |
| 151 | + Height="30" |
| 152 | + Margin="0,4,10,4" |
| 153 | + SelectionChanged="{x:Bind OnFillColorChanged}" /> |
| 154 | + </StackPanel> |
| 155 | + </Grid> |
| 156 | +</Page> |
0 commit comments