Silverlight 5 - designing an editor (drag and drop)? - silverlight

I am currently looking to build a workflow editor in Silverlight that will allow user to drag and drop couple of objects from toolbox and draw them on canvas, connect it with connectors - pretty much like a flow chart designer.
I have gone through Silverlight Toolkit and some other links on the web, but not really sure how would I accomplish this.
Is there any built-in functionality in Silverlight, or do I need to use any external libraries for proper drag and drop?
How good is Silverlight in drawing custom shapes?
For reference, check "SilverDiagram": http://www.silverdiagram.net/Projects/SilverDiagram.aspx
Appreciate some quick & real help in this regard.
Thanks!

1.Is there any built-in functionality in Silverlight, or do I need to use any external libraries for proper drag and drop?
There is no built in functionality to develop drag and drop in Silverlight. It is always better to develop your own. It is not that difficult.
2.How good is Silverlight in drawing custom shapes?
Silverlight is your excellent friend in drawing custom shapes. But you need to adapt your thinking you are coming from conventional way of GUI programming like WinForms.

Related

Need guidance on whether to use Telerik WPF controls or Caliburn Micro or both

Not sure if this an appropriate forum for this, but I need some guidance from those who are further down the road than I am with WPF.
I've used Telerik Winform controls for a years and have mixed feelings about them. They look good, but they are deeply nested, have a steep learning curve, and sometimes don't perform the best. For example, just working with a RadWindow in the WPF designer, it's slow compared with native wpf controls.
I like Caliburn.Micro MVVM framework and MahApps metro styles, but to keep the same look and feel for a ribbon bar I'd need to use another third party tool (like Fluent) or just use the Microsoft Ribbon View control and figure out how to use templates and styles myself (or find an existing metro template for it).
I tried to combine Telerik and Caliburn but had trouble getting them to work. There is a Caliburn Telerik library but its based on Caliburn Micro 1.5.2 and I'm trying to use Caliburn.Micro 2.0.2. Problem is I always get an aero-looking full window title bar and frame wrapped around the Telerik styled window.
I just don't know enough about conventions and such to make it all work together. And frankly, not sure it's worth the trouble. I'm looking for a more streamlined approach that lessens my dependence on pricy and heavy third party controls.
So, I'm looking for guidance on whether I should use straight Telerik, straight caliburn or go through the work of trying to get them to work together.
What I would prefer is to use Caliburn as the mvvm framework with a layer of styling, like what MahhAps provides. And for those controls that aren't styled, like the Ribbon Bar, to either use Microsoft's ribbon bar and find templates and styles that would work or maybe a 3rd party control like Fluent. But would I be getting in over my head in trying to learn templates and styles?
Sorry for the ramble, but I'm frustrated and need some help in working through this. Thanks.
I found a great resource that maybe others new to WPF and struggling with similar questions would benefit from: MarkPad, a Code52 project on CodePlex.
It's written in WPF using Caliburn Micro MVVM framework (although it's version 1.5.2 rather than the current 2.0) and MahApps metro styles with some "roll your own" windows. It's a great looking app with the kind of simple menuing system I was looking for AND an MDI implementation. It's also a good example on how to organize a somewhat complex WPF application, something I was also unsure about.
It answers the question: Do I need to use Telerik? The answer is a definite NO. It's a great learning tool for me and maybe will be useful to others.

dragable controls in runtime Similar to a toolbox in wpf

I want to create a project in WPF for designing a custom report.
For this, I need a library to add controls to a panel, canvas, etc. with drag and drop at runtime.
Controls should be resizable and moveable with the mouse. Finally I want to print this.
Telerik's WPF controls contain the Diagram Control which supports the features you mention out of the box. I use it for a very similar scenario as you describe and it works well. The might be a counterpart offered by Infragistics as well.
With .NET framework's built in features and/or free libraries you will able to cover the drag&drop part. You will have to implement the rest yourself which is possible but too much to ask for one question.
Late reply, but I came across this. Take a look at this
There are 4 parts that show how to do a toolbox with what you're looking for.

Visual Studios Controls

Is there a way to download more controls or anything, because I have seen a few things in other programs I don't think I've seen in the toolbox. Can you download new ones, or did the company somehow custom make a control? If it was custom made, are there any tutorials I can take a look at that tell how to make your own?
Some companies make third party controls for Winforms - Telerik is one I know of.
Personally, I prefer to make my own controls based on the existing WinForms ones, as I have more control over them - this prevents my products from having bugs which just can't be fixed. I can also tweak the controls to do exactly what I need, rather than choosing a closest match. Building custom controls is relatively easy if you have the experience.
There is a basic tutorial on CodeProject which shows how to create a fancy Button. After that you should be able to figure out how to customize more complex controls.
Side-note:
While it's reasonably easy to develop custom controls in WinForms if you have the time to practice, WPF is a much better framework for building custom controls. WPF controls are designed specifically for customization, so there is a lot more flexibility.

