本文整理汇总了C#中System.Windows.PropertyMetadata类的典型用法代码示例。如果您正苦于以下问题:C# PropertyMetadata类的具体用法?C# PropertyMetadata怎么用?C# PropertyMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyMetadata类属于System.Windows命名空间,在下文中一共展示了PropertyMetadata类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TestUserControl
static TestUserControl()
{
PropertyMetadata metaData;
metaData = new PropertyMetadata(Colors.Red);
ColorProperty = DependencyProperty.Register("Color", typeof(Color), typeof(TestUserControl),metaData);
}
开发者ID:DVitinnik,项目名称:UniversityApps,代码行数:7,代码来源:TestUserControl.xaml.cs
示例2: ColorPick
static ColorPick()
{
PropertyMetadata metaData;
metaData = new PropertyMetadata(Colors.Red);
ColorProperty = DependencyProperty.Register("Color", typeof(Color), typeof(ColorPick),metaData);
}
开发者ID:DVitinnik,项目名称:UniversityApps,代码行数:7,代码来源:ColorPick.xaml.cs
示例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);
}
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:25,代码来源:DependencyPropertyChangedEventArgs.cs
示例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);
}
开发者ID:GilbertTeam,项目名称:Tales-Generator,代码行数:28,代码来源:DiagramLabel.cs
示例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;
}
开发者ID:Clancey,项目名称:XamlForIphone,代码行数:8,代码来源:DependencyAttribute.cs
示例6: GetCurrentPageIndexPropetyMetadata
private static PropertyMetadata GetCurrentPageIndexPropetyMetadata()
{
PropertyMetadata pm = new PropertyMetadata();
pm.DefaultValue = 1;
pm.PropertyChangedCallback = new PropertyChangedCallback(CurrentPageIndexPropertyChanged);
return pm;
}
开发者ID:ksopyla,项目名称:blipface,代码行数:8,代码来源:Pager.xaml.cs
示例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 );
}
开发者ID:JianwenSun,项目名称:cc,代码行数:13,代码来源:DependencyPropertyKey.cs
示例8: EyeCandy
static EyeCandy()
{
//register attached dependency property
var metadata = new PropertyMetadata((ImageSource)null);
ImageProperty = DependencyProperty.RegisterAttached("Image",
typeof(ImageSource),
typeof(EyeCandy), metadata);
}
开发者ID:thinhlv,项目名称:PTTKHT_QLST,代码行数:9,代码来源:EyeCandy.cs
示例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;
}
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:10,代码来源:DependencyProperty.cs
示例10: GameManagerProperties
static GameManagerProperties()
{
PropertyChangedCallback dockingManagerChanged =
new PropertyChangedCallback(OnDockingManagerChanged);
PropertyMetadata dockingManagerMetadata =
new PropertyMetadata(null, dockingManagerChanged);
DockingManagerProperty = DependencyProperty.RegisterAttached("DockingManager",
typeof(DockingManager), typeof(GameManagerProperties), dockingManagerMetadata);
}
开发者ID:MartyIX,项目名称:SoTh,代码行数:10,代码来源:class.GameDocsProperties.cs
示例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;
}
开发者ID:Clancey,项目名称:XamlForIphone,代码行数:11,代码来源:DependencyAttribute.cs
示例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);
}
开发者ID:GilbertTeam,项目名称:Tales-Generator,代码行数:11,代码来源:DiagramNode.cs
示例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);
}
开发者ID:GilbertTeam,项目名称:Tales-Generator,代码行数:11,代码来源:DiagramEdge.cs
示例14: DependencyProperty
DependencyProperty (
string propertyName,
Type propertyType,
Type ownerType,
PropertyMetadata metadata ) {
this.Name = propertyName;
this.PropertyType = propertyType;
this.OwnerType = ownerType;
this.DefaultMetadata = metadata;
}
开发者ID:bbqchickenrobot,项目名称:WPFLight,代码行数:11,代码来源:DependencyProperty.cs
示例15: FastComboBox
public FastComboBox()
{
var propertyMetadata = new PropertyMetadata(OnItemsSource2Changed);
ItemsSource2Property = DependencyProperty.Register(
"ItemsSource2"
, typeof(IEnumerable)
, typeof(FastComboBox)
, propertyMetadata);
DefaultStyleKey = typeof(FastComboBox);
}
开发者ID:e82eric,项目名称:Prompts,代码行数:12,代码来源:FastComboBox.cs
示例16: Should_Return_Same_DependencyProperty
public void Should_Return_Same_DependencyProperty()
{
PropertyMetadata metadata1 = new PropertyMetadata("foo");
DependencyProperty dp1 = DependencyProperty.Register(
"Should_Return_Same_DependencyProperty",
typeof(string),
typeof(TestClass1),
metadata1);
DependencyProperty dp2 = dp1.AddOwner(typeof(TestClass2));
Assert.AreSame(dp1, dp2);
}
开发者ID:modulexcite,项目名称:Avalonia,代码行数:13,代码来源:DependencyPropertyTests_AddOwner.cs
示例17: Should_Not_Change_OwnerType
public void Should_Not_Change_OwnerType()
{
PropertyMetadata metadata1 = new PropertyMetadata("foo");
DependencyProperty dp = DependencyProperty.Register(
"Should_Not_Change_OwnerType",
typeof(string),
typeof(TestClass1),
metadata1);
dp.AddOwner(typeof(TestClass2));
Assert.AreEqual(typeof(TestClass1), dp.OwnerType);
}
开发者ID:modulexcite,项目名称:Avalonia,代码行数:13,代码来源:DependencyPropertyTests_AddOwner.cs
示例18: Diagram
static Diagram()
{
var xViewOffsetMd = new PropertyMetadata(0.0, OnXViewOffsetChanged);
XViewOffsetProperty = DependencyProperty.Register("XViewOffset", typeof(double), typeof(Diagram), xViewOffsetMd);
var yViewOffsetMd = new PropertyMetadata(0.0, OnYViewOffsetChanged);
YViewOffsetProperty = DependencyProperty.Register("YViewOffset", typeof(double), typeof(Diagram), yViewOffsetMd);
var scaleMd = new PropertyMetadata(1.0, OnZoomChanged);
ScaleProperty = DependencyProperty.Register("Scale", typeof(double), typeof(Diagram), scaleMd);
var scaleFactorMd = new PropertyMetadata(1.1);
ScaleFactorProperty = DependencyProperty.Register("ScaleFactor", typeof(double), typeof(Diagram), scaleFactorMd);
}
开发者ID:GilbertTeam,项目名称:Tales-Generator,代码行数:14,代码来源:Diagram.cs
示例19: DiagramItem
static DiagramItem()
{
var backgroundMd = new PropertyMetadata(new SolidColorBrush(Colors.Transparent), OnBackgroundChanged);
BackgroundProperty = DependencyProperty.Register("Background", typeof(Brush), typeof(DiagramItem), backgroundMd);
var borderPenMd = new PropertyMetadata(new Pen(Brushes.Black, 1), OnBorderPenChanged);
BorderPenProperty = DependencyProperty.Register("BorderPen", typeof(Pen), typeof(DiagramItem), borderPenMd);
var dataMd = new PropertyMetadata(null, OnDataChanged);
DataProperty = DependencyProperty.Register("Data", typeof(object), typeof(DiagramItem), dataMd);
var userDataMd = new PropertyMetadata(null, OnUserDataChanged);
UserDataProperty = DependencyProperty.Register("UserData", typeof(object), typeof(DiagramItem), userDataMd);
}
开发者ID:GilbertTeam,项目名称:Tales-Generator,代码行数:14,代码来源:DiagramItem.cs
示例20: MainWindow
static MainWindow()
{
var metadata = new PropertyMetadata(new ObservableCollection<long>
{
3,
2,
17,
20,
63553547345645653,
34563456314523431,
989956756956978671,
989956756956978673,
});
NumbersProperty = DependencyProperty.Register("Numbers", typeof(ObservableCollection<long>), typeof(MainWindow), metadata);
}
开发者ID:vcsjones,项目名称:Presentations,代码行数:15,代码来源:MainWindow.xaml.cs
注:本文中的System.Windows.PropertyMetadata类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论