You could try this instead:
private void buttonname_Click(object sender, RoutedEventArgs e)
{
((Button)sender).Content = "Do not click on me!";
}
But, to run your code as is, you need to specify the name with x:Name
instead of Name
:
<Button x:Name="buttonname" Content="click me!" Click="buttonname_Click" Margin= "0,100,0,0" Height="93" Width="518"></Button>