Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinbrunet/SkiaSharp.DiagramEngine
Using SkiaSharp with Xaml,Bindings and DataTemplates. Compatible with Xamarin Forms
https://github.com/kevinbrunet/SkiaSharp.DiagramEngine
diagram net-standard-2 skiasharp xamarin xamarin-forms
Last synced: 29 days ago
JSON representation
Using SkiaSharp with Xaml,Bindings and DataTemplates. Compatible with Xamarin Forms
- Host: GitHub
- URL: https://github.com/kevinbrunet/SkiaSharp.DiagramEngine
- Owner: kevinbrunet
- License: mit
- Created: 2018-03-08T14:51:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-23T15:15:49.000Z (over 6 years ago)
- Last Synced: 2024-08-08T16:33:41.578Z (4 months ago)
- Topics: diagram, net-standard-2, skiasharp, xamarin, xamarin-forms
- Language: C#
- Size: 326 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - SkiaSharp.DiagramEngine ★10
README
# SkiaSharp.DiagramEngine
Using SkiaSharp with Xaml,Bindings and DataTemplates. Compatible with Xamarin Forms## Using SkiaSharp.DiagramEngine
Install the [NuGet package SynodeTechnologies.SkiaSharp.DiagramEngine](https://www.nuget.org/packages/SynodeTechnologies.SkiaSharp.DiagramEngine):
```
nuget install SynodeTechnologies.SkiaSharp.DiagramEngine
```## Getting Started
```xaml
```
![Image of GetStarted](https://raw.githubusercontent.com/kevinbrunet/SkiaSharp.DiagramEngine/master/Docs/Images/GetStarted.png)
## Layouts
```xaml
```
![Image of Layout](https://raw.githubusercontent.com/kevinbrunet/SkiaSharp.DiagramEngine/master/Docs/Images/Layout.PNG)
## TemplatedItems
```xaml
```
```csharp
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class TemplateItems : ContentPage
{
public class Item : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;private string name;
public string Name
{
get
{
return name;
}
set
{
name = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Name)));
}
}
}private ObservableCollection items = new ObservableCollection();
public ObservableCollection Items
{
get
{
return items;
}
}public ICommand AddItemCommand { get; }
public TemplateItems()
{
InitializeComponent ();
this.AddItemCommand = new Command(() =>
{
Items.Add(new Item() { Name = "Item" + Items.Count });
});
this.BindingContext = this;
}
}
```![Image of TemplatedItems](https://raw.githubusercontent.com/kevinbrunet/SkiaSharp.DiagramEngine/master/Docs/Images/ItemsTemplate.PNG)
## ZoomCanvas
```xaml
```
![Image of ZoomCanvas](https://raw.githubusercontent.com/kevinbrunet/SkiaSharp.DiagramEngine/master/Docs/Images/Zoom.PNG)
## HierarchicalItemsTemplate
```xaml
```
```csharp
public partial class HierarchicalItemsTemplate : ContentPage
{
public class HierarchicalItem : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;public HierarchicalItem(string name)
{
this.name = name;
}private string name;
public string Name
{
get
{
return name;
}
set
{
name = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Name)));
}
}private ObservableCollection children = new ObservableCollection();
public ObservableCollection Children
{
get
{
return children;
}
}
}private HierarchicalItem root;
public HierarchicalItem Root
{
get
{
return root;
}
}public HierarchicalItemsTemplate()
{
InitializeComponent ();
root = new HierarchicalItem("Root");
root.Children.Add(new HierarchicalItem("1"));
root.Children[0].Children.Add(new HierarchicalItem("1.1"));
root.Children[0].Children.Add(new HierarchicalItem("1.2"));
root.Children[0].Children.Add(new HierarchicalItem("1.3"));
root.Children.Add(new HierarchicalItem("2"));
root.Children[1].Children.Add(new HierarchicalItem("2.1"));
root.Children[1].Children.Add(new HierarchicalItem("2.2"));
root.Children[1].Children.Add(new HierarchicalItem("2.3"));
root.Children.Add(new HierarchicalItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nSed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor."));
root.Children[2].Children.Add(new HierarchicalItem("3.1"));
root.Children[2].Children.Add(new HierarchicalItem("3.2"));
root.Children[2].Children.Add(new HierarchicalItem("3.3"));
root.Children[2].Children[0].Children.Add(new HierarchicalItem("Lorem ipsum dolor sit amet"));
this.BindingContext = this;
}
}
```![Image of ZoomCanvas](https://raw.githubusercontent.com/kevinbrunet/SkiaSharp.DiagramEngine/master/Docs/Images/HierarchicalItemsTemplate.PNG)