How to add context menu to Silverlight tree items? - c#

I want to have context menus attached to tree items in my Silverlight Toolkit tree. How can I do this?

Right click support is only supported via Javascript, so the vendor route is a good way to go.
Curtisk's suggestion of the Telerik control is a good choice, but this can be tricky to implement first time - if you go this route make sure you pay a few extra pounds for their support - the documentation is lousy.
Have you considered any alternatives to context menus? At the moment I am working on project porting a thick client application to Silverlight. We had a lot of right click context in the thick app, and after consulting with Microsoft's UX team and also looking at the examples on Quince UX we decided to implement our context menus in a permanent task based menu on the right hand side of our screen. Implementation is a doodle with binding and, most importantly, our users have received this well :-)

One way is vendor provided.....
Telerik has RADControls for Silverlight, the contextmenu control can be attached to tree views.
http://www.telerik.com/products/silverlight.aspx
and
http://www.telerik.com/products/silverlight/contextmenu.aspx
for more details and demo with tree

Related

Editing the Elsa Dashboard & Designer

I'm currently working on a project which aims to deliver a "low-code" solution for integrating workflows. I'm very impressed by Elsa since it already comes with a lot of functionality that I was looking for.
Since the projcet goes into the direction of "low-code" the center of user Interaction will be the Dashboard/Designer.
I was wondering if it's possible to modify the components the designer uses? E.g. I'd like to integrate a Component that let's the user define the Workflow-Name and other input parameters when the "Create Workflow"-Button is clicked or remove existing activites or edit the toolbox in general.
I know that the components that are used by default are defined here
<body>
<elsa-studio-root server-url="#serverUrl" monaco-lib-path="_content/Elsa.Designer.Components.Web/monaco-editor/min">
<elsa-studio-dashboard/>
</elsa-studio-root>
</body>
But I don't know where to find the monaco-lib-path neither if I'm able to edit what I'll find there. I'm very new to ASP.NET and web development in genereal, so I'll be very thankful if somebody can help me.
Currently, there are not that many features to facilitate UI customization, there are some capabilities for customizing activities like their icons as described here.
In Elsa Roadmap V3.0
there's an item to make the dashboard modular & themeable. But until its implementation, you have the option to fork the designer which is developed using stenciljs, and make your desired changes, or even create your UI from scratch and just consume the Elsa API.

Page, Frame, Navigation windows in C# WPF

I would like to know the difference between page, frame, navigation windows in c# wpf
what is the best choice of them for wpf windows application?
in my application how to make fixed part (contain main buttons) and changeable part (show pages) after clicking buttons in fixed part
are there any good websites provides video tutorials for c# wpf from beginning to professional?
thank you
A Page is much like a user control, only that is is displayed within a Frame, which again is part of a NavigationWindow. A NavigationWindow is a special kind of window that allows for page navigation and can display the respective controls for navigating pages.
A paged application is a good choice if you want Wizard-like functionality, or if the user experience should be comparable to what you get when browsing the web. In many cases, using standard WPF windows is a better choice.
The NavigationWindow already contains a "fixed part" that can contain controls. You can also use a normal window, place a Frame in it and then - through proper layout - create your own "fixed parts". Navigation would then come down to calling the navigation methods the Frame provides.
From the answer to this question:
Pages are intended for use in navigation applications (usually with back and forward buttons, e.g. Internet Explorer). Pages must be hosted in a NavigationWindow or a Frame
The best choice depends on what kind of application you want to create. Is it a wizard or navigation type application or just a regular application with one window (maybe with tabs)?
I would definitely consider using a MVVM framework like Caliburn.Micro for making a WPF application. It has some really powerful mechanisms for dealing with Screens, Conductors and Composition, in addition to encouraging you to decouple your application by using the MVVM pattern. The author of Caliburn.Micro, Rob Eisenberg, has written some tutorials with extensive explanation about and how to use the framework under the project's documentation. There is also lots of resources around the interwebz, google it! :)
I can also recommend Pluralsight's WPF and XAML Fundamentals and WPF Advanced Topics, they should cover what whatever is worth knowing about WPF :)

