search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Desktop app

Related article: DayPilot in a Desktop Application (WinForms)
Asked by Anonymous
7 years ago.

Can the JavaScript version DayPilot be used embedded in an winform app in order to avoid the webserver component?

Answer posted by Dan Letecky [DayPilot]
7 years ago.

Yes, it's possible.

You'll need to replace the browser-server communication with direct API calls.

1. For calling JavaScript functions from the WebForms application use WebBrowser.Document.InvokeScript(). Note that you can only call global JavaScript functions this way so you will need to wrap the method calls in special global functions or use "eval".

http://stackoverflow.com/questions/7322420/calling-javascript-object-method-using-webbrowser-document-invokescript

You will need InvokeScript to send data (events) to the controls and to invoke specfic actions (switching a date, changing config, reloading data, etc.)

2. For calling C#/VB methods from within the HTML page use ObjectForScipting property and you will be able to access that object using window.external object from JavaScript.

http://stackoverflow.com/questions/3694028/invoke-c-sharp-code-from-javascript-in-a-document-in-a-webbrowser

You will need window.external object to handle the JavaScript events (drag and drop, etc.).

See also:
https://msdn.microsoft.com/en-us/library/a0746166.aspx

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.