public MetaPage() { InitializeComponent(); // FindName does not work with embedded items so we need to find them ourselves AnimateDefinitions ac = (AnimateDefinitions)TargetPanel.AnimateDefinitions; NewOpacity = (NewOpacityAnimate)ac[0]; RemoveOpacity = (RemoveOpacityAnimate)ac[1]; NewPosition = (NewPositionAnimate)ac[2]; MovePosition = (MovePositionAnimate)ac[3]; RemovePosition = (RemovePositionAnimate)ac[4]; }
/// <summary> /// Initialize a new instance of the MetaPanelBase class. /// </summary> public MetaPanelBase() { // List used to collect entries that are to be removed from panel _removeList = new MetaElementStateList(); // Use dictionary to associate each element with its animation state _stateDict = new MetaElementStateDict(); // Create and monitor changes in the layout collection _layoutCollection = new LayoutCollection(this); _layoutCollection.NeedMeasure += new EventHandler(OnNeedMeasure); _layoutCollection.CollectionChanged += new EventHandler(OnNeedMeasure); MonitorExtendElement(_layoutCollection); // Create and monitor changes in the animate collection _animateCollection = new AnimateDefinitions(this); _animateCollection.NeedMeasure += new EventHandler(OnNeedMeasure); MonitorExtendElement(_animateCollection); // Default layout/animate to be applied as the default in case collections are empty or not applied _defaultLayout = new StretchLayout(); _defaultAnimate = new NullAnimate(); // Let the Silverlight/WPF specific construction take place PlatformConstructor(); }