Arun
Arun

Reputation: 1704

Open an xaml file inside a popup window in silverlight

I need to open an xaml file inside a popup window in silverlight. In my case i am having two xaml files namely a.axml and b.axml., In a.xaml, there is a hyper link button and a popup tag inside it. I have to open the b.xaml page inside that popup window on clicking the hyperlink of the a.xaml page.

This is my scenario. Pls help me to solve this issue.

thanks,

Neon

Upvotes: 0

Views: 2058

Answers (3)

mani kandan
mani kandan

Reputation: 306

Parent Page XAML:

    <HyperlinkButton Content="HyperlinkButton" Height="23"          HorizontalAlignment="Left"          Margin="150,111,0,0" Name="hyperlinkButton1" VerticalAlignment="Top" Width="100" Click="hyperlinkButton1_Click" />

Code Behind :

   public ParentPage()
    {
        InitializeComponent();
    }

    private void hyperlinkButton1_Click(object sender, RoutedEventArgs e)
    {
        ChildPage objpage = new ChildPage();
        objpage.Show();
    }

Here Is Pararent Page have buuton . child page load based on That button Click

Upvotes: 0

Davut G&#252;rb&#252;z
Davut G&#252;rb&#252;z

Reputation: 5716

Using Telerik controls its getting easier. But you may use second method. On Blend I changed the template of Telerik's child window. It seems better now

enter image description here

        HyperlinkButton link = new HyperlinkButton();
        link.Click += (s, a) =>
            {
                //With telerik
                RadWindow w = new RadWindow();
                w.Content=new UserControl();
                w.Show();
                w.ShowDialog();//Swith light and avoid access oter controls                                          

                //Without Telerik
                Popup p = new Popup();
                p.Child = w.Content as UserControl;
                p.IsOpen = true;

            };

Upvotes: 0

Bryant
Bryant

Reputation: 8670

You should be able to set the Child property of the popup to be a new instance of your b.xaml class (whatever that is).

Upvotes: 1

Related Questions