本文整理汇总了C#中System.Windows.PropertyMetadata类的典型用法代码示例。如果您正苦于以下问题:C# PropertyMetadata类的具体用法?C# PropertyMetadata怎么用?C# PropertyMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyMetadata类属于System.Windows命名空间,在下文中一共展示了PropertyMetadata类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestUserControl
static TestUserControl()
{
PropertyMetadata metaData;
metaData = new PropertyMetadata(Colors.Red);
ColorProperty = DependencyProperty.Register("Color", typeof(Color), typeof(TestUserControl),metaData);
}
示例2: ColorPick
static ColorPick()
{
PropertyMetadata metaData;
metaData = new PropertyMetadata(Colors.Red);
ColorProperty = DependencyProperty.Register("Color", typeof(Color), typeof(ColorPick),metaData);
}
示例3: DependencyPropertyChangedEventArgs
internal DependencyPropertyChangedEventArgs(
DependencyProperty property,
PropertyMetadata metadata,
bool isAValueChange,
EffectiveValueEntry oldEntry,
EffectiveValueEntry newEntry,
OperationType operationType)
{
_property = property;
_metadata = metadata;
_oldEntry = oldEntry;
_newEntry = newEntry;
_flags = 0;
_operationType = operationType;
IsAValueChange = isAValueChange;
// This is when a mutable default is promoted to a local value. On this operation mutable default
// value acquires a freezable context. However this value promotion operation is triggered
// whenever there has been a sub property change to the mutable default. Eg. Adding a TextEffect
// to a TextEffectCollection instance which is the mutable default. Since we missed the sub property
// change due to this add, we flip the IsASubPropertyChange bit on the following change caused by
// the value promotion to coalesce these operations.
IsASubPropertyChange = (operationType == OperationType.ChangeMutableDefaultValue);
}
示例4: DiagramLabel
static DiagramLabel()
{
var fontFamilyMd = new PropertyMetadata(new FontFamily("Arial"), OnFontFamilyChanged);
FontFamilyProperty = DependencyProperty.Register("FontFamily", typeof (FontFamily), typeof (DiagramLabel), fontFamilyMd);
var fontWeightMd = new PropertyMetadata(FontWeights.Normal, OnFontWeightChanged);
FontWeightProperty = DependencyProperty.Register("FontWeight", typeof (FontWeight), typeof (DiagramLabel), fontWeightMd);
const double defaultSize = 11;
var fontSizeMd = new PropertyMetadata(defaultSize, OnFontSizeChanged);
FontSizeProperty = DependencyProperty.Register("FontSize", typeof (double), typeof (DiagramLabel), fontSizeMd);
var fontStyleMd = new PropertyMetadata(FontStyles.Normal, OnFontStyleChanged);
FontStyleProperty = DependencyProperty.Register("FontStyle", typeof (FontStyle), typeof (DiagramLabel), fontStyleMd);
var fontStretchMd = new PropertyMetadata(FontStretches.Normal, OnFontStretchChanged);
FontStretchProperty = DependencyProperty.Register("FontStretch", typeof (FontStretch), typeof (DiagramLabel),
fontStretchMd);
var foregroundMd = new PropertyMetadata(new SolidColorBrush(Colors.Black), OnForegroundChanged);
ForegroundProperty = DependencyProperty.Register("Foreground", typeof (Brush), typeof (DiagramLabel), foregroundMd);
var relativePosMd = new PropertyMetadata(new Point(0, 0), OnRelativePositionChanged);
RelativePositionProperty = DependencyProperty.Register("RelativePosition", typeof (Point), typeof (DiagramLabel), relativePosMd);
var textMd = new PropertyMetadata("", OnTextChanged);
TextProperty = DependencyProperty.Register("Text", typeof (String), typeof (DiagramLabel), textMd);
}
示例5: AddOwner
public DependencyProperty AddOwner(Type ownerType, PropertyMetadata typeMetadata)
{
if (typeMetadata == null) typeMetadata = new PropertyMetadata ();
OverrideMetadata (ownerType, typeMetadata);
// MS seems to always return the same DependencyProperty
return this;
}
示例6: GetCurrentPageIndexPropetyMetadata
private static PropertyMetadata GetCurrentPageIndexPropetyMetadata()
{
PropertyMetadata pm = new PropertyMetadata();
pm.DefaultValue = 1;
pm.PropertyChangedCallback = new PropertyChangedCallback(CurrentPageIndexPropertyChanged);
return pm;
}
示例7: OverrideMetadata
/// <summary>
/// Override the metadata of a property that is already secured with
/// this key.
/// </summary>
public void OverrideMetadata( Type forType, PropertyMetadata typeMetadata )
{
if( _dp == null )
{
throw new InvalidOperationException();
}
_dp.OverrideMetadata( forType, typeMetadata, this );
}
示例8: EyeCandy
static EyeCandy()
{
//register attached dependency property
var metadata = new PropertyMetadata((ImageSource)null);
ImageProperty = DependencyProperty.RegisterAttached("Image",
typeof(ImageSource),
typeof(EyeCandy), metadata);
}
示例9: DependencyProperty
private DependencyProperty(DependencyProperty property, PropertyMetadata defaultMetadata)
{
_defaultMetadata = defaultMetadata;
_name = property._name;
_ownerType = property._ownerType;
_propertyType = property._propertyType;
_validateValueCallback = property._validateValueCallback;
_properties[_name + _ownerType] = this;
}
示例10: GameManagerProperties
static GameManagerProperties()
{
PropertyChangedCallback dockingManagerChanged =
new PropertyChangedCallback(OnDockingManagerChanged);
PropertyMetadata dockingManagerMetadata =
new PropertyMetadata(null, dockingManagerChanged);
DockingManagerProperty = DependencyProperty.RegisterAttached("DockingManager",
typeof(DockingManager), typeof(GameManagerProperties), dockingManagerMetadata);
}
示例11: DependencyProperty
private DependencyProperty (bool isAttached, string name, Type propertyType, Type ownerType,
PropertyMetadata defaultMetadata,
ValidateValueCallback validateValueCallback)
{
IsAttached = isAttached;
DefaultMetadata = (defaultMetadata == null ? new PropertyMetadata() : defaultMetadata);
Name = name;
OwnerType = ownerType;
PropertyType = propertyType;
ValidateValueCallback = validateValueCallback;
}
示例12: DiagramNode
static DiagramNode()
{
var boundsMd = new PropertyMetadata(new Rect(0, 0, 0, 0), OnBoundsChanged);
BoundsProperty = DependencyProperty.Register("Bounds", typeof(Rect), typeof(DiagramNode), boundsMd);
var radiusXMd = new PropertyMetadata(0.0, OnRadiusXChanged);
RadiusXProperty = DependencyProperty.Register("RadiusX", typeof(double), typeof(DiagramNode), radiusXMd);
var radiusYMd = new PropertyMetadata(0.0, OnRadiusYChanged);
RadiusYProperty = DependencyProperty.Register("RadiusY", typeof(double), typeof(DiagramNode), radiusYMd);
}
示例13: DiagramEdge
static DiagramEdge()
{
var sourcePointMd = new PropertyMetadata(new Point(0, 0), OnSourcePointChanged);
SourcePointProperty = DependencyProperty.Register("SourcePoint", typeof (Point), typeof (DiagramEdge), sourcePointMd);
var destinationPointMd = new PropertyMetadata(new Point(0, 0), OnDestinationPointChanged);
DestinationPointProperty = DependencyProperty.Register("DestinationPoint", typeof (Point), typeof (DiagramEdge), destinationPointMd);
var anchoringModeMd = new PropertyMetadata(EdgeAnchoringMode.PointToPoint, OnAnchoringModeChanged);
AnchoringModeProperty = DependencyProperty.Register("AnchoringMode", typeof (EdgeAnchoringMode), typeof (DiagramEdge), anchoringModeMd);
}
示例14: DependencyProperty
DependencyProperty (
string propertyName,
Type propertyType,
Type ownerType,
PropertyMetadata metadata ) {
this.Name = propertyName;
this.PropertyType = propertyType;
this.OwnerType = ownerType;
this.DefaultMetadata = metadata;
}
示例15: FastComboBox
public FastComboBox()
{
var propertyMetadata = new PropertyMetadata(OnItemsSource2Changed);
ItemsSource2Property = DependencyProperty.Register(
"ItemsSource2"
, typeof(IEnumerable)
, typeof(FastComboBox)
, propertyMetadata);
DefaultStyleKey = typeof(FastComboBox);
}