1、xaml的Resources中添加一个FrameworkElement的代理
<Window.Resources>
<FrameworkElement x:Key="Proxy" DataContext="{Binding}"/>
</Window.Resources>
2、用一个隐藏的ContentControl绑定FrameworkElement代理
<ContentControl Visibility="Collapsed" Content="{StaticResource Proxy}"/>

4、在ViewModel中定义IsVisibility属性

相关文章:

  • 2021-09-13
  • 2022-12-23
  • 1970-01-01
  • 2021-06-11
  • 2021-12-04
  • 2022-12-23
  • 2021-08-19
猜你喜欢
  • 2022-12-23
  • 2022-02-09
  • 2021-11-20
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-09-14
相关资源
相似解决方案