开发者

Using a generic save button for several different WPF forms

开发者 https://www.devze.com 2023-02-18 19:25 出处:网络
I have a question about WPF and a LOB application. I would like to have a ribbon contro开发者_运维百科l with the buttons: \"New\", \"Save\", \"Next Record\", \"Previous Record\" and so on.

I have a question about WPF and a LOB application. I would like to have a ribbon contro开发者_运维百科l with the buttons: "New", "Save", "Next Record", "Previous Record" and so on.

I would like the buttons to apply to different kind of forms in the application but be available in the Ribbon on top so that the user has the same way of for example adding new items.

Is this possible to achieve with ICommands or RelayCommand or similar? I would like to specify the question further but I'm not sure what I'm looking for in more detail.


You could bind the Command of the button to a command of the current "view" or document:

<Button Content="Save" Command="{Binding CurrentView.SaveCommand}" />
0

精彩评论

暂无评论...
验证码 换一张
取 消