View type selection in WPF Ribbon

問題 View type selection in WPF Ribbon

  • dimanche 29 avril 2012 17:42
     
      A du code

    I have ListView in my app, which takes various values for View. I need to put a switcher on my WPF Ribbon to initiate this.

    I wonder, what it should be. I wish to follow guidelines for ribbons as accurate as possible.

    Now I use ComboBox. Pretty ugly, especially because I can't set it's height to 100% to make it look like style selection in MS Office

    <ribbon:RibbonGroup Header="View"> <ribbon:RibbonComboBox IsEditable="False" Height="40" MinHeight="40" DropDownClosed="RibbonComboBox_DropDownClosed"> <ribbon:RibbonGallery Name="cmbView" SelectedValuePath="Tag" IsSynchronizedWithCurrentItem="True"> <ribbon:RibbonGalleryCategory> <ribbon:RibbonGalleryItem Tag="0"> <DockPanel> <Image Width="32" Height="16" Source="../Images/ViewIcons.ico"/> <TextBlock Margin="3,0,0,0" VerticalAlignment="Center" Text="Icons" /> </DockPanel> </ribbon:RibbonGalleryItem>

    ... </ribbon:RibbonGalleryCategory> </ribbon:RibbonGallery> </ribbon:RibbonComboBox> </ribbon:RibbonGroup>


Toutes les réponses

  • mardi 1 mai 2012 18:43
    Modérateur
     
     

    Hi Herbert,

    You said:" can't set it's height to 100% to make it look like style selection in MS Office", I'm sorry for that I don't really get you by set height to 100%.

    If you want to set dropdownheight , you can set DropDownHeight. Or set the Height proprety.

    If this can't help you reslove your issue, maybe you can give more specific information about what you problem.

    Thank you.

    Have a nice day.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

  • mercredi 9 mai 2012 04:54
    Modérateur
     
     

    In WPF, there isn't such kind of 100% height we can set, for a ribbon comboBox you can just set DropDownHeight and Height to control the height of it. You need to adjust them to achieve your goal.

    So we are temporarily marking this as "Answer", if you have any concerns or new findings; please feel free to let me know.
    Best regards.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

  • mercredi 16 mai 2012 11:33
     
     

    Ok, here is what I want, and what I got right now. Sorry for confusion.