Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

implement draggable ui like blockly

Tags:

c#

wpf

I'm currently developing an application that allow the user to program some scripts. I've developed a "compiler" to analyse the script made by the user, but now i want create a visual editor with all the possibilities that the user have, something similar to this: Blockly - A visual programming editor .

I am currently using C# and I have no idea how to develop something like the above. I thought about doing my own draggable UI on top of my DSL, but not sure how to start.

Thanks

like image 354
user1845593 Avatar asked Nov 27 '22 08:11

user1845593


1 Answers

For other Wpf developers trying to do something similar, I would not recommend doing this yourself but actually use a webpage within Wpf and then communicate with Blockly through that. I promise you that this will be a lot easier than actually trying to do this yourself.

Use Blockly inside a WebBrowser

If you don't feel like recreating all your script generation code you could also create a custom xml generator for Blockly and then just print out which blocks are connected so like :

<block>
   <whileblock repeat="20"/>
<block/>

Then decipher this and generate your script from c# depending on the connected blocks.

like image 170
Lloyd Avatar answered Dec 21 '22 23:12

Lloyd