Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,42 @@ Of course, `AvatarView` also supports `Source` for loading images plus a few oth

![AvatarView](./images/avatar-do.png)

## DrawingView

### Using DrawingView on Xamarin.Forms

```xml
<!-- xmlns:views="clr-namespace:Xamarin.CommunityToolkit.UI.Views;assembly=Xamarin.CommunityToolkit" -->

<views:DrawingView
x:Name="DrawingViewControl"
Points="{Binding MyPoints}"
ClearOnFinish="true"
GestureCompletedCommand="{Binding GestureCompletedCommand}"
LineColor="Blue"
LineWidth="5"
BackgroundColor="DarkGray"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" />
```

### Get Image from points

```
var stream = DrawingView.GetImageStream(
points,
new Size(GestureImage.Width, GestureImage.Height),
10, Color.White, Color.Black);
GestureImage.Source = ImageSource.FromStream(() => stream);
```

or

```
var stream = DrawingViewControl.GetImageStream(GestureImage.Width, GestureImage.Height);
GestureImage.Source = ImageSource.FromStream(() => stream);
```

## Contributions welcome!

If 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!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ protected override void OnCreate(Bundle savedInstanceState)

base.OnCreate(savedInstanceState);

global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");
Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
Expand Down Expand Up @@ -52,10 +53,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1451" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Forms.PancakeView">
<Version>2.1.0.714</Version>
<Version>2.3.0.759</Version>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix pancakeView for GTK and WPF

</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -106,11 +107,11 @@
<AndroidResource Include="Resources\drawable\info.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\XamarinCommunityToolkitSample\Xamarin.CommunityToolkit.Sample.csproj">
<ProjectReference Include="..\Xamarin.CommunityToolkit.Sample\Xamarin.CommunityToolkit.Sample.csproj">
<Project>{81AADE72-D666-4AB0-83D9-8FE366E0755E}</Project>
<Name>Xamarin.CommunityToolkit.Sample</Name>
</ProjectReference>
<ProjectReference Include="..\XamarinCommunityToolkit\Xamarin.CommunityToolkit.csproj">
<ProjectReference Include="..\Xamarin.CommunityToolkit\Xamarin.CommunityToolkit.csproj">
<Project>{b0dcdf81-953d-47da-a7d4-0565339bf07c}</Project>
<Name>Xamarin.CommunityToolkit</Name>
</ProjectReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,21 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms">
<Version>4.8.0.1269</Version>
<Version>4.8.0.1451</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms.Platform.GTK">
<Version>4.8.0.1269</Version>
<Version>4.8.0.1451</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms.PancakeView">
<Version>2.3.0.759</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\XamarinCommunityToolkitSample\Xamarin.CommunityToolkit.Sample.csproj">
<ProjectReference Include="..\Xamarin.CommunityToolkit.Sample\Xamarin.CommunityToolkit.Sample.csproj">
<Project>{81aade72-d666-4ab0-83d9-8fe366e0755e}</Project>
<Name>Xamarin.CommunityToolkit.Sample</Name>
</ProjectReference>
<ProjectReference Include="..\XamarinCommunityToolkit\Xamarin.CommunityToolkit.csproj">
<ProjectReference Include="..\Xamarin.CommunityToolkit\Xamarin.CommunityToolkit.csproj">
<Project>{b0dcdf81-953d-47da-a7d4-0565339bf07c}</Project>
<Name>Xamarin.CommunityToolkit</Name>
</ProjectReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\XamarinCommunityToolkitSample\Xamarin.CommunityToolkit.Sample.csproj" />
<ProjectReference Include="..\XamarinCommunityToolkit\Xamarin.CommunityToolkit.csproj" />
<ProjectReference Include="..\Xamarin.CommunityToolkit.Sample\Xamarin.CommunityToolkit.Sample.csproj" />
<ProjectReference Include="..\Xamarin.CommunityToolkit\Xamarin.CommunityToolkit.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace Xamarin.CommunityToolkit.Sample.UWP
Expand All @@ -28,8 +18,8 @@ sealed partial class App : Application
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
InitializeComponent();
Suspending += OnSuspending;
}

/// <summary>
Expand All @@ -42,7 +32,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
DebugSettings.EnableFrameRateCounter = true;
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,16 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1451" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.10" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\XamarinCommunityToolkitSample\Xamarin.CommunityToolkit.Sample.csproj">
<ProjectReference Include="..\Xamarin.CommunityToolkit.Sample\Xamarin.CommunityToolkit.Sample.csproj">
<Project>{81aade72-d666-4ab0-83d9-8fe366e0755e}</Project>
<Name>Xamarin.CommunityToolkit.Sample</Name>
</ProjectReference>
<ProjectReference Include="..\XamarinCommunityToolkit\Xamarin.CommunityToolkit.csproj">
<ProjectReference Include="..\Xamarin.CommunityToolkit\Xamarin.CommunityToolkit.csproj">
<Project>{b0dcdf81-953d-47da-a7d4-0565339bf07c}</Project>
<Name>Xamarin.CommunityToolkit</Name>
</ProjectReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Xamarin.Forms.PancakeView.Platforms.WPF;
using Xamarin.Forms.PancakeView.Platforms.WPF;
using Xamarin.Forms.Platform.WPF;

namespace Xamarin.CommunityToolkit.Sample.WPF
Expand All @@ -25,7 +11,7 @@ public partial class MainWindow : FormsApplicationPage
public MainWindow()
{
InitializeComponent();
Xamarin.Forms.Forms.Init();
Forms.Forms.Init();
PancakeViewRenderer.Init();
LoadApplication(new Xamarin.CommunityToolkit.Sample.App());
}
Expand Down
Loading