动态选择XAML文件 [英] Dynamically select XAML file

查看:109
本文介绍了动态选择XAML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行代码xxxx.xaml和xxxx.xaml.c时相互链接并被执行.但是我想知道一些使yyyy.xaml在运行时与xxxx.xaml.c链接的方法.所以我可以有不同的xaml文件,并根据事件调用每个文件.我的怀疑可能超出了范围或愚蠢!我仍然希望会有东西

在此先感谢

while execution of a code xxxx.xaml and xxxx.xaml.c are linked each other and getting executed . but i would like to know about some method which makes yyyy.xaml to link with xxxx.xaml.c during run time. so I can have different xaml files and call each one based on events . my doubt may be beyond the scope or foolish !!! still i hope there will be something

thanks in advance

推荐答案

听起来您需要使用TemplateSelector.我不会按照您的想法去做;-)

http://www.switchonthecode.com/tutorials/wpf-tutorial-how-使用数据模板选择器 [ ^ ]
It sounds like you need a TemplateSelector. I wouldn''t go down the route your thinking ;-)

http://www.switchonthecode.com/tutorials/wpf-tutorial-how-to-use-a-datatemplateselector[^]


看看 http: //forums.silverlight.net/t/1611.aspx [ ^ ]或此 http://blogs .msdn.com/b/ashish/archive/2007/08/14/dynamically-loading-xaml.aspx [
Take a look at http://forums.silverlight.net/t/1611.aspx[^] or this http://blogs.msdn.com/b/ashish/archive/2007/08/14/dynamically-loading-xaml.aspx[^]


这篇关于动态选择XAML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