Hi,
I would like to allow the user to choose between a 'large' and 'small' ribbonview by dynamically changing the height of the ribbonview. Mostly everything is working as expected. The ribbonview initially loads correctly when set to either 'large' or 'small'. And the ribbonview switches from 'large' to 'small' with no issues. The problem that I'm running into is switching from the 'small' ribbonview to large. When I do this the button text is formatted incorrectly. I have attached a screenshot of the ribbonview with incorrectly formatted buttons. I have also included the code that resizes the ribbonview. I saw that out of the box changes to the ribbonview height was included in the 2013 Q1 Silverlight Controls. Is the incorrect button formatting a bug in the control or an issue with my code.
Thanks,
Daniel A
I would like to allow the user to choose between a 'large' and 'small' ribbonview by dynamically changing the height of the ribbonview. Mostly everything is working as expected. The ribbonview initially loads correctly when set to either 'large' or 'small'. And the ribbonview switches from 'large' to 'small' with no issues. The problem that I'm running into is switching from the 'small' ribbonview to large. When I do this the button text is formatted incorrectly. I have attached a screenshot of the ribbonview with incorrectly formatted buttons. I have also included the code that resizes the ribbonview. I saw that out of the box changes to the ribbonview height was included in the 2013 Q1 Silverlight Controls. Is the incorrect button formatting a bug in the control or an issue with my code.
Thanks,
Daniel A
protected
void
ResizeRibbonBar(UserConfiguration.RibbonBarStyleType? ribbonBarStyle)
{
int
buttonHeight;
int
buttonHeightStacked;
int
groupHeight;
int
ribbonBarHeight;
Visibility applicationButtonVisibility;
Visibility titleBarVisibility;
Visibility homeTabVisibility;
ButtonSize homeButtonSize;
ButtonSize documentButtonSizeOne;
ButtonSize documentButtonSizeTwo;
VerticalAlignment groupVerticalAlignment;
Thickness topMargin;
this
.ribbonStyle = ribbonBarStyle;
if
(ribbonBarStyle == UserConfiguration.RibbonBarStyleType.Small)
{
buttonHeight = 20;
buttonHeightStacked = 20;
groupHeight = 47;
ribbonBarHeight = 57;
topMargin =
new
Thickness(0, 5, 0, 0);
titleBarVisibility = Visibility.Collapsed;
applicationButtonVisibility = Visibility.Collapsed;
homeTabVisibility = Visibility.Collapsed;
homeButtonSize = ButtonSize.Medium;
groupVerticalAlignment = VerticalAlignment.Top;
}
else
{
buttonHeight = 67;
buttonHeightStacked = 25;
groupHeight = 91;
ribbonBarHeight = 135;
topMargin =
new
Thickness(0, 0, 0, 0);
titleBarVisibility = Visibility.Visible;
applicationButtonVisibility = Visibility.Visible;
homeTabVisibility = Visibility.Visible;
homeButtonSize = ButtonSize.Large;
groupVerticalAlignment = VerticalAlignment.Stretch;
}
//resize ribbonbar
this
.ribbonView.Height = ribbonBarHeight;
//set margin above ribbonbar
this
.homeRibbonTab.Margin = topMargin;
//set application button and title bar visiblity
this
.ribbonView.ApplicationButtonVisibility = applicationButtonVisibility;
this
.ribbonView.TitleBarVisibility = titleBarVisibility;
////hides upper tab bar
this
.homeRibbonTab.HeaderVisibility = homeTabVisibility;
//resizes home ribbon bar buttons
this
.homeTabNewDocumentButton.Size = homeButtonSize;
this
.homeTabCreateBatchButton.Size = homeButtonSize;
this
.homeTabOpenBatchButton.Size = homeButtonSize;
this
.homeTabUserSettings.Size = homeButtonSize;
this
.homeHelp.Size = homeButtonSize;
this
.homeRefresh.Size = homeButtonSize;
this
.homeLogout.Size = homeButtonSize;
this
.homeTabNewDocumentButton.Height = buttonHeight;
this
.homeTabCreateBatchButton.Height = buttonHeight;
this
.homeTabOpenBatchButton.Height = buttonHeight;
this
.homeTabUserSettings.Height = buttonHeight;
this
.homeHelp.Height = buttonHeight;
this
.homeRefresh.Height = buttonHeight;
this
.homeLogout.Height = buttonHeight;
//resize home ribbon tab groups
foreach
(RadRibbonGroup group
in
this
.homeRibbonTab.Items)
{
group.Height = groupHeight;
group.VerticalAlignment = groupVerticalAlignment;
}
}