0

I found in the documentation for CommandBar this description:

The app bar button controls are characterized by an icon and associated label. They have two sizes; normal and compact. By default, the text label is shown. When the IsCompact property is set to true, the text label is hidden. When used in a CommandBar control, the CommandBar sets the IsCompact property automatically as the control is opened and closed.

Am I able to somehow keep IsCompact mode active for AppBarButton also if a CommandBar is opened?

It works if I use AppBar, however, it does not have SecondaryCommands and also I can see in the documentation some kind of recommendation to use CommandBar instead of AppBar for Windows 10 apps.

You should use the AppBar only when you are upgrading a Universal Windows 8 app that uses the AppBar, and need to minimize changes. For new apps in Windows 10, we recommend using the CommandBar control instead.

I was experimenting with Opening and Opened events of CommandBar but I was not too much successful with any solution.

4

1 回答 1

0

覆盖 AppBarButton 模板(您可以在这里找到它:https ://msdn.microsoft.com/en-us/library/windows/apps/mt299122.aspx?f=255&MSPPError=-2147217396 ),并删除压缩包中的更改视觉状态。

这样它们看起来总是一样的。

于 2015-12-17T13:55:47.557 回答