passing the current Window as a CommandParameter

后端 未结 3 907
忘了有多久
忘了有多久 2020-12-29 03:50

how can I pass the window I am currently on as a parameter to a command?

I like to do this in XAML-markup:

3条回答
  •  心在旅途
    2020-12-29 04:22

    You could try binding to a RelativeSource

    If you want to pass the Button as a parameter:

    If you want to pass the Window as a parameter:

提交回复
热议问题