Coder Social home page Coder Social logo

neutroniumcore / neutronium Goto Github PK

View Code? Open in Web Editor NEW
1.3K 59.0 122.0 62.59 MB

🚀 Build .NET desktop applications using HTML, CSS and javascript.

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

License: MIT License

C# 68.29% HTML 1.04% JavaScript 30.60% CSS 0.07%
chromium mvvm c-sharp vue wpf html framework browser reactive-programming

neutronium's Introduction

Neutronium

Build status NuGet Badge MIT License

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

What is Neutronium?

  • Neutronium is a library to create .NET desktop applications using HTML, CSS and javascript.

  • Neutronium uses MVVM pattern exactly the same way as WPF application.

  • Neutronium provides bindings with Vue.js and Knockout.js to build powerful HTML5 UI.

Why Neutronium?

  • Use all the power of the javascript stack to build .NET desktop applications.

  • Easy to use:

    • Architecture Neutronium application just like standard WPF application.
    • Compatible with popular MVVM libraries such as MVVM Light Toolkit and reactiveUi
    • Use standard javascript frameworks to build UI
  • Easy to set-up:

  • Build UI on a 100% Open Source Stack

Uses cases

Main features

  • Reactive to property and collection changes

  • Two way-binding beetween view and viewmodel, including command binding

  • Pluggable architecture:

    • Easily plug-in new javascript frameworks or even embedded browser.

How?

  • Neutronium combines Chromium via ChromiumFx C# lib and a binding engine that converts back and forth C# POCO to javascript POCO.
  • Javascript objects are then used as ViewModel for javascript MVVM library such as knockout.js or Vue.js.
  • Listeners are set-up on C# and javascript side for two-way binding.

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)

  • First option: use Vue.js
<!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:

  • Electron

    Neutronium is electron for .NET? Well, kind of. Neutronium however is a higher abstraction so that you don't need to care about Chromium implementation such as renderer or browser processes.

  • Awesomium

    Different from other libraries Awesomium is not open source. Last update was embedding Chrome 19 so it is pretty out of date. One neutronium distribution offer Awesomium as WebBrowser.

  • CefGlue, ChromiumFx, CefSharp

    All are open source libraries presenting up-to-date C# binding for CEF

  • CefGlue

    Offers all API of CEF. Used by Neutronium as a test WebBrowser using the mono-process option.

  • ChromiumFx

    Same as CefGlue + remote API that handles communication between Chromium processes. Neutronium recommended set-up uses ChromiumFx as a WebBrowser.

  • CefSharp

    Well documented and package solution (including nuget). Does not offer all CEF binding to javascript however.

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!

neutronium's People

Contributors

david-desmaisons avatar dependabot[bot] avatar garrypolley avatar jawn avatar kolyaraketa avatar lhyqy5 avatar robertmuehsig avatar simonbuehler avatar sjoerd222888 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neutronium's Issues

Is neutronium supporting AnyCpu and x64 ?

Hi ,
I am not sure it is the good place to ask such question.

We are currently evaluating WebControl to integrate in Prism based applications.
These applications are mostly x32 and x64 and so libraries that are also AnyCpu can be a big plus as it is a way to avoid to have x86 and x64 variant of the libs.
I tried to execute some samples in x64 and it seems it is not working. I noticed also that even if the sample are AnyCpu option prefer 32 bit is checked resulting in a 32 bit application.
So the question is
Does Neutronium support x64 application ? Do you provide any CPU libs using on x86 and x64 applicatiion ?

Thx in advance for your answer

Additionnal information
Example.Awesomium.CefGlue.Ko.SimpleU
Modify the project to build truly build it as AnyCPU (uncheck prefer 32 bit)
Start in debug on a WIndows X64
You have this exception =>System.BadImageFormatException on Neutronium.WPF assembly surely because it is not x64 or anyCPU

Execute RelayCommand from plain javascript

I know it's not place to ask question, and this is not an issue. I already read your documentation about binding RelayCommand for VueJS. So, for execute the command come from C# is there two way in VueJS.
<button v-command:"AddSkill"><\button>
or
<button @:click:"RemoveSkill.Execute(skill)"></button>

But, is possible to call RelayCommand from plain javacript? maybe like this :
window.ViewModel.AddSkill();

I want to use Neutronium in my next project, and this not limited to the RelayCommand. Can get access the view model from plain javascript is big point. So my question just for the RelayCommand.
Is there way to meet this point? or i just miss something on your documentation?

