本文整理汇总了C#中PropertyChangedCallback类的典型用法代码示例。如果您正苦于以下问题:C# PropertyChangedCallback类的具体用法?C# PropertyChangedCallback怎么用?C# PropertyChangedCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyChangedCallback类属于命名空间,在下文中一共展示了PropertyChangedCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FunctionalPropertyMetadata
public FunctionalPropertyMetadata(object defaultValue, FunctionalPropertyMetadataOptions flags, PropertyChangedCallback propertyChangedCallback, CoerceValueCallback coerceValueCallback)
{
DefaultValue = defaultValue;
PropertyChangedCallback = propertyChangedCallback;
CoerceValueCallback = coerceValueCallback;
_flags = flags;
}
示例2: PropertyMetadata
public PropertyMetadata(MetadataOption options, PropertyChangedCallback propertyChangedCallback = null,
CoerceValueCallback coerceValueCallback = null)
{
Options = options;
PropertyChanged = propertyChangedCallback;
CoerceValue = coerceValueCallback;
}
示例3: OnApply
protected override void OnApply(DependencyProperty dp, Type targetType)
{
doType = DependencyObjectType.FromSystemType(targetType);
propertyChangedCallbackInternal = PropertyChangedCallback;
PropertyChangedCallback = OnPropertyChanged;
base.OnApply(dp, targetType);
}
示例4: TextBox
//------------------------------------------------------
//
// Constructors
//
//------------------------------------------------------
#region Constructors
/// <summary>
/// Static constructor for TextBox.
/// </summary>
static TextBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata(typeof(TextBox)));
_dType = DependencyObjectType.FromSystemTypeInternal(typeof(TextBox));
// Add handlers for height properties so we can manage min/maxLines
PropertyChangedCallback callback = new PropertyChangedCallback(OnMinMaxChanged);
HeightProperty.OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata(callback));
MinHeightProperty.OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata(callback));
MaxHeightProperty.OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata(callback));
FontFamilyProperty.OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata(callback));
FontSizeProperty.OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata(callback));
// Registering typography properties metadata
PropertyChangedCallback onTypographyChanged = new PropertyChangedCallback(OnTypographyChanged);
DependencyProperty[] typographyProperties = Typography.TypographyPropertiesList;
for (int i = 0; i < typographyProperties.Length; i++)
{
typographyProperties[i].OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata(onTypographyChanged));
}
HorizontalScrollBarVisibilityProperty.OverrideMetadata(typeof(TextBox), new FrameworkPropertyMetadata(
ScrollBarVisibility.Hidden,
new PropertyChangedCallback(OnScrollViewerPropertyChanged), // PropertyChangedCallback
new CoerceValueCallback(CoerceHorizontalScrollBarVisibility)));
}
示例5: FrameworkPropertyMetadata
public FrameworkPropertyMetadata(
PropertyChangedCallback propertyChangedCallback,
CoerceValueCallback coerceValueCallback)
: base(propertyChangedCallback)
{
this.CoerceValueCallback = coerceValueCallback;
}
示例6: CornerRadiusAnimation
static CornerRadiusAnimation()
{
Type typeofProp = typeof(CornerRadius?);
Type typeofThis = typeof(CornerRadiusAnimation);
PropertyChangedCallback propCallback = new PropertyChangedCallback(AnimationFunction_Changed);
ValidateValueCallback validateCallback = new ValidateValueCallback(ValidateFromToOrByValue);
FromProperty = DependencyProperty.Register(
"From",
typeofProp,
typeofThis,
new PropertyMetadata((CornerRadius?)null, propCallback),
validateCallback);
ToProperty = DependencyProperty.Register(
"To",
typeofProp,
typeofThis,
new PropertyMetadata((CornerRadius?)null, propCallback),
validateCallback);
ByProperty = DependencyProperty.Register(
"By",
typeofProp,
typeofThis,
new PropertyMetadata((CornerRadius?)null, propCallback),
validateCallback);
}
示例7: ReadOnlyPropertyMetadata
public ReadOnlyPropertyMetadata(object defaultValue,
GetReadOnlyValueCallback getValueCallback,
PropertyChangedCallback propertyChangedCallback) :
base(defaultValue, propertyChangedCallback)
{
_getValueCallback = getValueCallback;
}
示例8: PropertyMetadata
public PropertyMetadata(object defaultValue = null, PropertyChangedCallback propertyChangedCallback = null, CoerceValueCallback coerceValueCallback = null, bool inherits = false)
{
this.DefaultValue = defaultValue;
this.PropertyChangedCallback = propertyChangedCallback;
this.CoerceValueCallback = coerceValueCallback;
this.Inherits = inherits;
}
示例9: QuaternionAnimation
/// <summary>
/// Static ctor for QuaternionAnimation establishes
/// dependency properties, using as much shared data as possible.
/// </summary>
static QuaternionAnimation()
{
Type typeofProp = typeof(Quaternion?);
Type typeofThis = typeof(QuaternionAnimation);
PropertyChangedCallback propCallback = new PropertyChangedCallback(AnimationFunction_Changed);
ValidateValueCallback validateCallback = new ValidateValueCallback(ValidateFromToOrByValue);
FromProperty = DependencyProperty.Register(
"From",
typeofProp,
typeofThis,
new PropertyMetadata((Quaternion?)null, propCallback),
validateCallback);
ToProperty = DependencyProperty.Register(
"To",
typeofProp,
typeofThis,
new PropertyMetadata((Quaternion?)null, propCallback),
validateCallback);
ByProperty = DependencyProperty.Register(
"By",
typeofProp,
typeofThis,
new PropertyMetadata((Quaternion?)null, propCallback),
validateCallback);
EasingFunctionProperty = DependencyProperty.Register(
"EasingFunction",
typeof(IEasingFunction),
typeofThis);
}
示例10: UIPropertyMetadata
public UIPropertyMetadata(
object defaultValue,
PropertyChangedCallback propertyChangedCallback,
CoerceValueCallback coerceValueCallback)
: base(defaultValue, propertyChangedCallback, coerceValueCallback)
{
}
示例11: UIPropertyMetadata
/// <summary>
/// UI metadata construction
/// </summary>
/// <param name="defaultValue">Default value of property</param>
/// <param name="propertyChangedCallback">Called when the property has been changed</param>
/// <param name="coerceValueCallback">Called on update of value</param>
/// <param name="isAnimationProhibited">Should animation be prohibited?</param>
public UIPropertyMetadata(object defaultValue,
PropertyChangedCallback propertyChangedCallback,
CoerceValueCallback coerceValueCallback,
bool isAnimationProhibited) :
base(defaultValue, propertyChangedCallback, coerceValueCallback)
{
WriteFlag(MetadataFlags.UI_IsAnimationProhibitedID, isAnimationProhibited);
}
示例12: RegisterForNotification
public static void RegisterForNotification(string property, FrameworkElement frameworkElement, PropertyChangedCallback OnCallBack)
{
Binding binding2 = new Binding(property);
binding2.set_Source(frameworkElement);
Binding binding = binding2;
DependencyProperty property2 = DependencyProperty.RegisterAttached("ListenAttached" + property, typeof(object), typeof(UserControl), new PropertyMetadata(OnCallBack));
frameworkElement.SetBinding(property2, binding);
}
示例13: UIPropertyMetadata
public UIPropertyMetadata (object defaultValue,
PropertyChangedCallback propertyChangedCallback,
CoerceValueCallback coerceValueCallback,
bool isAnimationProhibited)
: base (defaultValue, propertyChangedCallback, coerceValueCallback)
{
this.isAnimationProhibited = false;
}
示例14: PropertyMetadata
/// <summary>
/// Type meta construction
/// </summary>
/// <param name="defaultValue">Default value of property</param>
/// <param name="propertyChangedCallback">Called when the property has been changed</param>
/// <param name="coerceValueCallback">Called on update of value</param>
public PropertyMetadata(object defaultValue,
PropertyChangedCallback propertyChangedCallback,
CoerceValueCallback coerceValueCallback)
{
DefaultValue = defaultValue;
PropertyChangedCallback = propertyChangedCallback;
CoerceValueCallback = coerceValueCallback;
}
示例15: PropertyMetadata
public PropertyMetadata(object defaultValue, PropertyChangedCallback propertyChangedCallback)
{
if (defaultValue == DependencyProperty.UnsetValue)
throw new ArgumentException("Cannot initialize property metadata's default value to 'Unset'");
DefaultValue = defaultValue;
PropertyChangedCallback = propertyChangedCallback;
}