The One With

June 2014 - Posts

  • WinForms Outlook Navigation Bar

    You might have already seen the new Outlook Navigation Bar control when looking over DevAV sample.

    Outlook Navigation Bar

    If you have not had the change, you can find the installed sample with your DXperience Installation in this folder:

    C:\Users\Public\Documents\DevExpress Demos 14.1\Components\WinForms\DevExpress.OutlookInspiredApp.Win

    Besides navigation, the Outlook Navigation Bar has a feature to display a preview form, or as we call it a Peek Form, as soon as the mouse is hovered over a bar item. To implement this, you simply need to assign a control that you want to display in the QueryPeekFormContent event, like so:

    CustomersPeek _CustomersPeek;

     

    private void OfficeNavigationBar_QueryPeekFormContent(object sender, QueryPeekFormContentEventArgs e) {

        if (_CustomersPeek == null) {

            _CustomersPeek = new CustomersPeek();

        }

     

        e.Control = _CustomersPeek;

    }

     

    PeekForm

    You can download this little sample here

    Cheers

    Azret

  • WinForms Transition Manager (New in v14.1)

    Among many new controls and features in v14.1, we have also introduced a new non visual component, a Transition Manager. A Transition Manager takes care of animations when switching from one UI view to the next. What's cool is that not only views could be animated, but also anything that changes a visual state.

    For instance, suppose we want to change the background of a container:

    To animate this change, simply wrap the code you had before inside a transaction, like so:

    private void colorPickEdit_EditValueChanged(object sender, EventArgs e) {
        if (transitionManager1.IsTransaction) {
            transitionManager1.EndTransition();
        }
    
        transitionManager1.StartTransition(containerPanel);
        try {
    
            containerPanel.BackColor = colorPickEdit.Color;
    
        } finally {
            transitionManager1.EndTransition();
        }
    }

    Similarly, if for instance we want to navigate from a view of Customers to a view of Employees:

    T Find<T>(Control container) where T : Control {
        for (int i = 0; i < container.Controls.Count; i++) {
            if (container.Controls[i] is T) {
                return (T)container.Controls[i];
            }
        }
        return null;
    }
    
    void ChangeView<T>() where T : Control, new()  {
        if (transitionManager1.IsTransaction) {
            transitionManager1.EndTransition();
        }
                
        transitionManager1.StartTransition(containerPanel);
        try {
                    
            T find = Find<T>(containerPanel);
            if (find != null) {
                find.BringToFront();
            } else {
                find = new T();
                find.Parent = containerPanel;
                find.Dock = DockStyle.Fill;
                find.BringToFront();
            }
    
        } finally {
            transitionManager1.EndTransition();
        }
    }


    To try this for yourself: Download Sample


    Cheers,

    Azret




LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners