Correct. I need any stupid sample of WPF Usercontrol animation in C# under the Canvas. I tried all combinations under story.Begin(??????); But it gives an error always. Any clue guys?
Storyboard story = new Storyboard();
DoubleAnimation dbWidth = new DoubleAnimation();
dbWidth.From = 0;
dbWidth.To = 200;
dbWidth.Duration = new Duration(TimeSpan.FromSeconds(.25));
DoubleAnimation dbHeight = new DoubleAnimation();
dbHeight.From = 0;
dbHeight.To = 200;
dbHeight.Duration = dbWidth.Duration;
story.Children.Add(dbWidth);
Storyboard.SetTargetName(dbWidth, PluginUControl.Name);
Storyboard.SetTargetProperty(dbWidth, new PropertyPath(UserControl.WidthProperty));
story.Children.Add(dbHeight);
Storyboard.SetTargetName(dbHeight, PluginUControl.Name);
Storyboard.SetTargetProperty(dbHeight, new PropertyPath(UserControl.HeightProperty));
story.Begin(??????);
UPDATES:
Also I tried to do like this
story.Begin((MainWindow)App.Current.Windows[0]);
I guessed that it is the same story.Begin(this); but no success...