I use Caliburn micro for my WPF Project. Static menus are easy to bind with Caliburn
<Menu Grid.Row="0" IsMainMenu="True">
<MenuItem Header="_File">
<MenuItem x:Name="OpenScript" Header="_Open script"/>
</MenuItem>
<MenuItem Header="_Script">
<MenuItem x:Name="RunScript" Header="_Run script" />
<MenuItem x:Name="StopScript" Header="_Stop script" />
</MenuItem>
<MenuItem Header="S_ettings">
<MenuItem x:Name="Plugins" Header="_Plugins">...Clickable children here</MenuItem>
</MenuItem>
</Menu>
The names are bound to methods on the model, but for the Plugins menu that you see above we need to bind against a collection of PluginViewModel.. Then when you click a plugin i want a Caliburn action method to trigger on the menu view model (You now the kind that you can yield reuturn IResults from).. Is this possible?
This question is for this open source project
https://github.com/AndersMalmgren/FreePIE
edit: Forgot to mentioned that i have solved the binding part,
public BindableCollection<PluginMenuViewModel> Plugins { get; set; }
But i do not know how to listen to the click from the model
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…