locked
UI_CONTEXTAVAILABILITY does not return the correct value RRS feed

  • Question

  • Hi there,

    I have encountered an issue with the Windows Ribbon Framework UI_CONTEXTAVAILABILITY property. This property should indicate whether a Contextual Tab is [Active, Available, Not available], see here

    My problem is that the property will only return two states instead of the three states which are defined in the enumeration. That makes it impossible to determine if a contextual tab is actually active or not.

    This was tested using the "ContextualTabs" sample of the "Windows Ribbon for WinForms" project on CodePlex as well as using a Delphi application using the "Windows Ribbon Framework for Delphi".

    C# Code:

            private void button1_Click(object sender, EventArgs e)
            {
                string msg = "Unknown";
                switch (_tabGroupTableTools.ContextAvailable)
                {
                    case ContextAvailability.NotAvailable: msg = "NotAvailable"; break;
                    case ContextAvailability.Available: msg = "Available"; break;
                    case ContextAvailability.Active: msg = "Active"; break;
                }
                MessageBox.Show(msg);
            }

    Delphi Code:

    procedure TForm1.Button2Click(Sender: TObject);
    var
      msg:string;
    begin
      case (Self.Ribbon.Commands[SampleConTab] as TUICommandContext).Availability of
        caNotAvailable: msg := 'NotAvailable';
        caAvailable:    msg := 'Available';
        caActive:       msg := 'Active';
      end;
      ShowMessage( msg );
    end;

    In both cases, the framework did only provide two of the three defined enumeration values. In combination with the fact (correct me if I'm wrong) that the framework doesn't provide the information which tab is currently active or which tab has been selected, we cannot actually not know which tab is just active in our application.

    Is there any other reliable method to retrieve the current active tab?

    Thanks for any feedback!

    Regards,

    Daniel


    Thursday, May 23, 2013 9:43 AM

Answers

  • Got a response on the partner forums: In fact this property can be used to set the state of contextual tab but it won't necessary contain the correct value when the state has changed manually by the user. Considering this as being answered, even if it's not a very satisfying situation.
    • Marked as answer by Daniel Lemke Tuesday, June 11, 2013 2:47 PM
    Tuesday, June 11, 2013 2:47 PM