This repository was archived by the owner on May 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 39 files changed +2450
-201
lines changed Expand file tree Collapse file tree 39 files changed +2450
-201
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,42 @@ Of course, `AvatarView` also supports `Source` for loading images plus a few oth
121121
122122![ AvatarView] ( ./images/avatar-do.png )
123123
124+ ## DrawingView
125+
126+ ### Using DrawingView on Xamarin.Forms
127+
128+ ``` xml
129+ <!-- xmlns:views="clr-namespace:Xamarin.CommunityToolkit.UI.Views;assembly=Xamarin.CommunityToolkit" -->
130+
131+ <views : DrawingView
132+ x : Name =" DrawingViewControl"
133+ Points =" {Binding MyPoints}"
134+ ClearOnFinish =" true"
135+ GestureCompletedCommand =" {Binding GestureCompletedCommand}"
136+ LineColor =" Blue"
137+ LineWidth =" 5"
138+ BackgroundColor =" DarkGray"
139+ HorizontalOptions =" FillAndExpand"
140+ VerticalOptions =" FillAndExpand" />
141+ ```
142+
143+ ### Get Image from points
144+
145+ ```
146+ var stream = DrawingView.GetImageStream(
147+ points,
148+ new Size(GestureImage.Width, GestureImage.Height),
149+ 10, Color.White, Color.Black);
150+ GestureImage.Source = ImageSource.FromStream(() => stream);
151+ ```
152+
153+ or
154+
155+ ```
156+ var stream = DrawingViewControl.GetImageStream(GestureImage.Width, GestureImage.Height);
157+ GestureImage.Source = ImageSource.FromStream(() => stream);
158+ ```
159+
124160## Contributions welcome!
125161
126162If you have one or more of these common pieces of code that you are always replicating across apps, don't hesitate to contribute! We aim to be the first NuGet package you install when creating a new Xamarin app!
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ protected override void OnCreate(Bundle savedInstanceState)
1616
1717 base . OnCreate ( savedInstanceState ) ;
1818
19- global ::Xamarin . Forms . Forms . SetFlags ( "CollectionView_Experimental" ) ;
2019 Platform . Init ( this , savedInstanceState ) ;
2120 global ::Xamarin . Forms . Forms . Init ( this , savedInstanceState ) ;
2221 LoadApplication ( new App ( ) ) ;
Original file line number Diff line number Diff line change 2020 <AndroidEnableSGenConcurrent >true</AndroidEnableSGenConcurrent >
2121 <AndroidUseAapt2 >true</AndroidUseAapt2 >
2222 <AndroidHttpClientHandlerType >Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType >
23+ <EmbedAssembliesIntoApk >true</EmbedAssembliesIntoApk >
2324 <NuGetPackageImportStamp >
2425 </NuGetPackageImportStamp >
2526 </PropertyGroup >
5253 <Reference Include =" System.Xml" />
5354 </ItemGroup >
5455 <ItemGroup >
55- <PackageReference Include =" Xamarin.Forms" Version =" 4.8.0.1269 " />
56+ <PackageReference Include =" Xamarin.Forms" Version =" 4.8.0.1451 " />
5657 <PackageReference Include =" Xamarin.Essentials" Version =" 1.5.3.2" />
5758 <PackageReference Include =" Xamarin.Forms.PancakeView" >
58- <Version >2.1 .0.714 </Version >
59+ <Version >2.3 .0.759 </Version >
5960 </PackageReference >
6061 </ItemGroup >
6162 <ItemGroup >
106107 <AndroidResource Include =" Resources\drawable\info.png" />
107108 </ItemGroup >
108109 <ItemGroup >
109- <ProjectReference Include =" ..\XamarinCommunityToolkitSample \Xamarin.CommunityToolkit.Sample.csproj" >
110+ <ProjectReference Include =" ..\Xamarin.CommunityToolkit.Sample \Xamarin.CommunityToolkit.Sample.csproj" >
110111 <Project >{81AADE72-D666-4AB0-83D9-8FE366E0755E}</Project >
111112 <Name >Xamarin.CommunityToolkit.Sample</Name >
112113 </ProjectReference >
113- <ProjectReference Include =" ..\XamarinCommunityToolkit \Xamarin.CommunityToolkit.csproj" >
114+ <ProjectReference Include =" ..\Xamarin.CommunityToolkit \Xamarin.CommunityToolkit.csproj" >
114115 <Project >{b0dcdf81-953d-47da-a7d4-0565339bf07c}</Project >
115116 <Name >Xamarin.CommunityToolkit</Name >
116117 </ProjectReference >
Original file line number Diff line number Diff line change 8080 </ItemGroup >
8181 <ItemGroup >
8282 <PackageReference Include =" Xamarin.Forms" >
83- <Version >4.8.0.1269 </Version >
83+ <Version >4.8.0.1451 </Version >
8484 </PackageReference >
8585 <PackageReference Include =" Xamarin.Forms.Platform.GTK" >
86- <Version >4.8.0.1269</Version >
86+ <Version >4.8.0.1451</Version >
87+ </PackageReference >
88+ <PackageReference Include =" Xamarin.Forms.PancakeView" >
89+ <Version >2.3.0.759</Version >
8790 </PackageReference >
8891 </ItemGroup >
8992 <ItemGroup >
90- <ProjectReference Include =" ..\XamarinCommunityToolkitSample \Xamarin.CommunityToolkit.Sample.csproj" >
93+ <ProjectReference Include =" ..\Xamarin.CommunityToolkit.Sample \Xamarin.CommunityToolkit.Sample.csproj" >
9194 <Project >{81aade72-d666-4ab0-83d9-8fe366e0755e}</Project >
9295 <Name >Xamarin.CommunityToolkit.Sample</Name >
9396 </ProjectReference >
94- <ProjectReference Include =" ..\XamarinCommunityToolkit \Xamarin.CommunityToolkit.csproj" >
97+ <ProjectReference Include =" ..\Xamarin.CommunityToolkit \Xamarin.CommunityToolkit.csproj" >
9598 <Project >{b0dcdf81-953d-47da-a7d4-0565339bf07c}</Project >
9699 <Name >Xamarin.CommunityToolkit</Name >
97100 </ProjectReference >
Original file line number Diff line number Diff line change 66 </PropertyGroup >
77
88 <ItemGroup >
9- <ProjectReference Include =" ..\XamarinCommunityToolkitSample \Xamarin.CommunityToolkit.Sample.csproj" />
10- <ProjectReference Include =" ..\XamarinCommunityToolkit \Xamarin.CommunityToolkit.csproj" />
9+ <ProjectReference Include =" ..\Xamarin.CommunityToolkit.Sample \Xamarin.CommunityToolkit.Sample.csproj" />
10+ <ProjectReference Include =" ..\Xamarin.CommunityToolkit \Xamarin.CommunityToolkit.csproj" />
1111 </ItemGroup >
1212
1313</Project >
Original file line number Diff line number Diff line change 11using System ;
2- using System . Collections . Generic ;
3- using System . IO ;
4- using System . Linq ;
5- using System . Runtime . InteropServices . WindowsRuntime ;
62using Windows . ApplicationModel ;
73using Windows . ApplicationModel . Activation ;
8- using Windows . Foundation ;
9- using Windows . Foundation . Collections ;
104using Windows . UI . Xaml ;
115using Windows . UI . Xaml . Controls ;
12- using Windows . UI . Xaml . Controls . Primitives ;
13- using Windows . UI . Xaml . Data ;
14- using Windows . UI . Xaml . Input ;
15- using Windows . UI . Xaml . Media ;
166using Windows . UI . Xaml . Navigation ;
177
188namespace Xamarin . CommunityToolkit . Sample . UWP
@@ -28,8 +18,8 @@ sealed partial class App : Application
2818 /// </summary>
2919 public App ( )
3020 {
31- this . InitializeComponent ( ) ;
32- this . Suspending += OnSuspending ;
21+ InitializeComponent ( ) ;
22+ Suspending += OnSuspending ;
3323 }
3424
3525 /// <summary>
@@ -42,7 +32,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
4232#if DEBUG
4333 if ( System . Diagnostics . Debugger . IsAttached )
4434 {
45- this . DebugSettings . EnableFrameRateCounter = true ;
35+ DebugSettings . EnableFrameRateCounter = true ;
4636 }
4737#endif
4838
Original file line number Diff line number Diff line change 146146 </Page >
147147 </ItemGroup >
148148 <ItemGroup >
149- <PackageReference Include =" Xamarin.Forms" Version =" 4.8.0.1269 " />
149+ <PackageReference Include =" Xamarin.Forms" Version =" 4.8.0.1451 " />
150150 <PackageReference Include =" Microsoft.NETCore.UniversalWindowsPlatform" Version =" 6.2.10" />
151151 <PackageReference Include =" Xamarin.Essentials" Version =" 1.5.3.2" />
152152 </ItemGroup >
153153 <ItemGroup >
154- <ProjectReference Include =" ..\XamarinCommunityToolkitSample \Xamarin.CommunityToolkit.Sample.csproj" >
154+ <ProjectReference Include =" ..\Xamarin.CommunityToolkit.Sample \Xamarin.CommunityToolkit.Sample.csproj" >
155155 <Project >{81aade72-d666-4ab0-83d9-8fe366e0755e}</Project >
156156 <Name >Xamarin.CommunityToolkit.Sample</Name >
157157 </ProjectReference >
158- <ProjectReference Include =" ..\XamarinCommunityToolkit \Xamarin.CommunityToolkit.csproj" >
158+ <ProjectReference Include =" ..\Xamarin.CommunityToolkit \Xamarin.CommunityToolkit.csproj" >
159159 <Project >{b0dcdf81-953d-47da-a7d4-0565339bf07c}</Project >
160160 <Name >Xamarin.CommunityToolkit</Name >
161161 </ProjectReference >
Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
5- using System . Threading . Tasks ;
6- using System . Windows ;
7- using System . Windows . Controls ;
8- using System . Windows . Data ;
9- using System . Windows . Documents ;
10- using System . Windows . Input ;
11- using System . Windows . Media ;
12- using System . Windows . Media . Imaging ;
13- using System . Windows . Navigation ;
14- using System . Windows . Shapes ;
15- using Xamarin . Forms . PancakeView . Platforms . WPF ;
1+ using Xamarin . Forms . PancakeView . Platforms . WPF ;
162using Xamarin . Forms . Platform . WPF ;
173
184namespace Xamarin . CommunityToolkit . Sample . WPF
@@ -25,7 +11,7 @@ public partial class MainWindow : FormsApplicationPage
2511 public MainWindow ( )
2612 {
2713 InitializeComponent ( ) ;
28- Xamarin . Forms . Forms . Init ( ) ;
14+ Forms . Forms . Init ( ) ;
2915 PancakeViewRenderer . Init ( ) ;
3016 LoadApplication ( new Xamarin . CommunityToolkit . Sample . App ( ) ) ;
3117 }
You can’t perform that action at this time.
0 commit comments