Alternatives for "missing" galleries?

Jan 7, 2009 at 4:18 PM
Hello,

I'm looking for ideas to solve the following task:
I have to bring about 20 single clickable commands, which belong together. 20 buttons in one group are not possible (compile error). 20 small ones are not that nice and a dropdown button is also not a really usefull solution.

Any tips and ideas are appreciated.

Regards
Carsten
Coordinator
Jan 7, 2009 at 6:24 PM

Hi Carsten,

What is the compile error you're getting when you try to put 20 buttons in one group?  If I remember correctly, there shouldn't be a limit to the number of controls you can add to a Group, so I'd like to investigate this error and see if it's a bug or not.

Also, as a side note, we will have a Gallery control in V1 of the Ribbon so hopefully that will solve your problem.  If I think of a better temporary solution, I will let you know.

Thanks!
Samantha

 

Jan 7, 2009 at 10:27 PM
Or just use one of the many third-party ribbon controls out there that are orders of magnitude better than the Microsoft one.
Jan 8, 2009 at 8:19 AM
Hello Samantha,

here is the part of the code and following the error message. If you need any translations for the partial german text let me know.

@Divelements: are you able to write something more usefull then always "use one of the many third-party ribbon controls"? If you are not interested in answering the forum questions, why are you here?

            <r:RibbonTab Label="Grafik">
                <r:RibbonTab.Groups>
                    <r:RibbonGroup Name="Einfügen" Command="{StaticResource GraficInsertGroupCommand}">
                        <r:RibbonGroup.GroupSizeDefinitions>
                            <r:RibbonGroupSizeDefinitionCollection >
                                <r:RibbonGroupSizeDefinition>
                                    <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="False" />
                                    <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="False" />
                                    <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="False" />
                                    <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="False" />
                                    <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="False" />
                                    <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="False" />
                                    <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="False" />
                                    <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="False" />
                                </r:RibbonGroupSizeDefinition>
                                <r:RibbonGroupSizeDefinition IsCollapsed="True" />
                            </r:RibbonGroupSizeDefinitionCollection>
                        </r:RibbonGroup.GroupSizeDefinitions>
                            <r:RibbonButton Command="{StaticResource BeanInsert_Title}" />
                            <r:RibbonButton Command="{StaticResource BeanInsert_Start}" />
                            <r:RibbonButton Command="{StaticResource BeanInsert_Init}" />
                            <r:RibbonButton Command="{StaticResource BeanInsert_Decision}" />
                            <r:RibbonButton Command="{StaticResource BeanInsert_OpenTables}" />
                            <r:RibbonButton Command="{StaticResource BeanInsert_Process}" />
                            <r:RibbonButton Command="{StaticResource BeanInsert_PredefinedProcess}" />
                            <r:RibbonButton Command="{StaticResource BeanInsert_Termination}" />                       
                    </r:RibbonGroup>
                </r:RibbonTab.Groups>
            </r:RibbonTab>

Error message:

System.Windows.Markup.XamlParseException ist aufgetreten.
  LineNumber=230
  LinePosition=68
  Message=" Ein Aufrufziel hat einen Ausnahmefehler verursacht.  Fehler in Objekt "Microsoft.Windows.Controls.Ribbon.RibbonControlSizeDefinition" in Markupdatei "BusinessBeansEditor;component/mainwindow.xaml", Zeile 230, Position 68."
  NameContext="GroupSizeDefinitions"
  Source="PresentationFramework"
  StackTrace:
       bei System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
       bei System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
       bei System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
       bei System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
       bei System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
       bei System.Windows.Markup.TreeBuilder.Parse()
       bei System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       bei System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       bei BusinessBeansEditor.MainWindow.InitializeComponent() in C:\Dokumente und Einstellungen\cdd\Eigene Dateien\Visual Studio 2008\Projects\BusinessBeansEditor\BusinessBeansEditor\obj\Debug\MainWindow.g.vb:Zeile 173.
       bei BusinessBeansEditor.MainWindow..ctor() in C:\Dokumente und Einstellungen\cdd\Eigene Dateien\Visual Studio 2008\Projects\BusinessBeansEditor\BusinessBeansEditor\MainWindow.xaml.vb:Zeile 63.
  InnerException: System.Reflection.TargetInvocationException
       Message="Ein Aufrufziel hat einen Ausnahmefehler verursacht."
       Source="mscorlib"
       StackTrace:
            bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
            bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
            bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
            bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
            bei System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
            bei System.Windows.Markup.BamlRecordReader.ReadPropertyCustomRecord(BamlPropertyCustomRecord bamlPropertyRecord)
            bei System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
       InnerException: System.InvalidOperationException
            Message="Large controls displayed in the Ribbon must contain text labels."
            Source="RibbonControlsLibrary"
            StackTrace:
                 bei Microsoft.Windows.Controls.Ribbon.RibbonControlSizeDefinition.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)
                 bei Microsoft.Windows.Controls.Ribbon.RibbonControlSizeDefinition.NotifyPropertyChanged(String info)
                 bei Microsoft.Windows.Controls.Ribbon.RibbonControlSizeDefinition.set_IsLabelVisible(Boolean value)
            InnerException:


Regards
Carsten
Jan 8, 2009 at 9:30 AM
To suggest resolutions to problems.
Coordinator
Jan 8, 2009 at 6:46 PM

Hi Carsten,

 

The reason your code won’t run is because there is an error in the RibbonControlSizeDefinitions – “Large” size controls are required by the Office Fluent UI Guidelines to have a large image and a visible label.  In your RibbonControlSizeDefintions, you’re setting ImageSize=”Large” and IsLabelVisible=”False”.  If you change IsLabelVisible to True, you’ll see that the Ribbon should compile and run fine.

 

If you look all the way at the bottom of your exception, you’ll see that it contains the following: Message="Large controls displayed in the Ribbon must contain text labels."  At runtime, we are doing a check to make sure that the RibbonControlSizeDefinitions fit the Office Guideline-defined descriptions of Large (Large Image, Visible Label), Medium (Small Image, Visible Label), and Small (Small Image, No Label) controls, and the xaml above is failing, which is causing the exception.


Thanks!

Samantha


Jan 9, 2009 at 6:48 AM
Hello Samantha,

sorry, but I read the error message not carefully. As you said, with visible labels everything works fine.

Thanks for your help
Carsten