0
我有了這個代碼在Silverlight 4:Siilverlight EventTrigger Button.Click拋出錯誤
<Grid>
<Grid.RowDefinitions >
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button Height="25" Width="25">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation From="0" To="200" Duration="00:00:00.5" Storyboard.TargetName="BigMenu" Storyboard.TargetProperty="Width"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Button.Triggers>
<Image Source="../ResX/expand.png"/>
</Button>
<Button Height="25" Width="25">
<Image Source="../ResX/pin.png"/>
</Button>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="1">
<Button Height="25" Width="25" Margin="0,10,0,5" Click="bSelf_Click">
<Image Source="../ResX/selfass.png"/>
<ToolTipService.ToolTip>
<ToolTip Content="Selbsteinschätzung" />
</ToolTipService.ToolTip>
</Button>
<Button Height="25" Width="25" Margin="0,5,0,5" Click="bforeign_Click">
<Image Source="../ResX/extass.png"/>
<ToolTipService.ToolTip>
<ToolTip Content="Fremdeinschätzung"/>
</ToolTipService.ToolTip>
</Button>
<Button Height="25" Width="25" Margin="0,5,0,5" Click="bSearch_Click">
<Image Source="../ResX/search.png"/>
<ToolTipService.ToolTip>
<ToolTip Content="Suche" />
</ToolTipService.ToolTip>
</Button>
<Button Height="25" Width="25" Margin="0,5,0,10" Click="bAdministration_Click">
<Image Source="../ResX/admin.png"/>
<ToolTipService.ToolTip>
<ToolTip Content="Administration"/>
</ToolTipService.ToolTip>
</Button>
</StackPanel>
<StackPanel Grid.Row="1" x:Name="BigMenu">
</StackPanel>
</Grid>
所以在初始化我有這個錯誤拋出:
XAMLParseException occured. Fehler beim Zuweisen zu Eigenschaft
'System.Windows.EventTrigger.RoutedEvent'. [Line: 22 Position: 47]
這是這樣的:
<EventTrigger RoutedEvent="Button.Click">
我在此代碼中看不到任何錯誤。 我會appriciate任何幫助。
問候