What is the procedure to add an event handler in managed code?
What is the procedure to add an event handler in managed code?
Answer
CLR language specific syntax is used to add event handler as XAML is not the only way to add it. XAML allows the event handler to be added to an object. CLR allows the objects to be included even if it is not being used by any program or application. The event handlers to the object can be added during the run time of the object or the lifetime. The callback method also can be used to add an event using the OnApplyTemplate method. By doing this the event handler will be added to the relevant object that will be ready for the use to the events of the user at run time. The code that will be used to load the event handler in the managed code is given below: <Grid x:Name="LayoutRoot" Loaded="LayoutRoot_Loaded"> <StackPanel> <TextBlock Name="text">Text is given as when on mouse hover</TextBlock> //Write your own code </StackPanel> </Grid>
Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website.
If you are using this website then its your own responsibility to understand the content of the website