- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.4k
Added the Win2d Path Geometry parser. #3503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            michael-hawker
  merged 46 commits into
  CommunityToolkit:master
from
ratishphilip:feature/win2dparser
  
      
      
   
  Feb 4, 2021 
      
    
  
     Merged
                    Changes from 35 commits
      Commits
    
    
            Show all changes
          
          
            46 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      cec5bd6
              
                Added the Win2d Path Geometry parser.
              
              
                ratishphilip 298d22f
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 36c5617
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 34306d7
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip d6d39de
              
                Added unit test cases for Geometry Helpers.
              
              
                ratishphilip 983a3ce
              
                Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
              
              
                ratishphilip 609e249
              
                updated SampleApp.csproj file to resolve conflict
              
              
                ratishphilip 7f8162a
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 0daee1e
              
                Updated headers.
              
              
                ratishphilip d8e1753
              
                Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
              
              
                ratishphilip 1ec440a
              
                Fixed build errors. Removed unused usings.
              
              
                ratishphilip 16db83d
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 155dc64
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 874579c
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 7360ed9
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip d82454d
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 46e88b1
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip b61a631
              
                Implemented changes based on Sergio's review comments.
              
              
                ratishphilip 78720bc
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip d26c3ec
              
                Fixed build errors. (Added default option for switch case)
              
              
                ratishphilip 3b69aed
              
                Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
              
              
                ratishphilip cba88e9
              
                Removed ThrowHelper.ThrowNullReferenceException which I had added.
              
              
                ratishphilip f419f2c
              
                Using ThrowHelper.ThrowArgument exception instead of ThrowHelper.Thro…
              
              
                ratishphilip 31eeae1
              
                Implemented Xamllama's severl code review comments.
              
              
                ratishphilip 8a195a1
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 42f9b5c
              
                Added more TestCases as per code review comments.
              
              
                ratishphilip 693ddf7
              
                Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
              
              
                ratishphilip 16fb788
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 30a5040
              
                Removed logger from CanvasPathGeometry. Using ICanvasPathReceiver in …
              
              
                ratishphilip c3a31f3
              
                Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
              
              
                ratishphilip 530e722
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 37a70ef
              
                Parsing CanvasGeometry on Input change.
              
              
                ratishphilip d61d202
              
                Csproj fixes
              
              
                ratishphilip eb7d40d
              
                SampleApp.csproj build failure fix.
              
              
                ratishphilip 7d756c5
              
                Build error fix.
              
              
                ratishphilip 6c63198
              
                Merge branch 'master' into feature/win2dparser
              
              
                michael-hawker e618fc7
              
                CanvasGeometry path parse error now more descriptive in the Sample App.
              
              
                ratishphilip b7a9fed
              
                Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
              
              
                ratishphilip be42cc5
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip ef27c15
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 46d93c0
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 3e55f52
              
                Sample app now switches to Commands List pivot item to show the parsi…
              
              
                ratishphilip 2f6f192
              
                Merge branch 'feature/win2dparser' of https://github.com/ratishphilip…
              
              
                ratishphilip 90f1cb7
              
                Merge branch 'master' into feature/win2dparser
              
              
                ratishphilip 67e3842
              
                Merge branch 'master' into feature/win2dparser
              
              
                Sergio0694 4bafb55
              
                Refactored removed Diagnostics dependency
              
              
                Sergio0694 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          Binary file added
          
            BIN
              
                +4.54 KB
              
          
        
  ...oft.Toolkit.Uwp.SampleApp/SamplePages/CanvasPathGeometry/CanvasPathGeometry.png
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          
            163 changes: 163 additions & 0 deletions
          
          163 
        
  Microsoft.Toolkit.Uwp.SampleApp/SamplePages/CanvasPathGeometry/CanvasPathGeometryPage.xaml
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| <Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.CanvasPathGeometryPage" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:win2d="using:Microsoft.Graphics.Canvas.UI.Xaml" | ||
| mc:Ignorable="d"> | ||
|  | ||
| <Grid Padding="10"> | ||
| <Grid.RowDefinitions> | ||
| <RowDefinition Height="32" /> | ||
| <RowDefinition Height="48" /> | ||
| <RowDefinition Height="0.1*" /> | ||
| <RowDefinition Height="48" /> | ||
| <RowDefinition Height="0.9*" /> | ||
| </Grid.RowDefinitions> | ||
| <TextBlock Margin="12,3" | ||
| VerticalAlignment="Center" | ||
| Text="Samples: " /> | ||
| <Grid Grid.Row="1"> | ||
| <Grid.ColumnDefinitions> | ||
| <ColumnDefinition Width="*" | ||
| MinWidth="145" /> | ||
| <ColumnDefinition Width="*" | ||
| MinWidth="145" /> | ||
| <ColumnDefinition Width="*" | ||
| MinWidth="145" /> | ||
| <ColumnDefinition Width="*" | ||
| MinWidth="145" /> | ||
| <ColumnDefinition Width="*" | ||
| MinWidth="145" /> | ||
| </Grid.ColumnDefinitions> | ||
| <Button Grid.Column="0" | ||
| Width="120" | ||
| Height="36" | ||
| Margin="10,3" | ||
| HorizontalAlignment="Center" | ||
| Click="{x:Bind OnShowRoundedStarSample}" | ||
| Content="Rounded Star" /> | ||
| <Button Grid.Column="1" | ||
| Width="120" | ||
| Height="36" | ||
| Margin="10,3" | ||
| HorizontalAlignment="Center" | ||
| Click="{x:Bind OnShowStarSample}" | ||
| Content="Star" /> | ||
| <Button Grid.Column="2" | ||
| Width="120" | ||
| Height="36" | ||
| Margin="10,3" | ||
| HorizontalAlignment="Center" | ||
| Click="{x:Bind OnShowSpiralSample}" | ||
| Content="Spiral" /> | ||
| <Button Grid.Column="3" | ||
| Width="120" | ||
| Height="36" | ||
| Margin="10,3" | ||
| HorizontalAlignment="Center" | ||
| Click="{x:Bind OnShowFlowerSample}" | ||
| Content="Flower" /> | ||
| <Button Grid.Column="4" | ||
| Width="120" | ||
| Height="36" | ||
| Margin="10,3" | ||
| HorizontalAlignment="Center" | ||
| Click="{x:Bind OnShowGearSample}" | ||
| Content="Gear" /> | ||
|  | ||
| </Grid> | ||
| <TextBox x:Name="InputData" | ||
| Grid.Row="2" | ||
| Margin="10,3" | ||
| FontFamily="Courier New" | ||
| FontSize="14" | ||
| PlaceholderText="Enter SVG/XAML Path Data and press Parse. (Or click on one of the Samples from above)" | ||
| ScrollViewer.VerticalScrollBarVisibility="Auto" | ||
| SelectionHighlightColor="#007aff" | ||
| Text="{Binding InputText, Mode=TwoWay}" | ||
| TextChanged="{x:Bind OnInputTextChanged}" | ||
| TextWrapping="Wrap" /> | ||
| <Button Grid.Row="3" | ||
| Width="120" | ||
| Height="36" | ||
| Margin="10,3" | ||
| HorizontalAlignment="Left" | ||
| Click="{x:Bind OnClearCanvas}" | ||
| Content="Clear" /> | ||
| <Button Grid.Row="3" | ||
| Width="120" | ||
| Height="36" | ||
| Margin="10,3" | ||
| HorizontalAlignment="Right" | ||
| Click="{x:Bind OnParseData}" | ||
| Content="Parse" /> | ||
| <Pivot x:Name="RootPivot" | ||
| Grid.Row="4"> | ||
| <PivotItem Foreground="Black" | ||
| Header="Canvas"> | ||
| <ScrollViewer x:Name="RenderScroll" | ||
| HorizontalScrollBarVisibility="Auto" | ||
| VerticalScrollBarVisibility="Auto"> | ||
| <win2d:CanvasControl x:Name="RenderCanvas" | ||
| Width="{Binding ElementName=RenderScroll, Path=ActualWidth}" | ||
| Height="{Binding ElementName=RenderScroll, Path=ActualHeight}" | ||
| MinWidth="1200" | ||
| MinHeight="800" | ||
| HorizontalAlignment="Stretch" | ||
| VerticalAlignment="Stretch" | ||
| HorizontalContentAlignment="Stretch" | ||
| VerticalContentAlignment="Stretch" | ||
| ClearColor="#A7A7A7" | ||
| Draw="{x:Bind OnCanvasDraw}" /> | ||
| </ScrollViewer> | ||
| </PivotItem> | ||
| <PivotItem Foreground="Black" | ||
| Header="Commands"> | ||
| <ScrollViewer Background="#272727" | ||
| HorizontalScrollBarVisibility="Disabled" | ||
| VerticalScrollBarVisibility="Auto"> | ||
| <TextBlock x:Name="CommandsList" | ||
| Padding="10" | ||
| FontFamily="Courier New" | ||
| FontSize="16" | ||
| Foreground="White" | ||
| IsTextSelectionEnabled="True" | ||
| SelectionHighlightColor="#007aff" | ||
| TextWrapping="Wrap" /> | ||
| </ScrollViewer> | ||
| </PivotItem> | ||
| </Pivot> | ||
| <StackPanel Grid.Row="4" | ||
| HorizontalAlignment="Right" | ||
| VerticalAlignment="Top" | ||
| Orientation="Horizontal"> | ||
| <TextBlock Margin="10,10,5,-10" | ||
| Text="StrokeThickness" /> | ||
| <Slider x:Name="StrokeThickness" | ||
| Width="150" | ||
| Height="30" | ||
| Margin="0,4,10,4" | ||
| Background="White" | ||
| Foreground="White" | ||
| Maximum="10" | ||
| Minimum="0" | ||
| StepFrequency="0.1" | ||
| ValueChanged="{x:Bind OnStrokeThicknessChanged}" /> | ||
| <TextBlock Margin="10,10,5,-10" | ||
| Text="Stroke Color: " /> | ||
| <ComboBox x:Name="StrokeList" | ||
| Width="150" | ||
| Height="30" | ||
| Margin="0,4,10,4" | ||
| SelectionChanged="{x:Bind OnStrokeColorChanged}" /> | ||
| <TextBlock Margin="10,10,5,-10" | ||
| Text="Fill Color: " /> | ||
| <ComboBox x:Name="FillList" | ||
| Width="150" | ||
| Height="30" | ||
| Margin="0,4,10,4" | ||
| SelectionChanged="{x:Bind OnFillColorChanged}" /> | ||
| </StackPanel> | ||
| </Grid> | ||
| </Page> | ||
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.