BinaryRibbonToggleButtonControl
A ribbon button that stays pressed while it is on – Bold, Show Ruler, Track Changes – drawn large, medium or small as the ribbon gives it room.
public class BinaryRibbonToggleButtonControl : ToggleButton, IBinaryRibbonContentElementBoundsConfigurable, IBinaryRibbonKeyTipControl
Inherits from / implements: ToggleButton, IBinaryRibbonContentElementBoundsConfigurable, IBinaryRibbonKeyTipControl
Remarks
It is a WPF ToggleButton: bind or read
IsChecked, or handle
Checked and
Unchecked. While it is checked it is drawn
pressed.
Pictures, caption and size
As for BinaryRibbonButton: large shows LargeImage over the caption
(ContentControl.Content), medium shows SmallImage beside it, and small the
picture alone; with no small picture the large one is drawn scaled down. The size is set by the
BinaryRibbonGroup holding the button, or by a BinaryRibbonButtonGroup,
which always draws it small.
Keyboard
A key tip (BinaryKeyTip.AccessKeyProperty) turns it on or off.
Examples
<ribbon:BinaryRibbonGroup TitleText="Show"
xmlns:ribbon="clr-namespace:Binarymission.WPF.Controls.Office;assembly=Binarymission.WPF.Controls.BinaryRibbon">
<ribbon:BinaryRibbonToggleButtonControl Content="Ruler" SmallImage="Images/Ruler16.png"
ribbon:BinaryRibbonBarPanel.MaxSize="Medium"
ribbon:BinaryKeyTip.AccessKey="R"
IsChecked="{Binding IsRulerVisible, Mode=TwoWay}" />
<ribbon:BinaryRibbonToggleButtonControl Content="Gridlines" SmallImage="Images/Grid16.png"
ribbon:BinaryRibbonBarPanel.MaxSize="Medium"
IsChecked="{Binding AreGridlinesVisible, Mode=TwoWay}" />
</ribbon:BinaryRibbonGroup>See also
Members at a glance
| Properties | |
|---|---|
BinaryRibbonTag | Gets or sets any object of your own to keep with the button. |
CornerRadius | Gets or sets how rounded the corners of the button's frame and highlight are. |
IsFlat | Gets or sets whether the button should be drawn flat. |
LargeImage | Gets or sets the picture the button shows when the ribbon draws it large. |
SmallImage | Gets or sets the picture the button shows when the ribbon draws it medium or small. |
| Fields | |
CornerRadiusProperty | Identifies the CornerRadius dependency property. |
IsFlatProperty | Identifies the IsFlat dependency property. |
LargeImageProperty | Identifies the LargeImage dependency property. |
SmallImageProperty | Identifies the SmallImage dependency property. |
Properties
BinaryRibbonTag
Gets or sets any object of your own to keep with the button.
- Value
- Any object. The default is
null.
Remarks
The ribbon never reads it. It is a plain property, not a dependency property, so it cannot be the
target of a binding or a style setter; use FrameworkElement.Tag for that.
CornerRadius
Gets or sets how rounded the corners of the button's frame and highlight are.
- Value
- The radius of each corner, in device-independent units (1/96 inch). The default is 4 on every corner.
Remarks
Inside a BinaryRibbonButtonGroup the group sets this itself, so a value set on the
button there is replaced.
IsFlat
Gets or sets whether the button should be drawn flat.
- Value
- The default is
true.
Remarks
The button's built-in templates do not read this property; it changes nothing on screen.
LargeImage
Gets or sets the picture the button shows when the ribbon draws it large.
- Value
- The picture, drawn 32 x 32 device-independent units. The default is
null.
Remarks
When SmallImage is null, this picture is also used, scaled down, for
the medium and small sizes.
See also
SmallImage
Gets or sets the picture the button shows when the ribbon draws it medium or small.
- Value
- The picture, drawn 16 x 16 device-independent units. The default is
null, which showsLargeImagescaled down instead.
Remarks
A large button does not fall back to this picture: give it a LargeImage.
See also
Fields
CornerRadiusProperty static
Identifies the CornerRadius dependency property.
IsFlatProperty static
Identifies the IsFlat dependency property.
LargeImageProperty static
Identifies the LargeImage dependency property.
SmallImageProperty static
Identifies the SmallImage dependency property.