Thank you

observable collection not properly update in web view

@David-Desmaisons hi

have weird problem with some observable collection:

Have this vue template bind to Packages

          <demo-grid  :data="Packages"
                    :columns="gridColumns"
                    :filter-key="searchQuery">
          </demo-grid>

the component for vue:

Vue.component('demo-grid', {
    template: '#grid-template',
    props: {
        columns: Array,
        filterKey: String
    },
    data: function () {
        var sortOrders = {}
        this.columns.forEach(function (key) {
            sortOrders[key] = 1
        })
        return {
            sortKey: '',
            sortOrders: sortOrders
        }
    },
    computed: {
        filteredData: function () {
            var sortKey = this.sortKey
            var filterKey = this.filterKey && this.filterKey.toLowerCase()
            var order = this.sortOrders[sortKey] || 1
            var data = this.$parent.Packages
            if (filterKey) {
                data = data.filter(function (row) {
                    return Object.keys(row).some(function (key) {
                        return String(row[key]).toLowerCase().indexOf(filterKey) > -1
                    })
                })
            }
            if (sortKey) {
                data = data.slice().sort(function (a, b) {
                    a = a[sortKey]
                    b = b[sortKey]
                    return (a === b ? 0 : a > b ? 1 : -1) * order
                })
            }
            return data
        }
    },

When i do in c# side this.Packages.clear() then the web component clears all packages, however when i repopulate the list altought the c# side contains the correct values the web still shows the old values.

see debug data
image

after repopulate vue debugwindow
image

if i close the web component and restore it again then it brings new values.

if forcing adding new items they will be double but still with old values. is there something i should do to force refresh the values?

thanks

libcfx library not found

Heya! I noticed that there was a closed issue which had this same problem, but that no solution was posted.

Using the current version of the Visual Studio Neutronium VueJS template breaks on runtime with an Chromium.CfxException error because of a missing libcfx.dll library. I've reinstalled the Nuget packages as per recommended in #17 , but it didn't solve the crash. Just a note that I am running on VS 2017, so that might be the issue, although I doubt it.

Any ideas as to why this may be happening?

Here's the debug log (well, at least part of it).

An unhandled exception of type 'Chromium.CfxException' occurred in ChromiumFX.dll
libcfx library not found.

System.ObjectDisposedException

Got some Neutronium-related exceptions collected from the users.

This exception has 7 occurences across 300+ beta users.

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'CfxCommandLine'.
   at Chromium.CfxLibraryBase.get_NativePtr()
   at Chromium.CfxCommandLine.AppendSwitchWithValue(String name, String value)
   at Chromium.Remote.RemoteService.OnBeforeChildProcessLaunch(Object sender, CfxOnBeforeChildProcessLaunchEventArgs e)
   at Chromium.CfxBrowserProcessHandler.on_before_child_process_launch(IntPtr gcHandlePtr, IntPtr command_line, Int32& command_line_release)

This exception has 1 occurence across 300+ beta users.

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'CfxBrowser'.
   at Chromium.CfxLibraryBase.get_NativePtr()
   at Chromium.CfxBrowser.get_MainFrame()
   at Chromium.WebBrowser.ChromiumWebBrowser.AfterSetBrowserTasks(Object state)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

no watch is triggered when observed is set with same value

hi @David-Desmaisons

notice that the view is not updated with last data if the data values are unchanged. my case, i have different tabs and when going from a tab without webframe to a tab with webframe although the getters are called from the neutronium application the watch code is not.

ive try manually changing a variable to same value and the watch does not trigger either.

this results in the web view not having the last values from the model when we swap the tabs

is this by design, how to workaround the issue?

thanks and regards

jorge costa

Package html assets in WPF resource

Is there any way to package html assets into WPF resource, then use pack uris to set HTMLViewControl's RelativeSource property. So we can hide the html files instead of leaving them in the filesystem.

jquery not firing for some tabs

@David-Desmaisons hi, i think i mention this before but i cant find the relevant conversation in any of the open issues. So apologies for the spam.

this is really weird, im trying to hook some jquery events but it only works outside neturonium...

$(document).ready(function () {
console.log('document ready'); // Active Tab
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
console.log('showing tab ' + e.target); // Active Tab
console.log('showing tab ' + e.relatedTarget); // Previous Tab
})
});

log outside neutronium

vue.js created
document ready
showing tab http://localhost:8080/farmi.html#MacroEditor
showing tab http://localhost:8080/farmi.html#editorAndTesId

log inside netronium

document ready
VM26:11183 Neutronium: ViewModel injected
vue.js created

i swear i saw once when playing around with this, some tabs event being fired. but i cant get it again. The only difference is the order of the document ready and vue.js created method. Can that have an effect in jquery? and on to make it work?

thanks for the help,

Usage with C++

I am creating a C++ application where i would like to embed Neutronium (not .net application).
Any documentation or help to get started ?

glueHelper not found

@David-Desmaisons hi

im keeping getting a this

NeutroniumException: glueHelper not found!

at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()
at Neutronium.Core.Navigation.DoubleBrowserNavigator.Switch(Task1 binding, HTMLLogicWindow window, TaskCompletionSource1 tcs)
at Neutronium.Core.Navigation.DoubleBrowserNavigator.<>c__DisplayClass34_0.b__2(Task1 t) at Neutronium.Core.Infra.TaskHelper.<>c__DisplayClass1_01.b__0(Task[] ts)
at System.Threading.Tasks.TaskFactory1.<>c.<ContinueWhenAllImpl>b__57_1(Task1 completedTasks, Object state)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Neutronium.Core.Navigation.DoubleBrowserNavigator.<>c__DisplayClass34_0.<b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

do you have any ideas why?

ive started using some html with some redirection to saml authetication server. but there is no other logic currently other than that

regards

Unable to use reCAPTCHA 2

I'm thinking about using reCAPTCHA 2 in my app to prevent login brute-forcing. There are no google cookies in Neutronium, so I would show this strong captcha only for 10+ failed login attempts from a single IP.

However, reCAPTCHA 2 says "ERROR for site owner: Invalid domain for site key".

To reproduce it, just register a new reCAPTCHA "Invisible reCAPTCHA" key here, and it gives a snippet to paste into index.html (outside of Vue-controlled elements, to get it working with Vue is another question).

There is a similar problem in React Native, and they solve it by using a base url.

I tried to fake Referer: and Origin: headers in requests, but it's not enough, reCAPTCHA javascript seems to check the url on client-side, too. And on client side I have pack:// urls now.

A list of apps that use Neutronium

A list of real-world apps that use Neutronium would be really good.

My team is uncertain about what to use, Electron is very popular and has lots of applications, but we only need HTML-based UI. Just a single example would help and clear the doubts.

Thank you for an amazing project, anyway.

crash after executing app after some hours

hi,

ive left my app for the night running, in the morning it was crashing with this stacktrace:

Application: BuildAllApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Neutronium.Core.Exceptions.NeutroniumException
   at Neutronium.WPF.HTMLViewControl.set_RelativeSource(System.String)

Exception Info: System.Windows.Markup.XamlParseException
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(System.Xaml.XamlReader, System.Xaml.XamlObjectWriter)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(System.Xaml.XamlObjectWriter)
   at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(System.Windows.DependencyObject, System.Windows.Markup.IComponentConnector, System.Windows.Markup.IStyleConnector, System.Collections.Generic.List`1<System.Windows.DependencyObject>, System.Windows.UncommonField`1<System.Collections.Hashtable>)
   at System.Windows.FrameworkTemplate.LoadContent(System.Windows.DependencyObject, System.Collections.Generic.List`1<System.Windows.DependencyObject>)
   at System.Windows.StyleHelper.ApplyTemplateContent(System.Windows.UncommonField`1<System.Collections.Specialized.HybridDictionary[]>, System.Windows.DependencyObject, System.Windows.FrameworkElementFactory, Int32, System.Collections.Specialized.HybridDictionary, System.Windows.FrameworkTemplate)
   at System.Windows.FrameworkTemplate.ApplyTemplateContent(System.Windows.UncommonField`1<System.Collections.Specialized.HybridDictionary[]>, System.Windows.FrameworkElement)
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
   at System.Windows.UIElement.Measure(System.Windows.Size)
   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)
   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
   at System.Windows.UIElement.Measure(System.Windows.Size)
   at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)
   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
   at System.Windows.UIElement.Measure(System.Windows.Size)
   at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)
   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
   at System.Windows.UIElement.Measure(System.Windows.Size)
   at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)
   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)
   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
   at System.Windows.UIElement.Measure(System.Windows.Size)
   at System.Windows.Controls.DockPanel.MeasureOverride(System.Windows.Size)
   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)
   at System.Windows.UIElement.Measure(System.Windows.Size)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(System.Object)
   at System.Windows.Media.MediaContext+InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
   at System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Application.RunDispatcher(System.Object)
   at System.Windows.Application.RunInternal(System.Windows.Window)
   at System.Windows.Application.Run(System.Windows.Window)
   at BuildAllApp.App.Main()

I dont have any way of reproduce, since the program was just left hiddling during the night.

thanks and regards
jorge costa

An unhandled exception of type 'Chromium.CfxException' occurred in ChromiumFX.dll Additional information: libcfx library not found.

I recently upgraded to the latest version of Microsoft Visual Studio 2015.
I first used the template to start. But it gives me the additional dll error.

Also I downloaded the whole project and tried some of examples.
For example for ChromiumFX.Ko.UI: It builds all of the dlls (even libcfx), but still gives the following error.

An unhandled exception of type 'Chromium.CfxException' occurred in ChromiumFX.dll
Additional information: libcfx library not found.

Is there any configuration (like cpu config) or any other thing that i'm not doing? I simply downloaded and build and tried to run a project.

async find

hi @David-Desmaisons

was looking to use vue.js multiselect with async find, wonder if this would be a use case with neutronium. so like this?

asyncFind (query) {
      this.isLoading = true
      ajaxFindCountry(query).then(response => {
        this.countries = response
        this.isLoading = false
      })
    },

you can for example, issue a command and then update the view from the cs side, but this is a bit more concise way

regards

how to acess the vm from events in v1.0.0

hi @David-Desmaisons

i use this CodeMirror and i have

                editorTestCase = CodeMirror(document.getElementById("codeTestCase"), {
                    mode: "text/x-csharp",
                    extraKeys: { "Ctrl-Space": "autocomplete" },
                    lineNumbers: true,
                    value: this.ViewModel.MacroCodeInEditor
                });

                editorTestCase.on("change", function (object, data) {
                    if (data.origin === "setValue") {
                        return;
                    }
                    try {
                        this.ViewModel.SelectedFTC.SelectedMacro.Content = data.text;
                        this.ViewModel.SaveNeeded = true;
                    } catch (e) {
                    }
                });

earlier with previous we were able to access it by using
this.vm.SelectedFTC.SelectedMacro.Content = data.text;
since vm was available in all context. so to update teh editor data in c# im a bit stuck

but now ViewModel is no longer available in that context

thanks

Pack URL bug

The new pack:/// url feature seems to be buggy.

From time to time Chromium is unable to read random packed files (I run the same executable each time, without rebuilding, and sometimes it happens). For big files it happens more frequently. Add something like 30K-line javascript to reproduce it. Unexpected end of input, unexpected token, etc., each time on a random line.

capture

If I click build.js:1 to go to that line, dev tools close. The affected files are missing Sources tab. It I click Application tab, dev tools close.

Maybe the contributor @lhyqy5 knows what's wrong.

How to edit a property of an object in an ObservableCollection from Vue.js

You claim two-way binding, and this seems to work fine for simple objects in the ViewModel.

However, I can't seem to get the ViewModel to reflect changes I make in Vue.js to ObservableCollections...

Do you have an example that goes beyond just creating and removing items from an ObservableCollection?

Thanks!

some help on upgrading to 1.0.0

@David-Desmaisons hi

i now tried upgrading my application to new version, and i can no longer update the ui from the c# side. one of the things ive updated was i think related with vue 2.0 (https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function) and also window.glueHelper.setOption({ mixins: [localMixin] });

my debug log does not show anything relevant:

The thread 0x6b10 has exited with code 0 (0x0).
Neutronium - Browser Log: Message: Neutronium: ViewModel injected, source: , line number: 11183, page: file:///C:/prod/buildallextension/BuildDrop/vs17/packagemanager.html

const localMixin = {
    props: {
    },
    data: function () {
        return {
            Packages: [{ Name: "ABC", Version: "1.0.0", Invalid: false }, { Name: "ABC.redist", Version: "1.0.0", Invalid: false }],
            gridColumns: ['Name', 'Version', 'Invalid'],
            InvalidReason: "another reason",
            Versions: ["1.0"],
            searchQuery: ""
        }
    },
    methods: {
    },
    watch: {
    }
};


window.glueHelper.setOption({ mixins: [localMixin] });

Maybe unrelated issue, and likely caused by my laptop computer resolutioon but i can get rendering properly done. It was also in previous version. Also the example show similar issue. Have you come accross this:

image

image

thanks

Example using ReactiveUI

I'm using ReactiveUI for my projects and I need an example using that MVVM framework.

Thanks!

pass arguments in commands

hi David,

i have a d3 force plot, that user picks a node. Once this happens the javascript update a input html displaying the node name.

this input is hidden, and has the following data-bind

in js i set the value like this
$('#SelectedNodeId2').val(d.name);

I was expecting, that this value would be available in my view model in c#, but its not. Also if i press a command like this:

Remove skill

the RemoveSkill in C# is called but the value of the SelectedNodeId2 is not updated.

If i dont set the value from the js, and set it via the ui (when its visible), then when i can see the value after i press the command.

Is there a way of binding from a js function and from c# function so the javascript can communicate with the c# without using the html?

thanks in advance
br

jorge costa

Track Next versions

Global roadmap can be found here: https://trello.com/b/1q0TNsWv/neutronium
Note that this roadmap is susceptible to changes.

Version 1.7.0

  • Neutronium.Core
    • Support of binding to IObservable interface

Version 1.8.0

  • Neutronium.Core
    • Support of complex javascript deserialization when used as command argument (Today only basic types and object converted from C# are supported)- prototype

Chromium.CfxRemotingException

Got some Neutronium-related exceptions collected from the users.

These exceptions have 1-2 occurences across 300+ beta users.

Chromium.CfxRemotingException: Remote connection lost. ---> System.IO.EndOfStreamException: Failed to read past end of stream.
   в System.IO.BinaryReader.FillBuffer(Int32 numBytes)
   в System.IO.BinaryReader.ReadUInt16()
   в Chromium.Remote.RemoteConnection.ReadLoop()
   в Chromium.Remote.RemoteConnection.ReadLoopEntry()
   --- Конец трассировки внутреннего стека исключений ---
   в Chromium.Remote.RemoteCall.RequestExecution(RemoteConnection connection)
   в Chromium.Remote.CfrTaskRunner.PostTask(CfrTask task)
   в Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxDispatcher.RunInContext(Action action)
   в Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxWebView.Dispatch(Action act)
   в Neutronium.Core.Binding.BidirectionalMapper.DispatchInJavascriptContext(Action run)
   в Neutronium.Core.Binding.BidirectionalMapper.UpdateFromCSharpChanges(Object newCSharpObject, Func`2 updaterBuilder)
   в Neutronium.Core.Binding.BidirectionalMapper.OnCSharpPropertyChanged(Object sender, PropertyChangedEventArgs e)
   в System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   в Miner.BindableBase.OnPropertyChanged(String propertyName)
   в Miner.BindableBase.SetProperty[T](T& storage, T value, String propertyName)
   в Miner.MainViewModel.set_Visible(Boolean value)
   в Miner.MainViewModel.Hide()
   в Miner.MainWindow.OnClosing(CancelEventArgs e)
   в System.Windows.Window.WmClose()
   в System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   в System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   в MS.Win32.UnsafeNativeMethods.UnsafeSendMessage(IntPtr hWnd, WindowMessage msg, IntPtr wParam, IntPtr lParam)
   в System.Windows.Window.InternalClose(Boolean shutdown, Boolean ignoreCancel)
   в System.Windows.Application.DoShutdown()
   в System.Windows.Application.ShutdownImpl()
   в System.Windows.Application.ShutdownCallback(Object arg)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   в System.Windows.Threading.DispatcherOperation.InvokeImpl()
   в System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   в System.Windows.Threading.DispatcherOperation.Invoke()
   в System.Windows.Threading.Dispatcher.ProcessQueue()
   в System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   в System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   в MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   в System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   в System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   в System.Windows.Threading.Dispatcher.Run()
   в System.Windows.Application.RunDispatcher(Object ignore)
   в System.Windows.Application.RunInternal(Window window)
   в System.Windows.Application.Run(Window window)
   в System.Windows.Application.Run()
   в Miner.Program.Main()
