Home

Awesome

<p align="center"><img width="100"src="./Deploy/logo.svg?sanitize=true"></p> <h1 align="center">Neutronium</h1>

Build status NuGet Badge MIT License

https://neutroniumcore.github.io/Neutronium/

What is Neutronium?

Why Neutronium?

Uses cases

Main features

How?

On the shoulders of giants

<p align="center"> <a href="https://www.chromium.org" > <img height="60" src="https://www.chromium.org/_/rsrc/1438879449147/config/customLogo.gif?revision=3"> </a> <a href="https://bitbucket.org/chromiumembedded/cef"> <img height="70"src="https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2015/Mar/14/3042045877-1-cef-logo_avatar.png"> </a> <a href="http://vuejs.org/"> <img height="70" style="margin-top: 10px;" src="http://vuejs.org/images/logo.png"> </a> <a href="http://knockoutjs.com/"> <img height="70" style="margin-top: 10px;" src="http://knockoutjs.com/img/ko-logo.png"> </a> </p>

Usage - Example

ViewModel (C#)

public class ViewModelBase : INotifyPropertyChanged
{
	public event PropertyChangedEventHandler PropertyChanged;
	
	protected void Set<T>(ref T pnv, T value, string pn)
	{
		pnv = value;
		PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(pn));
	}
}

public class Skill
{
	public string Type { get;}
	public string Name { get;}

	public Skill (string name, string skillType)
	{
		Name = name;
		Type = skillType;
	}
}

public class Person: ViewModelBase
{
	private string _LastName;
	public string LastName
	{
		get { return _LastName; }
		set { Set(ref _LastName, value, "LastName"); }
	}

	private string _Name;
	public string Name
	{
		get { return _Name; }
		set { Set(ref _Name, value, "Name"); }
	}
		   
	public IList<Skill> Skills { get; private set; }

	public ICommand RemoveSkill { get; private set; }
	
	public Person()
	{
		Skills = new ObservableCollection<Skill>();
		RemoveSkill = new RelayCommand<Skill>(s=> this.Skills.Remove(s));
	}	  
}

View (HTML)

<!doctype html>
<html>
	<head>
		<title>Vue.js Example</title>
	</head>
	<body>
		<input type="text" v-model="viewModel.Name" placeholder="First name" >
		<ul>
			<li v-for="skill in viewModel.Skills">
				<span>{{skill.Type}}:{{skill.Name}}</span>
				<button @click="RemoveSkill.Execute(skill)">Remove skill</button>
			</li>
		</ul>
		<div>
			<h2>{{viewModel.Name}}</h2>
			<h2>{{viewModel.LastName}}</h2>
		</div>
	</body>
</html>

Create the component(C# Xaml)

<Neutronium:HTMLViewControl Uri="pack://application:,,,/src/index.html" />

The binding is done on the DataContext property just as standard WPF, That's it!

Examples

here

Get started

Best way to start with Neutronium is to download template C# solution from visual studio gallery.

See Here for detailed instructions.

Complete Documentation

Here

Comparison with other libraries:

Nuget packages

ChromiumFx browser and Vue.js

ChromiumFx browser and knockout.js

This project is a continuation and improvement of MVVM-for-awesomium.

Support

Jetbrains logo

Many thanks to JetBrains for support and awesome Resharper!