当前位置: 首页>>代码示例>>C#>>正文


C# Windows.PropertyMetadata类代码示例

本文整理汇总了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);
        }
开发者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


注:本文中的System.Windows.PropertyMetadata类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。