开发者

Visual Studio Style Undo/Redo Button in WPF

开发者 https://www.devze.com 2023-02-27 07:19 出处:网络
I want to make a Ribbon Undo/Redo Button that looks and functions like Visual Studio\'s Undo/Redo Buttons.

I want to make a Ribbon Undo/Redo Button that looks and functions like Visual Studio's Undo/Redo Buttons. I've been trying to use RibbonSplitButton to mimic the behavior, but it turns out it only accepts menuitems inside its Items Property. Does anybody have an idea on how to go about this? Thanks in Advance.

p.s. worst case scenario would be writin开发者_Python百科g a custom control to override the existing splitbutton but does anybody know what to override?


It should not be a problem that only MenuItems are allowed as long as you can bind to it using an ItemsSource property or the like. Your application just needs a Undo and Redo stack of commands which should be provide methods for Undo/Redo and a UI friendly display string. These stacks can then be bound to the list and hopefully DataTemplated to show the display string and call the right methods upon click.

0

精彩评论

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