Blogs

SilverVlad

January 2011 - Posts

  • Silverlight/WPF Layout Control: Full Runtime Customization (Coming in v2010.2.5)

         

    In the initial release of DXperience v2010 vol 2 we provided the ability to hide/show items in LayoutControl through the Available Items support. In the v2010.2.5 update we will add the full runtime customization capabilities to LayoutControl. Let’s look at them in detail.

    Item Renaming

    When LayoutControl.AllowItemRenamingDuringCustomization option is set (True by default), the end-user can change the label of LayoutItem or header of LayoutGroup. This is accomplished with the help of a new button and editor in the customization toolbar:

    Silverlight WPF Layout Control Customization Toolbar 1   Silverlight WPF Layout Control Customization Toolbar 2

    Of course any LayoutGroup’s header can be changed in the same way:

    LayoutGroup.View = GroupBox

    Silverlight WPF Layout Control Customization Toolbar 3

    LayoutGroup.View = Group (presented as a tab)

    Silverlight WPF Layout Control Customization Toolbar 4

    LayoutGroup.View = Tabs

    Silverlight WPF Layout Control Customization Toolbar 5

    The header of the group from the last image (tab container) is not visible in the layout control, but it’s shown in the available items list when this group is moved there.

    New Items

    Previously your end-users could not create new groups – they could only use the ones you’ve created for them. From v2010.2.5 onwards, with the help of the new LayoutControl.AllowNewItemsDuringCustomization property (it’s True by default and requires LayoutControl.AllowAvailableItemsDuringCustomization), your end-users will be able to create the groups they need and be more flexible with the layout they are building. They will be able to create a new group that is represented visually as a group box or a tab container just by dragging an item from the available items list:

    Silverlight WPF Layout Control Drag And Drop

    A new tab in a tab container can be created using the customization toolbar:

    Silverlight WPF Layout Control Customization Toolbar 6   Silverlight WPF Layout Control Customization Toolbar 7

    A new group can be customized with the help of the LayoutControl.InitNewElement event. For example, you can make any new group of the GroupBox type collapsible:

    private void LC_InitNewElement(object sender, LayoutControlInitNewElementEventArgs e) {
        var group = e.Element as LayoutGroup;
        if (group != null & group.View == LayoutGroupView.GroupBox)
            group.IsCollapsible = true;
    }

    Item Moving

    You can change the position of any item within a layout control via drag & drop. However, for the layout groups that are presented as tabs, we added two new buttons to the customization toolbar that allow the end-user to move tabs forward/backward:

    Silverlight WPF Layout Control Tab Moving

    Of course these buttons work for any other item too so, if you just want to change the order of the items within a group, they might be helpful.

    Item Deletion

    Once your end-users can create new groups, they might need to delete some of them later. They’ll be able to do this too - they just need to remove such groups from the layout to the available items list and then use the delete button shown for every user-defined group:

    Silverlight WPF Layout Control Item Deletion

    Note that any non-user-defined children of the deleted group will be moved to the available items list (they cannot be deleted).

    XML persistence

    XML persistence mechanism has also been updated to support all these new features so no user customizations will be lost.

    We think this updated LayoutControl will give your end-users almost endless freedom to customize the layout of your applications to suit their needs. If you have any feedback on the new functionality please add your comment on this blog post or write to me directly at vlad@devexpress.com.

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.