-6

I got a code from Internet which contains below line of code

protected override Freezable CreateInstanceCore() => new ExponentialDoubleAnimation();

I don't have installed this version of C# in visual studio. so this is showing error that "Missing ;". can anybody please tell me what will be the similar code in c# 5 and below for this line of code?

Magnus
  • 45,362
  • 8
  • 80
  • 118

1 Answers1

5

C#6 (and later versions, of course) supports expression body methods. It's a shorter equivalent to:

protected override Freezable CreateInstanceCore() 
{
    return new ExponentialDoubleAnimation();
}
Zohar Peled
  • 79,642
  • 10
  • 69
  • 121