【发布时间】:2020-04-23 02:55:34
【问题描述】:
我正在为 wpf-mvvm netcoreapp3.1 应用程序使用最新版本的 MahApps.Metro。我从 wpf-mvvm .netframework4.7 应用程序迁移了 mvvm 应用程序。我以前为 wpf-mvvm .netframework4.7 应用程序提供了以下内容:
<mahapps:ToggleSwitch OnLabel="{Binding OnLabelText}"
OffLabel="{Binding OffLabelText}"
CheckedCommand="{Binding StartDistributionCommand}"
UnCheckedCommand="{Binding StopDistributionCommand}"
Style="{StaticResource ToggleSwitch.Win10}"
IsChecked="{Binding WebDistributionOnStatus, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
wpf .netcoreapp3.1 的更新版本为:
<mahapps:ToggleSwitch OnContent="{Binding OnLabelText}"
OffContent="{Binding OffLabelText}"
CheckedCommand="{Binding StartDistributionCommand}"
UnCheckedCommand="{Binding StopDistributionCommand}"
Style="{StaticResource ToggleSwitch.Win10}"
IsOn="{Binding WebDistributionOnStatus, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
问题是 ToggleSwitch 控件的 CheckedCommand 和 UnCheckedCommand 参数不再存在,我找不到合适的替代品。任何帮助将不胜感激。
【问题讨论】:
标签: c# wpf-controls mahapps.metro .net-core-3.1