What are things/points to keep in mind while developing a reusable custom control?

Windows Form (in C#) - I need to create a custom listbox control for the following requirement:
There is a listbox with a long list of items. I want the user to be able to click in the list, and then start typing and have it automatically take them to the matching item (I call this "type ahead"). It needs to be able to do this for as many characters as they type that have a match.
This control should be really reusable without much changes.
What are things/points I should keep in mind while developing a reusable custom control? (if you provide a good pattern as a sample... will be more helpful)
In Real World scenario the first decision should be buy vs build. if your application is a serious one and not just for hobby and there is budget for it I would check some of those great controls collections like DevExpress or Telerik for WinForms. You would need a grid as well at some point, eventually, and surely your custom or framework one cannot compete theirs.
I refer to those libraries because i believe they already have a listbox with autocomplete as you described in your requirements. check the online demos on their websites...

Developing wizard UI - WPF

All in WPF:
Developing a wizard application, user has to answer a number of simple questions before brought to the main app. The main app is then prefilled with the information obtained from the wizard.
I started with a Window which I then planned to add usercontrols to. The main window would have the user control in the first row, then Next and Previous buttons to control moving between the controls in the second row. This way I could easily control the logic to switch between screens like:
WizardControl1.IsVisible = false;
WizardControl2.IsVisible = true;
But for some reason, user controls do not have setter for IsVisible. Hurray.
So then I thought I would just use seperate windows for each section of the wizard. The problem with this approach is that now when stepping between, the window opens in random positions, and by steppign through the wizard with next, the next window pops up randomly which is really distracting and frustrating.
So how can I develop a wizard properly? I don't get why this is so hard...not exactly rocket science... replacing text and controls and storing input after pressing next/previous!
Thanks
Check this link:
http://www.codeproject.com/KB/WPF/InternationalizedWizard.aspx
This is the article about building wizard in WPF by Josh Smith, it's seems to be nice pattern.
I found it's helpful for me, hope you'll too.
There is also an open source Avalon Wizard control on codeplex.
I'd probably aproach this using data binding and template selectors. Have the wizard form bind to a "WizardData" class, which exposes a list of "WizardPage" base classes.
The WizardData class can expose properties defining the correct info on the forms, and display a control for the main page that uses a template selector to determine the proper control to display based on the actual type of the particular wizard page.
It sounds like more work than it is, really. It also gives you the benefit of good separation between code and UI (all "work" is done by the WizardData and WizardPage classes), and the ability to test logic independent of the UI.
It's also a very WPF/MVVM way of approaching the problem.
I recognize this does not directly address your question, but I thought I'd mention it as a possible alternative. I've used Actipro's Wizard control with pretty good results, and when I have needed support, they have been very responsive. I am not affiliated with them in any way; I just like not having to write the plumbing to manage a wizard.
The property is called "Visibility".
I find that I do better when I dynamically add and removing controls rather than hide them.
I was looking for a Wizard solution too. I have the need to stick with stock WPF components so I implemented the wizard using a standard form and a tab control.
I only hide the tabs at runtime so there available in the IDE. At runtime just use Back, Next, Finish... to navigate thru the tab items
works good

Ajax type controls for .NET winforms

Are there any 3rd part WinForms controls out there that give me ajax type effects.
For example I want an effect where if I have a list box or a DataGrid control and someone clicks a field to mark it as complete I want that field to fade away not just instantly disappear.
The standard controls get the job done but are not the best looking.
I hope that came accross clear.
Have a look at WPF (Windows Presentation Foundation). This is Microsoft's new framework for developing graphically rich user interfaces, and would in fact be capable of a lot fancier effects than you see with AJAX.
WPF is a radically different technology to its predecessor WinForms, but it's well worth the time spent learning!
There are pleny of third party controls..
DevExpress - http://www.devexpress.com/
Telerik - http://www.telerik.com/
Component Factory - https://github.com/ComponentFactory/Krypton
Infragistics NetAdvantage - http://www.infragistics.com/
ComponentOne - http://www.componentone.com/

Categories