Why do WPF apps look like web pages?

I apologize for my newbie question by why do WPF apps look like web pages?
I am new to gui and still shopping for a book to learn gui programming. The push seems to be in the direction of WPF but all the screenshots of WPF applications that I've seen look like cheap web pages. Frankly I'd be ashamed to sell an app that looked like a web page.
I realize that WPF is built on XML technology but can you not build normal looking WPF apps in Visual Studio (via button("widget")) drag-n-drop? In other words an app that does not look like a web page?
How can WPF be a replacement for WinForms or the like when it doesn't provide the same standard application look?
The default look of WPF applications is admittedly rather simple, but WPF allows unprecedented control over how your application looks.
Here are some examples, all of them WPF applications.
If you are to deveop an application under .net and are able to target .net 3.5 or above, you will want to use wpf. If you don't know much about ui technology and want to work with .net, understanding windows forms is useful but not necessary. You should learn wpf regardless.
2 perks that I have found while using the framework:
- it is very easy to inject branding and custom interactivity into your app. It is then very easy to change these when your sales guy decides the want it blue, not red.
- the way components are organized on screen is relational like a webpage, not coordinate based like windows forms. This is ideal for scenarios when translated strings will change length (English to German for example). Under usual circumstances the ui will resize itself automatically at runtime to make it all fit.
If you just throw in controls and don't change the style of anything, your first wpf applications will look almost identical to native win32 applications. It is very easy to change this, but you will achieve great results regardless of the "look" you choose. Microsoft also provide the tools to create new ui components that look like native buttons. There are a host of other features that will make you grin while learning!
This is not a technical note, but at the moment wpf is a highly sellable skill and looks great on a cv! Companies want great branding in their apps. Wpf helps that happen.
WPF does provide the same appication look wich is the default look. When you drag and drop your controls onto the design surface (just like in windows forms, MFC ...) the controls look as you would expect them to look under the current theme. Chances are that you have seen quite some WPF applications without noticing. Just because they look like any other app.
The reason you might see more WPF based applications that have some sort of custom look and feel to them is simple because it is so much easier to do what ever you like to your GUI than in any other GUI framework on any platform. This is both blessing and curse. While you being absolutely flexible it is easy to do absolutely horrible stuff.
user440267, I believe that the most application in WPF are built using normal Windows. But there is an option which we don't create a window, instead we create a page, which behave like you think.

Coded UI Test - get my custom object (WinForms)?

I want to create an automated UI test that will test my syncfusion grid. My problem is that the recorder can't recognize this control (or any syncfusion control). I've searched a lot in the internet but I couldn't find any extension so the recorder will recognize my controls (I'm using WinForms, not WPF!), or at least a way to extend the recorder abilities so syncfusion's controls will be recognized somehow.
Is there any easy way to extend the recorder? Or is there any extension available?
Or maybe can I get the grid object from the WinClient that the recorder generates?
Thanks!
Start your program. Run the Spy++ utility. Type Ctrl+F to start the finder tool and drag the bulls-eye onto your form. Ok, Synchronize and have a look-see at the windows that are visible in the tree. If you see regular Windows Forms controls, like a Button or a Label, but not any of the SyncFusion controls then you've probably found the source of the problem.
Component vendors that try to improve .NET controls typically do so by creating 'window-less' controls. They are not really controls, they don't derive from the Control class and don't have a Handle property. They use the surface of the parent to draw themselves, making them look just like controls. The .NET ToolStripItem classes do this. And this is also the approach WPF uses.
The big advantage is that they render quickly and support all kinds of effects that regular controls can't support, like transparency, rotation and anti-aliased window edges. The big disadvantage is that the kind of tool that you are using suddenly gets noddy and can't find the control back. Because they work by finding the Windows window back on your form, there is no window for them.
This is a hard problem to solve, the 'control' exists only in memory and there's no good way for a tool to find it back. Using Accessibility is about the only other way for such a tool to find a control that I can think of. Which would have to be implemented by the control vendor first, a somewhat obscure feature that gets easily overlooked. You really do need the help of the vendor to find a workaround for this. Shouldn't be a problem, that's why you paid them the big money.
This is Rajadurai from Syncfusion. Thank you for your interest in Syncfusion Products. To make UI Test Automation recognize Syncfusion grids(WinForms), some internal support need to be provided in grid whose implementation is in progress and about to be completed. Please submit an incident through Direct-Trac for any further related inquiries in the following link.
http://www.syncfusion.com/Account/Logon?ReturnUrl=%2fsupport%2fdirecttrac
You can also contact us through support#syncfusion.com. We are happy to assist you.
Regards,
Rajadurai

Resources