メニュー項目の動的に作成されたリストを正しくバインドするにはどうすればよいですか。私はいくつかのことを試しましたが、どれもうまくいかないようです。名前の適切なリストを取得しましたが、ViewSwitchCommand が正しく起動していないようです。
<MenuItem Foreground="White" Header="Names" ItemsSource="{Binding Player.ToonNames}" Command="{Binding ViewSwitchCommand}" CommandParameter="{Binding Header}"/>
ただし、動的に実行せず、このように実行すると、すべてが正常に機能し、機能させることができます
<MenuItem Foreground="White" Header="Names">
<MenuItem Foreground="Black" Header="Chat" Command="{Binding ViewSwitchCommand}" CommandParameter="player1" />
<MenuItem Foreground="Black" Header="Craft" Command="{Binding ViewSwitchCommand}" CommandParameter="player2" />
</MenuItem>
コマンドパラメータは文字列を期待しています..それがそれであるかどうかわかりません...うまくいけば、これは私が見落としている単純なものです