Вопрос View type selection in WPF Ribbon

  • 29 апреля 2012 г. 17:42
     
      С кодом

    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>


Все ответы

  • 1 мая 2012 г. 18:43
    Модератор
     
     

    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

  • 9 мая 2012 г. 4:54
    Модератор
     
     

    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

  • 16 мая 2012 г. 11:33
     
     

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