- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 String
来自字典:
<?xml version="1.0" encoding="utf-8" ?>
<Dictionary EnglishName="English" CultureName="English" Culture="en-US">
...
<Value Id="ButtonSuppressFieldInformation"
ToolTip="Remove field" Name="Remove field number "/>
...
</Dictionary>
ConverterParamter
启用多种语言支持:
<Button>
...
<AutomationProperties.Name>
<MultiBinding
Converter="{StaticResource IndexedForAutomationId}"
ConverterParameter="{loc:Translate
Uid=ButtonSuppressFieldInformation, Default=Delete field}">
<Binding RelativeSource="{RelativeSource Self}" />
<Binding ElementName="MyContactDirectoryView"
Path="ListConditionToSearch" />
</MultiBinding >
</AutomationProperties.Name>
</Button>
IndexedForAutomationId
),
string
没有出现。
string
而不是
"{loc:Translate Uid=ButtonSuppressFieldInformation, Default=Delete field}"
作品:
<MultiBinding Converter="{StaticResource IndexedForAutomationId}"
ConverterParameter="Delete field">
Delete field 0
.
loc:Translate
有什么使用方法|作为转换器参数?
最佳答案
这个问题可能是由于很多事情造成的,更多的代码在这里真的会有所帮助。但是,我将从 Convert()
上的断点开始。 IndexedForAutomationId
的方法转换器到 1) 检查您是否从内部绑定(bind)中获得期望的值,以及 2) 检查转换器本身是否从字典中返回正确的字符串。
请务必查看这些关于 how to debug WPF bindings 的指南也是。
关于wpf - 在 ConverterParameter 中使用字典中的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14955423/
我正在尝试绑定(bind)到整数属性: 我的转换器是: [ValueConversion(typeof(int), typeof(bool))] public class IntToBoolConv
基本上,如果我有: 您将如何传递某种类型的项目数组作为 ConverterParameter。我想我可以传入某种类型的分隔列表,但我不确定要使用哪种类型的分隔符,或者是否有内置的方法来传入参数数组?
我的示例代码如下。 我想将“Go to linked item”传递给 ConverterParameter 但我不能,因为字符串中有空格。 Text="{Binding Value,
我正在尝试使用 String来自字典: ... ... 在这个 ConverterParamter启用多种语言支持: ...
目前我使用整数作为 ConverterParameter ,并将其转换为 Enum在 Converter .我发现它在 XAML 中非常难以理解。 . 我想知道是否有办法声明Enum在资源部分并将其值
我正在编写我的第一个 Silverlight 应用程序。我有一个数据网格,其中有一列有两个标签,对于标签,我使用 IValueConverter 有条件地格式化数据。 标签的“内容”设置如下: Con
出现了 UI 中的复选框需要绑定(bind)到数字参数的情况 - 实际上,某些值使复选框为“true”,否则为“false”。 最简单的方法似乎是使用转换器: [ValueConversion(typ
出现了 UI 中的复选框需要绑定(bind)到数字参数的情况 - 实际上,某些值使复选框为“true”,否则为“false”。 最简单的方法似乎是使用转换器: [ValueConversion(typ
我在 wpf 中遇到了奇怪的行为。每当我尝试将 x:Array 作为转换器参数传递给我的转换器时,我都会收到此错误。设计器 View 显示错误而不是我的控件。 只有当我在 Style 中执行此操作时才
我正在构建一个可供许多用户使用的应用程序。每个用户都被分类到下一个身份验证级别之一: public enum AuthenticationEnum { User, Technitian
如何将 LayoutRoot 的 DataContext 传递给 ListBox 项模板内的 ContentControl 转换器?
我正在尝试在项目控件 ItemContainerStyle 中使用转换器将 ItemsControl 中项目的属性转换为 X 值。要进行转换,我还需要对包含 ItemsControl 的父级 User
我正在做一个 UWP 项目,我不想使用转换器和静态资源字符串来格式化字符串,因为该应用程序使用多种语言。 这是我的转换器: public class StringFormatConverter : I
我的 xaml 中有一个数据网格:
我写了一个转换器来获取 Value 作为 Bool 参数作为字符串 我是这样使用的: BorderBrush="{Binding IsSelected, C
我正在尝试使用值绑定(bind)作为转换器参数,如下面的代码片段所示: 问题是,EqualityConverter::Convert() 方法是使用 Binding 实例作为转换器参数 (Compa
我有问题,我不知道如何解决这个简单的问题,我有很多这样的点,那么解决方案应该不复杂。 我有带有设置和主 XAML 的主项目。 我有绑定(bind)转换器和 XAML 文件的依赖项目: 此 XAML
是否可以将绑定(bind)添加到 MultiBinding 中的 ConverterParameter? 像这样的东西:
我有一个 ListBox,我在其中将 ItemsSource 设置为从 WCF 服务填充的 CollectionViewSource。我在 ListBox.ItemTemplate\DataTempl
我想知道如何传递 System.Windows.Visibility Enum 作为转换器的参数: 最佳答案 正如 @dkozl 已经提到的,您可以使用 x:Static Markup Extens
我是一名优秀的程序员,十分优秀!