WPF Ribbon Tab view in Designer

妖精的绣舞 提交于 2019-12-05 02:27:56

You can also use the SelectedIndex property on the Ribbon to set which tab is the currently selected tab (0 being the first tab, 1 being the second, etc.)

<ribbon:Ribbon SelectedIndex="0" />

The only way I have found is to set the Selector.IsSelected property to true. This will cause the tab to become visible at design time.

<ribbon:RibbonTab Selector.IsSelected="True" ...

I can't confirm this is working right now because my preview in general is not working properly, but this works in general in WPF when trying to hide something at design time only.

Include the namespace for blend

xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 

Then in the element you want to hide use d:IsHidden="True". This will only affect design time, which eliminates the problem of forgetting to change the selected index to the correct value before building.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!