开发者

Silverlight control in aspx page

开发者 https://www.devze.com 2023-01-06 15:36 出处:网络
i have two silverlight user controls name r开发者_JAVA技巧egion.xaml and session.xaml and i want to place them in region.aspx and session.aspx respectively. The problem is that in both the aspx pages

i have two silverlight user controls name r开发者_JAVA技巧egion.xaml and session.xaml and i want to place them in region.aspx and session.aspx respectively. The problem is that in both the aspx pages i am getting the region.xaml control how to fix it hta in the session.aspx session.xaml control will be displayed.


I have found the solution:

first we need to set the properties in

and then need to ammed the App.xaml file of silverlight application as shown below:

    private void Application_Startup(object sender, StartupEventArgs e)
    {
        string ControlID = "ControlID";
        if (e.InitParams.ContainsKey(ControlID))
        {
            switch (e.InitParams[ControlID])
            {
                case "RegionControl":
                    this.RootVisual = new RegionControl();
                    break;

                case "SessionControl":
                    this.RootVisual = new SessionControl();
                    break;

                default:
                    break;
            }
        }
    }
0

精彩评论

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