• .NET

    RadioButton and CheckBox Menu Items with RadMenu for Silverlight

    RadMenu for Silverlight supports simple checkable items, but still does not support radio button items. This feature is scheduled for development and most probably will come with Q3 2009, but until then you have to code it by yourself. Fortunately, this is relatively easy with a proper ViewModel, that contains the radio-button logic: The CommandItem class contains the properties and the logic for a RadMenuItem. It implements INotifyPropertyChanged and its most important property is IsChecked: public bool IsChecked { get { return this.isChecked; } set ...
    June 19, 2009
  • .NET

    Scrollable Menu – Workaround with a Multi-Column Menu and RadControls for Silverlight

    RadMenu and RadContextMenu for Silverlight cannot automatically scroll their items if their height exceeds a certain height. We are planning to implement this feature in the near future, but at the moment there are two workarounds for the developers: override the RadMenu control template and add ScrollViewer controls around the ItemsPresenters, or customize the ItemsPanel of the RadMenuItem controls, so the sub-items are displayed in columns. The second option is much easier and looks good enough: The main idea is to replace the RadMenuItem ItemsPanel, that is a StackPanel by default, with a WrapPanel. To set the ItemsPanel property of all...
    June 18, 2009
  • .NET

    Data-binding menu, context menu and toolbar, a.k.a. a simple text editor for Silverlight

    This demo extends my previous sample, that demonstrated how to add a right click context menu on a TextBox. Here I will show how to create context sensitive main menu and toolbar, in addition to the context menu. The demo will also demonstrate some advanced enhancements that we added to the Silverlight 2 Framework, such as merged dictionaries and container bindings. The application enables/disables the Cut and Copy commands when there is no selection and also disables the Paste command when there is no clipboard content. As in the previous blog post, the clipboard methods work only in IE. Here is how...