且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在WPF中创建一个时尚菜单.

更新时间:2023-11-17 17:19:40

首先,请意识到样式是WPF不可或缺的功能,因此首先要学习的是样式的工作方式.

参见:
http://msdn.microsoft.com/en-us/library/ms745683.aspx [ ^ ];
另请参见此CodeProject文章: WPF导览–第5部分(样式) [ ^ ].

其次,您需要认识到菜单与任何其他控件和UI元素没有太大区别.好吧,看一下代码示例:
http://msdn.microsoft.com/en-us/library/ms747082%28v = VS.90%29.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/ms771422%28v = vs.85%29.aspx [ ^ ].

最后,请意识到,如果不采用整体方法来设计整个应用程序,应用程序套件或整个公司样式,就无法合理地样式化"菜单或任何其他元素.有关工业设计的更多内容.您的艺术技巧如何?坦率地说,如果这样的任务看起来过于雄心勃勃,则***的样式将是默认样式.

—SA
First of all, please realize that styling is an integral feature of WPF, so first thing to learn is how styles work.

See:
http://msdn.microsoft.com/en-us/library/ms745683.aspx[^];
See also this CodeProject article: A Guided Tour of WPF – Part 5 (Styles)[^].

Secondly, you need to realize that menu is not much different from any other controls and UI elements. Well, take a look at the code samples:
http://msdn.microsoft.com/en-us/library/ms747082%28v=VS.90%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms771422%28v=vs.85%29.aspx[^].

And finally, please realize that you cannot reasonably "style" menu or any other element without some holistic approach to the design of whole application, application suite or a whole company style. This is a lot more about industrial design. How about your artistic skills? If such task looks a bit too ambitious, frankly, the best style would be the default style.

—SA