【发布时间】:2015-08-21 22:18:35
【问题描述】:
我有一个带有ContentControl 绑定的窗口:
<ContentControl Content="{Binding CurrentViewModel}" />
我还有一个空的用户控件绑定到ContentControl:
<UserControl x:Class="UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
</Grid>
</UserControl>
当我运行并按下选项卡键盘时,我会在内容控件周围看到一个虚线矩形。如何禁用此功能?
我尝试使用Focusable="False" 和FocusVisualStyle="{x:Null}" 没有成功...
【问题讨论】:
-
用户控件是否在某处使用?这似乎无关紧要。在 ContentControl 中使用 Focusable="False" 时,它不会采用虚线矩形。您可能需要显示更多代码才能清除它。