cost 171 ms
在 WPF 应用程序中使用 RelativeSource 绑定(不是 ElementName)访问前一个兄弟元素? - Access a previous sibling element using RelativeSource binding (not ElementName) in WPF Application?

我正在尝试访问直接位于目标元素之前的同级元素的属性。 这是我必须在我的应用程序中多次复制的东西,所以如果可能的话,我宁愿使用可重现的东西(不是 elementName)。 有任何想法吗? ...

无法从 TabItemHeaderTemplate 中找到 DataGrid.ItemsSource 的正确相对绑定语法 - Trouble finding correct relative binding syntax for DataGrid.ItemsSource from TabItemHeaderTemplate

我的控件中有一个 TabControl,每个选项卡中都有一个 DataGrid。 我正在使用模板设置选项卡 header 的样式。 我想绑定到选项卡上的 DataGrid.ItemsSource 以便能够应用过滤器以将图像添加到 TabItem 以指示状态。 下面是我的 VisualTree,带有指 ...

WPF - TextBlock 中的工具提示使用 TextBlock 中的 Text 属性 - WPF - ToolTip in TextBlock that use the Text Property from the TextBlock

我们的应用程序中有许多 TextBlocks,其中许多必须有工具提示。 工具提示通常应显示为与TextBlock.Text属性相同。 此外,如果 TextBlock.Text = ""或null ,则不应显示工具提示。 所以我们在很多地方都有这个解决方案: 注意: 我必须在每个需要具有此功能的 To ...

如何从 Xamarin Forms 中的 DataTemplate 条目 TextChanged 事件调用命令? - How to call Command from DataTemplate Entry TextChanged Event in Xamarin Forms?

在 CollectionView 中使用 DataTemplates...我可以从这样的按钮调用 ViewModel 的命令: 或者像这样的手势: 那么,为什么我不能像这样从 Entry 的 TextChanged 事件中调用该命令? EventToCommandBehavior的代码在未在 D ...

相对来源从未调用过 - RelativeSource never called

我想将后面代码中的命令绑定到UserControl.Resources用户控制按钮( ICommand ) 所以我用RelativeSource写了一段代码。 但它没有用。 我尝试使用转换器进行调试来解决这个问题。 但即使这也没有被调用。 这是我制作的代码。 如果我错了,请告诉我。 谢谢你 ...

在代码隐藏中获取 WPF RelativeSource 绑定的值 - Getting the value of a WPF RelativeSource binding in codebehind

我正在尝试翻译此 XAML 代码: 进入这个 C# 代码: 我的 PropertyPathHelper 的实现(从另一个线程修改)class 如下: 我的 Binding 声明不正确,或者我的 PropertyPathHelper 实现不正确,但我不知道哪个,因为在运行时,“var value”作为 ...

绑定返回 RelativeSource object 而不是绑定指向的那个 - Binding returns RelativeSource object instead the one pointed by the binding

我必须将DataGrid中列的Visibility属性绑定到主用户控件的属性。 DataGrid位于用单独的ResourceDictionary编写的DataTemplate中。 我已经使用了这篇文章中描述的 ProxyFramework 元素技巧。 问题是代理元素内的绑定返回 System.Wi ...

使用 BindableLayout.ItemsSource 在 StackLayout 中进行命令绑定(使用 RelativeSourceExtension) - Command-Binding (with RelativeSourceExtension) within a StackLayout using BindableLayout.ItemsSource

我正在尝试使用 Xamarin.Forms 应用程序中的 BindableLayout.ItemsSource 将命令(使用 RelativeSourceExtension)绑定到 StackLayout 中的按钮。 MyControl.xaml 的不工作版本: 不幸的是,该按钮处于“非活动状态 ...

Visual Studio 无法识别 Xamarin 项目中 xaml 中的 RelativeSource Self - Visual studio does not recognise RelativeSource Self in xaml in Xamarin project

我在文档中读到以下示例应该在 Xamarin 项目中工作。 但是我的视觉工作室(最新版本 v2019)将“RelativeSource Self”部分标记为红色,并给出以下编译错误: 错误 XLS0414 找不到类型“RelativeSource”。 验证您没有缺少程序集引用并且所有引用的 ...

以App.xaml样式WPF访问用户控件属性 - Access user control property in App.xaml style WPF

我试图通过模型中的属性在我的可视笔刷(在App.xaml中定义)中设置Path的“ Stroke”属性。 我在用户控件的另一个控件模板中使用此样式。 用户控件资源中的样式: 在App.xaml中定义的画笔: 这里的问题是,我无法通过绑定在app.xaml中设置面刷的Str ...

WPF MVVM-从祖先视图模型绑定到属性 - WPF MVVM - Bind to a property from an ancestor view model

我有一个类似于以下内容的视图/视图模型: 这些视图中的每一个都绑定到适当的视图模型。 我试图将SomeCustomProperty绑定到CustomDialogView的视图模型上的属性。 做这个的最好方式是什么? 我尝试了一些方法,其中最有前途的似乎是通过Relative ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM