NeutroniumCore / Neutronium

🚀 Build .NET desktop applications using HTML, CSS and javascript.
https://neutroniumcore.github.io/Neutronium/
MIT License
1.34k stars 121 forks source link
browser c-sharp chromium framework html mvvm reactive-programming vue wpf

Neutronium

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

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)

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!