Silverlight CallMethodAction
How to get this CallMethodAction method InitBlah? Currently it doesn't fire. Am suspecting it the signature that is wrong:
<Grid x:Name="LayoutRoot"> <Button x:Name="btnEnter" Content="Enter" HorizontalAlignment="Left" Height="48" Margin="96,88,0,0" VerticalAlignment="Top" Width="144"> <interactivity:Interaction.Triggers> <interactivity:EventTrigger EventName="MouseEnter" SourceName="btnEnter"> <interactions:ChangePropertyAction PropertyName="Visibility" Value="Visible" TargetName="TextBoxTest" /> <interactions:CallMethodAction MethodName="InitBlah" TargetObject="{Binding}"/> </interactivity:EventTrigger> <interactivity:EventTrigger EventName="MouseLeave" SourceName="btnEnter"> <interactions:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" TargetName="TextBoxTest" /> </interactivity:EventTrigger> </interactivity:Interaction.Triggers> </Button> <Grid> <TextBlock Name="TextBoxTest" Width="100" Height="100" Visibility="Collapsed">Hello</TextBlock>
code behind:
public void InitBlah(object sender, RoutedEventArgs e) { var x = 1; }
The ChangePropertyAction works fine: when I hover over the button, the textbox pops up saying hello.
Answers & Comments...
Answer: 1
Answer: 1
The signature of your InitBlah
method should be matched for appropriate evets. Try this:
public void InitBlah(object sender, MouseEventArgs e) { var x = 1; }
by : Dmitry Martovoihttp://stackoverflow.com/users/976231
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog