-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
  • 43,221
  • 7
  • 76
  • 112

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
  • 76,346
  • 9
  • 62
  • 111