本文整理汇总了C#中System.Windows.FrameworkPropertyMetadata类的典型用法代码示例。如果您正苦于以下问题:C# FrameworkPropertyMetadata类的具体用法?C# FrameworkPropertyMetadata怎么用?C# FrameworkPropertyMetadata使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FrameworkPropertyMetadata类属于System.Windows命名空间,在下文中一共展示了FrameworkPropertyMetadata类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerticalPanel
static VerticalPanel()
{
//tell DP sub system, this DP, will affect
//Arrange and Measure phases
var metadata = new FrameworkPropertyMetadata {AffectsArrange = true, AffectsMeasure = true};
ColumnBreakBeforeProperty = DependencyProperty.RegisterAttached("ColumnBreakBefore",typeof(bool), typeof(VerticalPanel),metadata);
}
示例2: MainWindow
static MainWindow()
{
FrameworkPropertyMetadata metadata = new FrameworkPropertyMetadata();
metadata.Inherits = true;
SpaceProperty = SpaceButton.SpaceProperty.AddOwner(typeof(MainWindow));
SpaceProperty.OverrideMetadata(typeof(Window), metadata);
}
示例3: FixedPage
//--------------------------------------------------------------------
//
// Constructors
//
//---------------------------------------------------------------------
#region Constructors
static FixedPage()
{
FrameworkPropertyMetadata metadata = new FrameworkPropertyMetadata(FlowDirection.LeftToRight, FrameworkPropertyMetadataOptions.AffectsParentArrange);
metadata.CoerceValueCallback = new CoerceValueCallback(CoerceFlowDirection);
FlowDirectionProperty.OverrideMetadata(typeof(FixedPage), metadata);
// This puts the origin always at the top left of the page and prevents mirroring unless this is overridden.
}
示例4: CustomDrawnElement
static CustomDrawnElement()
{
FrameworkPropertyMetadata metadata = new FrameworkPropertyMetadata(Colors.Yellow);
metadata.AffectsRender = true;
BackgroundColorProperty = DependencyProperty.Register("BackgroundColor",
typeof(Color), typeof(CustomDrawnElement), metadata);
}
示例5: LixeiraProperty
static LixeiraProperty()
{
var metadata = new FrameworkPropertyMetadata((ImageSource)null);
ImageProperty = DependencyProperty.RegisterAttached("Image",
typeof(ImageSource),
typeof(LixeiraProperty), metadata);
}
示例6: ControlBehaviors
static ControlBehaviors()
{
//register dependency property
FrameworkPropertyMetadata md = new FrameworkPropertyMetadata(null, DragsWindowPropertyChanged);
DragsWindowProperty = DependencyProperty.RegisterAttached("DragsWindow",
typeof(Window), typeof(ControlBehaviors), md);
}
示例7: OriginElement
public OriginElement()
{
FrameworkPropertyMetadata meta = new FrameworkPropertyMetadata();
meta.AffectsRender = true;
OriginProperty = DependencyProperty.Register("Origin", typeof(Point), typeof(OriginElement), meta);
}
示例8: MaskedTextBox
/// <summary>
/// Static Constructor
/// </summary>
static MaskedTextBox()
{
//override the meta data for the Text Proeprty of the textbox
FrameworkPropertyMetadata metaData = new FrameworkPropertyMetadata();
metaData.CoerceValueCallback = ForceText;
TextProperty.OverrideMetadata(typeof(MaskedTextBox), metaData);
}
示例9: Should_Merge_Metadata_If_Supplied
public void Should_Merge_Metadata_If_Supplied()
{
FrameworkPropertyMetadata metadata1 = new FrameworkPropertyMetadata(
"foo",
FrameworkPropertyMetadataOptions.Inherits,
this.PropertyChangedCallback1,
this.CoerceCallback1);
DependencyProperty dp = DependencyProperty.Register(
"Should_Merge_Metadata_If_Supplied",
typeof(string),
typeof(TestClass1),
metadata1);
FrameworkPropertyMetadata metadata2 = new FrameworkPropertyMetadata(
"bar",
FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.AffectsRender,
this.PropertyChangedCallback2,
this.CoerceCallback2);
dp.AddOwner(typeof(TestClass2), metadata2);
FrameworkPropertyMetadata result = dp.GetMetadata(typeof(TestClass2)) as FrameworkPropertyMetadata;
Assert.IsNotNull(result);
Assert.AreNotSame(metadata1, result);
Assert.AreSame(metadata2, result);
Assert.AreEqual("bar", result.DefaultValue);
Assert.IsTrue(result.Inherits);
Assert.IsTrue(result.AffectsRender);
Assert.AreEqual(2, result.PropertyChangedCallback.GetInvocationList().Length);
Assert.AreEqual(1, result.CoerceValueCallback.GetInvocationList().Length);
}
示例10: SpaceButton
static SpaceButton() {
FrameworkPropertyMetadata metadata = new FrameworkPropertyMetadata();
metadata.DefaultValue = 0;
metadata.PropertyChangedCallback += OnSpacePropertyChanged;
metadata.Inherits = true;
SpaceProperty = DependencyProperty.Register("Space", typeof(int), typeof(SpaceButton), metadata, ValidateSpaceValue);
}
示例11: TabControlExtension
static TabControlExtension()
{
//register attached dependency property
var metadata = new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Red));
HeaderBackgroundProperty = DependencyProperty.RegisterAttached("HeaderBackground",
typeof (Brush),
typeof (TabControlExtension), metadata);
}
示例12: TitleMenu
static TitleMenu()
{
//register attached dependency property
var metadata = new FrameworkPropertyMetadata((object)null);
ContentProperty = DependencyProperty.RegisterAttached("Content",
typeof(object),
typeof(TitleMenu), metadata);
}
示例13: ImageSourceDep
static ImageSourceDep()
{
//register attached dependency property
var metadata = new FrameworkPropertyMetadata((ImageSource) null);
ImageProperty = DependencyProperty.RegisterAttached("Image",
typeof (ImageSource),
typeof(ImageSourceDep), metadata);
}
示例14: WrapBreakPanel
static WrapBreakPanel()
{
FrameworkPropertyMetadata metadata = new FrameworkPropertyMetadata();
metadata.AffectsArrange = true;
metadata.AffectsMeasure = true;
LineBreakBeforeProperty = DependencyProperty.RegisterAttached("LineBreakBefore", typeof(bool), typeof(WrapBreakPanel), metadata);
}
示例15: ObtieneImagen
static ObtieneImagen()
{
var metadata = new FrameworkPropertyMetadata((ImageSource) null);
ImageProperty = DependencyProperty.RegisterAttached("Image",
typeof(ImageSource),
typeof(ObtieneImagen),
metadata);
}