Editable midi editor in UWP - c#

I'm looking to make a midi editor for UWP (in c#). I've got many plans but I'm lost on exactly how to display it. What is a good UI control to start with for displaying my notes (sort of like Garage Band). I'm making my own UserControl but I don't know if I should go fancy with grids, or use a canvas in front of some form for displaying it.

Using grid might be simpler at first, but if you want to make complex custom UI it's better to write it from scratch.
For this I recommend Win2d which makes it very easy to draw custom interface in your app.

Related

Embed button control into existing Direct3D application

I would like to overlay own content above a Direct3D v9 game (made by a third party).
Overlay Interactive Button
Specifically, I would like to overlay a clickable button control, like Steam does, for instance, though I'm attempting a much simpler interface.
Ideally, I would be able to overlay a WPF button or a Windows Form button or whole UserControl, but if that is not possible then creating a functioning button from primitives would suffice as well.
Text Overlay Working with SharpDX
I have a working sample of overlaying text based on the work of Justin Stenning
Namely with the help of SharpDX.Direct3D9.Font DrawText method
How to Overlay a Button or UserControl with SharpDX
I looked through relevant samples in https://github.com/sharpdx/SharpDX-Samples but was not able to find a way to include or draw native controls with SharpDX
Is it possible?
If not, are there any samples of drawing a clickable button from scratch?
Please bear in mind I'm a novice in the DirectX world :)
Your biggest problem isn't going to be getting the controls to render on top of a DX scene; it's going to be getting them to respond to input afterwards. You can probably rig up a way to get the visuals copied to a DX surface, but I have no idea how you would capture input, translate it, and deliver it back to the WPF components. If it's even possible, it's almost certainly more trouble than it's worth.
There are a couple game-oriented Xaml solutions out there that you may want to check out. WPF for Games is a partial C++ implementation of WPF based on Direct3D, and there's also the proprietary Noesis GUI.

implement draggable ui like blockly

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
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.
Blockly is open source, so feel free to use it for your editor. You don't really need to know much JavaScript in order to use the Blockly libraries, and there's a support group.
You can do it with WPF.
Using Drag and Drop you can get real closer.
Watching this video will help you get sense hou this mechanism works.
Try improving it slowly and playing with it.
2nd step will be to play with lists and drag and drop
Like shown here .
Improve it even more by using data you get from your mouse position,
a good way to do it demonstrated here.

Language and Approach to a Drag-and-Drop Drawing Area for a new CAD GUI?

I'm trying to make a new CAD program from scratch. The GUI is mostly easy to make in C#; it's just dragging-and-dropping things like command buttons and writing their associated code.
However I want the user of my CAD to be able to drag-and-drop icons from a toolbar onto a drawing pane. I also want them to be able to resize those icons, draw connections between them, etc. And I don't know how to do this part.
After doing a good bit of research, I'm still lost on what approach I should take for it. It's basically a 2D flowsheet, so do I need hardware acceleration? Do I make C# bitmaps and just print those after modifications on mouse events? Etc.
What should I study to learn how to do this?
Thank you!
You probably need to work with WPF. You might find these articles useful
A Beginners Guide to
WPF
A Guided Tour of WPF
Drag and Drop
Drag and Drop in WPF
WPF Drag and Drop Smorgasbord
Drag And Drop in WPF Explained (an end-to-end explanation)
WPF Diagram Designer
These were the ones that help me while I was going to do something similar. Hope they will be useful to you.

C# Rich GUI Application

I want to create an app to declare microprocessor's pin as input/output with mouse clicks. I created a mockup - http://i.stack.imgur.com/GOHQ5.png. I think it would be best to declare each pin as an separate class so I can change its state easily, but I dont know how to achieve that along with graphical representation of it. Each square should be clickable and changin its color. Then foreach loop to iterate throu them and get state information of each.Should I go with WPF or Silverlight or just simple click events? What is the best approach to implement that in .NET?
If you want a website, do Silverlight. Otherwise do WPF because it will be easier.
I'd just do an image for the center piece, unless it's going to change size, in which case you could just draw it out of lines and an ellipse. Use a Canvas in your main window, not a grid. Make a Pin class that handles the state/color/positioning information. You can draw the square with a Rectangle.
Don't worry about MVVM, that's going to be more trouble than it's worth for your case.
Silverlight or WPF doesn't make much of a difference in this case. Deployment of the application (web or not) might help you chose.
Implement the state machine/processor as a class (ViewModel) and implement the UI as a View. That will help to keep the code clean. Look up MVVM Model-View-ViewModel.
You could do this in WPF, Silverlight or Winforms.
From a graphical perspective, it might be easier to reproduce your mockup in WPF or Silverlight. Choosing between WPF and Silverlight really comes down to how you want to deploy the app (eg for SL you need a web server).
Make your choice, start writing code and then come back here with specific issues as you encounter them.
Good Luck.

What to use for C# SlimDX Game UI

I am currently developing a 3d game using C#/SlimDX (The target is Direct3D 9). I've been looking for a suitable Game UI toolkit for a while, but I was unable to make up my mind.
The Game UI will be for a roleplaying game, so it'll be fairly complex and will involve quite a few controls (text boxes, inventory grids, list boxes, select boxes, scrollable areas, etc.).
I previously (When i was still using C++/OpenGL) looked at GameSWF and very much liked the idea, but for my current game it's out of the question.
Does anyone know a good GUI toolkit for use with SlimDX?
I would be especially interested in using WPF/Silverlight for this, since there are good IDEs available for both. But a quick google search didn't reveal any information on embedding these.
You can use WPF (but not Silverlight) for this.
The way to go about this is to use SlimDX in conjunction with D3DImage. You then let WPF handle all of your final composition, including overlaying the WPF UI over the top of your SlimDX scene.
SlimDX basically just renders to a brush in this situation, which can be used on any WPF element. (This doesn't work for Silverlight, as Sliverlight doesn't support D3DImage.)

Categories

Resources