开发者

A weired issue using RibbonButton's QuickAccess Toolbar

I used Ribbon library for WPF for a big project. Now when I have a weired issue which is easy to create. Let's say I have a RibbonButton and set QuickAccessToolBarId property. It enables to add this button to the QuickAccessToolBar. Th开发者_StackOverflowe weired thing is that when I set ribbonButton.DataContext = ribbonButton; and add this button into the QuickAccessBar, it throws an stack overflow exception. I trace this issue into the library but no clue on this; I think some thing is implemented in the Microsoft.Windows.Shell assembly which I cannot step into.

I know it's not a normal way to use the DataContext, but I want to know what causes the stack overlay when adding the quick access bar.

Thanks,


I think that stack overflow is caused because you are trying to set data context to the control itself. That is like you have recursively called some function and never get out of it.That way, you are creating infinite loop, and that causes stack overflow. It has nothing to do with QuickAccessToolBar.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