我正在使用Blend(我对它很新)来创建XAML.我有一行代码调用writeC下面的函数:
<Button x:Name="key_c" Content="c" HorizontalAlignment="Left" Height="60"
Margin="243,188.667,0,0" VerticalAlignment="Top" Width="60" FontWeight="Bold"
FontFamily="Century Gothic" FontSize="21.333" Foreground="Black"
Click="writeC">
Run Code Online (Sandbox Code Playgroud)
这很好用.不过,我想改变它调用函数WriteChar与参数"a"和"A",所以它调用下面的C#功能:
private void writeChar(string myCharCaps, string myCharLower)
Run Code Online (Sandbox Code Playgroud)
我如何在XAML中写这个?
您的点击处理程序需要遵守事件处理程序签名。如果您想让该处理程序成为 WriteChar 周围的简单包装器,那就没问题了。更多信息请参见:http://msdn.microsoft.com/en-us/library/bb531289 (v=vs.90).aspx