Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / Animation / PowerEase.cs / 1305600 / PowerEase.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation, 2008
//
// File: PowerEase.cs
//-----------------------------------------------------------------------------
namespace System.Windows.Media.Animation
{
///
/// This class implements an easing function that gives a polynomial curve of arbitrary degree.
/// If the curve you desire is cubic, quadratic, quartic, or quintic it is better to use the
/// specialized easing functions.
///
public class PowerEase : EasingFunctionBase
{
public PowerEase()
{
}
///
/// Power Property
///
public static readonly DependencyProperty PowerProperty =
DependencyProperty.Register(
"Power",
typeof(double),
typeof(PowerEase),
new PropertyMetadata(2.0));
///
/// Specifies the power for the polynomial equation.
///
public double Power
{
get
{
return (double)GetValue(PowerProperty);
}
set
{
SetValueInternal(PowerProperty, value);
}
}
protected override double EaseInCore(double normalizedTime)
{
double power = Math.Max(0.0, Power);
return Math.Pow(normalizedTime, power);
}
protected override Freezable CreateInstanceCore()
{
return new PowerEase();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation, 2008
//
// File: PowerEase.cs
//-----------------------------------------------------------------------------
namespace System.Windows.Media.Animation
{
///
/// This class implements an easing function that gives a polynomial curve of arbitrary degree.
/// If the curve you desire is cubic, quadratic, quartic, or quintic it is better to use the
/// specialized easing functions.
///
public class PowerEase : EasingFunctionBase
{
public PowerEase()
{
}
///
/// Power Property
///
public static readonly DependencyProperty PowerProperty =
DependencyProperty.Register(
"Power",
typeof(double),
typeof(PowerEase),
new PropertyMetadata(2.0));
///
/// Specifies the power for the polynomial equation.
///
public double Power
{
get
{
return (double)GetValue(PowerProperty);
}
set
{
SetValueInternal(PowerProperty, value);
}
}
protected override double EaseInCore(double normalizedTime)
{
double power = Math.Max(0.0, Power);
return Math.Pow(normalizedTime, power);
}
protected override Freezable CreateInstanceCore()
{
return new PowerEase();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ExpressionWriter.cs
- XamlReaderConstants.cs
- Ops.cs
- ListViewItem.cs
- BaseDataListDesigner.cs
- InputMethodStateTypeInfo.cs
- XmlDataSourceView.cs
- OleDbParameterCollection.cs
- XmlArrayAttribute.cs
- PackagingUtilities.cs
- SettingsContext.cs
- EncodingInfo.cs
- ComPlusServiceHost.cs
- AssemblyContextControlItem.cs
- ExeContext.cs
- XPathSingletonIterator.cs
- Point.cs
- ObjectDataSourceEventArgs.cs
- XmlUTF8TextWriter.cs
- PersonalizationDictionary.cs
- ImageButton.cs
- WebDisplayNameAttribute.cs
- XmlLinkedNode.cs
- FileDataSource.cs
- XmlFormatReaderGenerator.cs
- PasswordBox.cs
- UnderstoodHeaders.cs
- MultiplexingDispatchMessageFormatter.cs
- TdsParserSessionPool.cs
- SHA512Managed.cs
- SourceFileBuildProvider.cs
- SafeArrayTypeMismatchException.cs
- XmlSchemaImporter.cs
- Int64Converter.cs
- OpenTypeLayout.cs
- HtmlElement.cs
- SettingsProperty.cs
- Pair.cs
- SoapIncludeAttribute.cs
- ScrollProviderWrapper.cs
- Margins.cs
- XPathEmptyIterator.cs
- BindingSource.cs
- UriExt.cs
- FixedPageProcessor.cs
- TypeReference.cs
- MessageDecoder.cs
- XMLSyntaxException.cs
- SecurityResources.cs
- ClickablePoint.cs
- XmlEnumAttribute.cs
- ToolStripDropDownButton.cs
- Timer.cs
- FormsAuthentication.cs
- OperationAbortedException.cs
- SqlNamer.cs
- DependencyPropertyAttribute.cs
- KeyProperty.cs
- Point4DConverter.cs
- StyleTypedPropertyAttribute.cs
- MenuItemBinding.cs
- listviewsubitemcollectioneditor.cs
- DataGridViewRowsRemovedEventArgs.cs
- CodeDomExtensionMethods.cs
- Collection.cs
- ParentQuery.cs
- SqlDataSourceSummaryPanel.cs
- GB18030Encoding.cs
- loginstatus.cs
- FontEmbeddingManager.cs
- AffineTransform3D.cs
- ResourceSet.cs
- ISCIIEncoding.cs
- HyperlinkAutomationPeer.cs
- AsyncSerializedWorker.cs
- AmbientLight.cs
- PageThemeBuildProvider.cs
- NamespaceMapping.cs
- CqlBlock.cs
- Utility.cs
- ClientFormsAuthenticationCredentials.cs
- ConfigurationValidatorBase.cs
- BooleanProjectedSlot.cs
- DataPagerFieldCommandEventArgs.cs
- InvalidFilterCriteriaException.cs
- VoiceChangeEventArgs.cs
- ReadOnlyHierarchicalDataSourceView.cs
- Vector.cs
- MessageQueue.cs
- WindowsGrip.cs
- DockPattern.cs
- TextRangeEdit.cs
- ActionFrame.cs
- UnsafeNativeMethodsCLR.cs
- BufferedMessageWriter.cs
- HttpClientCertificate.cs
- QilSortKey.cs
- __FastResourceComparer.cs
- ProvidePropertyAttribute.cs
- AssertFilter.cs