External alias in XAML

后端 未结 2 633
孤城傲影
孤城傲影 2021-01-27 04:22

I\'m currently using a library that implements Menus and ContextMenus for Silverlight 3 and 4. This library d

2条回答
  •  旧巷少年郎
    2021-01-27 04:52

    Finally I've found a workaround : I've created a library project that wraps the types from the menus library.

    For instance :

    namespace Alias
    {
        public class MenuItem : System.Windows.Controls.MenuItem
        {
        }
    }
    

    I then reference this project from my real project and can use the type through their "new" namespace "Alias".

    It's a kind of "heavy alias" but seems to work.

提交回复
热议问题