Silverlight 3:获取当前XAML文件名的值

Silverlight 3:获取当前XAML文件名的值,silverlight,xaml,silverlight-3.0,Silverlight,Xaml,Silverlight 3.0,我只想得到当前的XAML文件名,这样我就可以在用户控件中做出决定。你知道Silverlight 3中这个值的位置吗 例如: if (currentPage == "home") homeLink.foreground = "white" elseif (cuurentPage == "settings") settingsLink.foreground = "white" 也许我没有理解你的问题,但是这个.GetType.Name应该会提供你所需要的。如果你找不

我只想得到当前的XAML文件名,这样我就可以在用户控件中做出决定。你知道Silverlight 3中这个值的位置吗

例如:

if (currentPage == "home")  
    homeLink.foreground = "white"  
elseif (cuurentPage == "settings")  
    settingsLink.foreground = "white"  

也许我没有理解你的问题,但是这个.GetType.Name应该会提供你所需要的。

如果你找不到答案,你可以在用户控件中添加一个依赖属性,并在每个页面中设置它。很好!这也会起作用。谢谢我想这就是我的答案。谢谢你的意见!导航服务导航=新导航服务;字符串currentPage=nav.Source.Host;