相关疑难解决方法(0)

如何按名称或类型查找WPF控件?

我需要在WPF控件层次结构中搜索与给定名称或类型匹配的控件.我怎样才能做到这一点?

wpf controls find

258
推荐指数
13
解决办法
31万
查看次数

未检测到已安装的组件.无法解析TargetName HighContrastBorder - UWP Windows 10

我CommandBar在XAML中将其IsOpen属性设置为true,因此每个按钮的文本都是可见的,因为我希望描述保持可见.

当我点击省略号按钮时,它会隐藏文本,第二次点击它时,我收到以下错误:

No installed components were detected. Cannot resolve TargetName HighContrastBorder.

用户界面有些尴尬,可能与此有关,但我无法弄清楚是什么或为什么:

在此输入图像描述

正如您所看到的,我正在显示的各种按钮的按钮文字被截断:

代码方面,据我所知,它并没有什么特别之处:

<Page.BottomAppBar>
    <CommandBar IsOpen="True" 
                ClosedDisplayMode="Compact" 
                IsSticky="True"
                Visibility="{Binding 
                CommandBarViewModel.IsCommandBarVisible, 
                Converter={StaticResource BoolToVisibilityConverter}}"
                Background="{ThemeResource SystemControlBackgroundAccentBrush}">

        <AppBarButton 
            Icon="Add" 
            Label="Add" 
            Foreground="White"
            Command="{Binding CommandBarViewModel.AddCommand}"
            Visibility="{Binding CommandBarViewModel.IsAddVisible,
                         Converter={StaticResource BoolToVisibilityConverter}}"/>

        <AppBarButton 
            Icon="Refresh" 
            Label="Refresh" 
            Foreground="White" 
            Command="{Binding CommandBarViewModel.RefreshListCommand}" 
            Visibility="{Binding 
            CommandBarViewModel.IsRefreshListVisible, 
            Converter={StaticResource BoolToVisibilityConverter}}"/>
    </CommandBar>
</Page.BottomAppBar>
Run Code Online (Sandbox Code Playgroud)

没有InnerException,App.gics抛出异常

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
 UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) 
            global::System.Diagnostics.Debugger.Break();
        };
#endif
Run Code Online (Sandbox Code Playgroud)

关于我的问题的任何想法,即文本截止和未处理的异常?

谢谢

更新 - 1:

当我CommandBarViewModel.IsCommandBarVisible从Visible属性中删除binded属性()CommandBar并将其硬编码到时Visible,错误向下移动,而不是发生在App.gics中,它现在发生了它试图设置的第一个按钮的binded属性对...的可见度 …

xaml win-universal-app windows-10-universal uwp-xaml

5
推荐指数
1
解决办法
2134
查看次数