This is a migrated thread and some comments may be shown as answers.

Loaded event gets called twice

1 Answer 97 Views
Window
This is a migrated thread and some comments may be shown as answers.
NS
Top achievements
Rank 1
NS asked on 13 Oct 2008, 03:18 PM
Hello,
My RadWindow is defined as follow in XAML:
<telerik:RadWindow Width="800" Height="500" x:Name="window" PinMode="NoPin"  ResizeMode="NoResize" Header="Search User in AD" LeftOffset="-150" TopOffset="-50" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">  
            <ADTool:SearchUserInAD x:Name="usrCtrlSearchUserInAD" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> 
</telerik:RadWindow> 

To open my RadWindow, I use the following code:
void btnChangeManager_Click(object sender, RoutedEventArgs e)  
        {  
            window.WindowAnimation = Telerik.Windows.Controls.WindowAnimation.OnShow;  
            //usrCtrlSearchUserInAD.DataContext = (ADUserData)grdResults.SelectedItem;  
            usrCtrlSearchUserInAD.Width = window.Width;  
            usrCtrlSearchUserInAD.Height = window.Height;  
            window.ShowDialog();  
        } 

When I debug this, I see that the loaded event of usrCtrlSearchUserInAD gets called twice.
This only happens when the Radwindow is created the first time. When I close the RadWindow and open it again and press the open window button, the loaded event only gets called once.

Any help :)
Thanks,
Nicolas

1 Answer, 1 is accepted

Sort by
0
NS
Top achievements
Rank 1
answered on 16 Oct 2008, 11:49 AM
This problem is solved.
In the _loaded event I called a databindmethod.

referencing the usercontrol in my radwindow caused two calls to the databinding method.

Regards,
Nicolas
Tags
Window
Asked by
NS
Top achievements
Rank 1
Answers by
NS
Top achievements
Rank 1
Share this question
or