Chromium.CfxRemotingException: Remote connection lost. ---> System.IO.EndOfStreamException: Failed to read past end of stream.
   в System.IO.BinaryReader.FillBuffer(Int32 numBytes)
   в System.IO.BinaryReader.ReadUInt16()
   в Chromium.Remote.RemoteConnection.ReadLoop()
   в Chromium.Remote.RemoteConnection.ReadLoopEntry()
   --- Конец трассировки внутреннего стека исключений ---
   в Chromium.Remote.RemoteCall.RequestExecution(RemoteConnection connection)
   в Chromium.Remote.CfrTaskRunner.PostTask(CfrTask task)
   в Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxDispatcher.RunInContext(Action action)
   в Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxWebView.Dispatch(Action act)
   в Neutronium.Core.Binding.BidirectionalMapper.DispatchInJavascriptContext(Action run)
   в Neutronium.Core.Binding.BidirectionalMapper.UpdateFromCSharpChanges(Object newCSharpObject, Func`2 updaterBuilder)
   в Neutronium.Core.Binding.BidirectionalMapper.OnCSharpPropertyChanged(Object sender, PropertyChangedEventArgs e)
   в System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   в Miner.BindableBase.OnPropertyChanged(String propertyName)
   в Miner.BindableBase.SetProperty[T](T& storage, T value, String propertyName)
   в Miner.MainViewModel.set_Visible(Boolean value)
   в Miner.MainViewModel.Hide()
   в Miner.MainWindow.OnClosing(CancelEventArgs e)
   в System.Windows.Window.WmClose()
   в System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   в System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   в MS.Win32.UnsafeNativeMethods.UnsafeSendMessage(IntPtr hWnd, WindowMessage msg, IntPtr wParam, IntPtr lParam)
   в System.Windows.Window.InternalClose(Boolean shutdown, Boolean ignoreCancel)
   в System.Windows.Application.DoShutdown()
   в System.Windows.Application.ShutdownImpl()
   в System.Windows.Application.ShutdownCallback(Object arg)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   в System.Windows.Threading.DispatcherOperation.InvokeImpl()
   в System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   в MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   в System.Windows.Threading.DispatcherOperation.Invoke()
   в System.Windows.Threading.Dispatcher.ProcessQueue()
   в System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   в System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   в MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   в System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   в System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   в System.Windows.Application.RunDispatcher(Object ignore)
   в System.Windows.Application.RunInternal(Window window)
   в System.Windows.Application.Run(Window window)
   в System.Windows.Application.Run()
   в Miner.Program.Main()
Chromium.CfxRemotingException: Remote connection lost. ---> System.IO.IOException: Pipe is broken.
   в System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
   в System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
   в System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   в Chromium.Remote.PipeBufferStream.Flush()
   в System.IO.BinaryWriter.Flush()
   в Chromium.Remote.RemoteCall.WriteRequest(StreamHandler h)
   в Chromium.Remote.RemoteConnection.Write(Action`1 callback)
   --- Конец трассировки внутреннего стека исключений ---
   в Chromium.Remote.RemoteCall.RequestExecution(RemoteConnection connection)
   в Chromium.Remote.CfrTaskRunner.PostTask(CfrTask task)
   в Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxDispatcher.RunInContext(Action action)
   в Neutronium.WebBrowserEngine.ChromiumFx.EngineBinding.ChromiumFxWebView.Dispatch(Action act)
   в Neutronium.Core.Binding.BidirectionalMapper.DispatchInJavascriptContext(Action run)
   в Neutronium.Core.Binding.BidirectionalMapper.UpdateFromCSharpChanges(Object newCSharpObject, Func`2 updaterBuilder)
   в Neutronium.Core.Binding.BidirectionalMapper.OnCSharpPropertyChanged(Object sender, PropertyChangedEventArgs e)
   в System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   в Miner.BindableBase.OnPropertyChanged(String propertyName)
   в Miner.MainViewModel.<>c__DisplayClass195_0.<Model_PropertyChanged>b__0()
   в System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   в System.Windows.Threading.Dispatcher.Invoke(Action callback)
   в Miner.MainViewModel.Model_PropertyChanged(Object sender, PropertyChangedEventArgs e)
   в Miner.BindableBase.OnPropertyChanged(String propertyName)
   в Miner.MainModel.OnHashrateChanged(Dictionary`2 hashrate)
   в System.Reactive.AnonymousSafeObserver`1.OnNext(T value)
   в System.Reactive.Linq.ObservableImpl.Where`1._.OnNext(TSource value)
   в System.Reactive.Concurrency.ObserveOn`1.ObserveOnSink.OnNextPosted(Object value)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   в System.Windows.Threading.DispatcherOperation.InvokeImpl()
   в System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   в MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   в System.Windows.Threading.DispatcherOperation.Invoke()
   в System.Windows.Threading.Dispatcher.ProcessQueue()
   в System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   в System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   в MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   в System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   в System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   в System.Windows.Application.RunDispatcher(Object ignore)
   в System.Windows.Application.RunInternal(Window window)
   в System.Windows.Application.Run(Window window)
   в System.Windows.Application.Run()
   в Miner.Program.Main()

Vue Router

Can i use the vue-router for simply switching multiple pages/views?

npm install vue-materail removes 637 packages

When using the Neutronium-Vue project template...

[...]\View\Main>npm install vue-material
+ [email protected]
removed 637 packages and updated 1 package in 35.528s

I've used npm before, this is certainly not expected behavior (seriously violates principle of least astonishment). I'm assuming this has something to do with how the template is packaged. Please provide some guidance on the proper way to include extra node packages without destroying everything. Thanks!

Vue.js as SPA?

Hi David.

First let me say you've done a great job developing and maintaining this project.

Now, how would one best implement a SPA solution with Neutronium?
It feels a bit illogical to have a separate VueJS project for each view instead of one vue project to handle all views especially since vue can handle routing perfectly well.

However, one would not want to forego the ViewModels aswell, so is there a way to implement a single vue-project where perhaps vue handles routing but triggers Neutronium to swap ViewModel?

Or maybe you see something else as a better solution?

Cross Platform?

Is this project cross platform (Win, Lin and Mac)? Or windows only?

Complex View with shared components example

Hi David,

Is it possible to provide an example for a sample project with two different views (similar to the navigation example), that share a single component and interact with the same data.

For instance, Page 1 & Page 2 share the same Menu which is included in the top of each page.

When clicked on a menu item, the page is loaded and the menu is updated to highlight the clicked item. On page 1 could be a list of Persons and on Page 2 you could add a Person.

The examples so far show how to do the single parts, but not how to combine these things without copy & pasting for instance the menu for each page. But maybe I am missing the point ? In the real world it is unmanagable to have two header menus and keep them the same across multiple files. Specifically when there is much more complex data, than just "menu items".

How to fire some javascript code from the c# side

hi @David-Desmaisons

trying to have my application detecting some change in the view, after the view model has changed its state. tried a simple without any bindings to the view model. it gets triggered outside the neutronium application however it does not when running inside it.

Is this expected?

What i want basically is to fire some javascript code from the c# side, so that i don't need to have so many bindings between the view and the model. So be good to have some logic in the client side.

Can that be done? thanks

regards
Jorge Costa

Chromium doesnt allows Cross-Origin-Request

Hallo,
i tried to use the library to make a request with javascript but chromium prevents my Request.

XMLHttpRequest cannot load https://WEBSITE.net/echo/negotiate?clientProtocol=1.5&_=1481228307020. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

For a simillar reason i wasnt able to get the Dom inside of an iframe. In CefSharp it seems to be deactivated and with a setting this seems to be possible like:

chromium-browser --disable-web-security --user-data-dir
http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome

Neutronium is very convenient compact so where can i deactivate this restriction in my chromium app?
thanks in regards

Unexpected error

I'm opening here to continue the discussion started in mvvmawesomium issue.

I have already tried using ChromiumFX and CefGlue, and got the same error in both, I tried ChromiumFX first, now I'm trying CefGlue.
The exception is throwed inside
InjectInHtmlSession of the class BidirectionalMapper.

Do you have any idea of what could be ?

Thanks !

Neutronium - Info: Unable to convert javascript object

Hi @David-Desmaisons

i get these messages, but have no idea where those are created. Is it possible to include line number and file where this occurs?

Neutronium - Info: Unable to convert javascript object: Neutronium.WebBrowserEngine.ChromiumFx.V8Object.ChromiumFXJavascriptObject to C# session. Value will be default to null. Please check javascript bindings.
Neutronium - Error - Unable to update ViewModel from View, exception raised: Unable to convert javascript object: Neutronium.WebBrowserEngine.ChromiumFx.V8Object.ChromiumFXJavascriptObject to C# session. Value will be default to null. Please check javascript bindings.

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.