腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
WPF
CommandParameter
RelativeSource
绑定
、
、
Command="{Binding DataContext.CheckBoxIsChecked,
RelativeSource
={
RelativeSource
AncestorType=ListView}}"
CommandParameter
="{Binding
RelativeSource
={
RelativeSource
AncestorType=ListView}, Pa
浏览 59
提问于2019-06-04
得票数 0
回答已采纳
2
回答
绑定
网格视图行上的每一项
、
、
、
如何将按钮的命令参数
绑定
到每一行。请显示最合适的
绑定
表达式。GridViewColumn.CellTemplate> <Button MinWidth="100" Command="{Binding DeleteCommand}"
CommandParameter
浏览 2
提问于2012-07-28
得票数 1
回答已采纳
1
回答
从上下文菜单项中以CommandParamater形式获取父ListBox选定索引
、
、
、
、
我试图将列表框的选定索引属性作为命令参数传递给上下文菜单项,我可以使用命令
绑定
(感谢Will @ ),但我的命令参数有问题。"/> <DataTrigger Binding="{Binding IsMouseOver,
RelativeSource
={
RelativeSource
Self}}" Value="True&q
浏览 1
提问于2011-11-25
得票数 0
回答已采纳
2
回答
如何在DataTemplate中将
CommandParameter
绑定
到父控件的x:name?
、
、
Content="Neuer Ausgang" Style="{StaticResource ButtonRowStyle}" Command="{Binding
RelativeSource
={
RelativeSource
FindAncestor, AncestorType={x:Type TabControl}}, Path=DataContext.NewFullIOCommand}"
CommandParameter
="{Bi
浏览 10
提问于2012-04-19
得票数 1
回答已采纳
1
回答
使用
CommandParameter
从ContextMenu传递窗口
、
、
、
目标是在MVVM解决方案中使用硬编码的
WPF
NotifyTrayIcon从任务托盘中隐藏/显示窗口。问题是,
CommandParameter
似乎总是为null,这当然会导致代码崩溃。我尝试过许多不同的
绑定
,包括:
CommandParameter
="{Binding Mode=OneWay,
RelativeSource
={
RelativeSource
FindAncestor,AncestorType={x:Type local:MainWindow}}}&quo
浏览 3
提问于2014-08-27
得票数 4
回答已采纳
4
回答
将MVVM
绑定
命令
绑定
到上下文菜单项
、
我正在尝试将命令
绑定
到
WPF
中的菜单项。我使用的方法与我所有其他命令
绑定
的方法相同,但我不明白为什么它在这里不起作用。我现在像这样
绑定
我的命令:这就是它出错的地方(这是在UserControl中) &l
浏览 2
提问于2012-04-03
得票数 17
回答已采纳
1
回答
wpf
usercontrol,将按钮的命令参数
绑定
到父usercontrol
、
、
我有一个包含移除按钮的
WPF
UserControl,我想将整个UserControl作为
CommandParameter
进行传递。当前
绑定
被设置为
CommandParameter
="{Binding
RelativeSource
={
RelativeSource
Self}}“,这给了我按钮,但是我如何才能获得整个控件?<Button Grid.Column="2" Style="{DynamicResource CloseButton}&q
浏览 2
提问于2009-08-21
得票数 10
回答已采纳
1
回答
命令未从VIew触发
、
、
、
、
我有一个使用XAML的windows商店应用程序,其中我有一个
绑定
类型:我正在尝试
绑定
一个DomainObject列表,如下所示。Button Content="Start"
CommandParameter
还要注意,ItemsControl中的项被
绑定
到D
浏览 2
提问于2013-07-01
得票数 0
回答已采纳
2
回答
WPF
从列表视图项触发视图模型命令
、
、
、
有一个
WPF
MVVM应用程序。在主视图中,我有一个元素列表,这些元素是用ListView.ItemTemplate定义的,因为我希望有一个带有Delete操作的上下文菜单。Command="{Binding DeleteSelectedDream}"
浏览 12
提问于2022-04-18
得票数 1
回答已采纳
2
回答
如何在
WPF
中获取Datagrid的单元格数据值?
、
、
、
、
我是一个非常新手的
WPF
,我想用Datagrid控件做一个数据输入表单。我被困住了,如何获取单元格数据值以将其存储到数据库中?如何在
WPF
中获得此功能?
浏览 6
提问于2016-04-07
得票数 1
1
回答
如何从DataGridColumnHeader样式获取
WPF
列
绑定
字段
、
、
、
、
我正在为
WPF
数据进行自定义排序(因为我使用分页,所以不能使用默认排序),如何获得
绑定
到的字段的名称?DataGridColumnHeader"> <
浏览 5
提问于2017-05-11
得票数 0
回答已采纳
2
回答
如何在XAML中设置
CommandParameter
?
、
、
、
我可以在代码隐藏中这样做:这可以很好地工作。但是我试图在XAML中设置相同的东西(
CommandParameter
),但是我就是不能正确地设置它!我放入的所有内容都会产生一个BindingExpressionError或null参数。
浏览 2
提问于2011-03-09
得票数 2
回答已采纳
3
回答
WPF
绑定
ContextMenu菜单项的ItemsSource
、
、
、
、
我正在尝试将单个MenuItem的ItemsSource
绑定
到位于ViewModel中的ReadOnlyCollection<string>。--Command in ViewModel-->,
RelativeSource
={
RelativeSource
AncestorType=Window}}"/><Setter Property="MenuItem.
CommandParameter
" Value="{Binding}"
浏览 4
提问于2015-11-17
得票数 1
1
回答
键
绑定
到'?‘
、
、
时,我正在尝试将键
绑定
添加到
wpf
数据网格上。并尝试了以下几种方法: <KeyBinding Command="{Binding Path=OpenPrompt}"
CommandParameter
="{Binding
RelativeSource
={
RelativeSource
Mode=FindAncestor, AncestorType=DataGrid}, Path=Curre
浏览 1
提问于2012-07-16
得票数 0
回答已采纳
2
回答
如何在ViewModel中获取按钮的内容?
、
、
我有一个按钮,命令设置为viewModel。按钮在运行时填充值。有人能帮我获取viewModel中的按钮内容吗?<Button Height="110" Width="230" Content="{Binding Path=ListOfValues[1]}" /> <Button Height="110" W
浏览 10
提问于2014-01-23
得票数 1
回答已采纳
1
回答
WPF
。通过MultiBinding更改CheckBox IsChecked不会触发CheckBox命令
、
、
、
、
我在我的
WPF
应用程序视图中有Datagrid,其中我在行标题中使用复选框。> <Binding
RelativeSource
="{
RelativeSource
Path="DataContext" Mode=
浏览 14
提问于2016-09-07
得票数 0
回答已采纳
1
回答
CommandParameter
绑定
在Command.CanExecute触发后解析
、
、
="{StaticResource SwapArgsConverter}" ConverterParameter="-1"> <Button.Command> <Binding
RelativeSource
="{
RelativeSource
FindAncestor, AncestorType,但Command
绑定<
浏览 5
提问于2015-06-12
得票数 2
回答已采纳
1
回答
UserControl的关系源
绑定
、
、
="{Binding LinkCommand}"
CommandParameter
="{Binding LinkCommandParameter}"><userControls:ActionLink LinkText="View customers" LinkCommand="{Binding DataContext.ViewC
浏览 2
提问于2015-03-16
得票数 2
回答已采纳
1
回答
将ContextMenuItem的
CommandParameter
数据库设置为TreeViewItem的DataContext
、
、
、
、
但这也需要将
CommandParameter
绑定
到作为树中子节点的DataContext的AnalysisMain对象。FindAncestor,
RelativeSource
AncestorLevel=‘4’
绑定
的源代码。通过检查Christian Mosers
WPF
检查器中的视觉树,我看不到可视树中的上下文菜单。尽管TreeViewItem显示了DataContext对象。这也适用于执行命令,但我无法
绑定
到TreeViewItem的DataContext,用于
Command
浏览 3
提问于2014-11-20
得票数 0
回答已采纳
1
回答
在DataGrid中查找按钮行
、
、
、
由于行数是可变的,所以所有按钮的命令都
绑定
到同一个函数。但是,这意味着我现在需要发送一个
CommandParameter
来标识按钮的“索引”(等于它所在行的索引)。这就是我搞不懂的。作为一个
CommandParameter
,我应该发送什么来知道按钮的索引? 参见下面的.xaml (删除了与当前问题无关的所有内容)。Button
CommandParameter
是我想要填补的。"http://schemas.microsoft.com/expression/blend
浏览 8
提问于2014-05-06
得票数 1
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
对象存储
云点播
实时音视频
活动推荐
运营活动
广告
关闭
领券