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


C# Windows.DependencyPropertyKey类代码示例

本文整理汇总了C#中System.Windows.DependencyPropertyKey的典型用法代码示例。如果您正苦于以下问题:C# DependencyPropertyKey类的具体用法?C# DependencyPropertyKey怎么用?C# DependencyPropertyKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DependencyPropertyKey类属于System.Windows命名空间,在下文中一共展示了DependencyPropertyKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReverseInheritProperty

 internal ReverseInheritProperty(
     DependencyPropertyKey flagKey,
     CoreFlags flagCache,
     CoreFlags flagChanged)
     : this(flagKey, flagCache, flagChanged, CoreFlags.None, CoreFlags.None)
 {
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ReverseInheritProperty.cs

示例2: ClearValue

        /// <summary>
        /// Clears the local value of the read only property.
        /// </summary>
        /// <param name="element">The element to clear the value to.</param>
        /// <param name="key">The key for the dependency property to be cleared.</param>
        public static void ClearValue(this DependencyObject element, DependencyPropertyKey key)
        {
            if (key == null)
                return;

            try
            {
                readonlyDPThatCanBeChanged.Add(key.DependencyProperty);
                if (element != null)
                    element.ClearValue(key.DependencyProperty);
            }
            finally
            {
                readonlyDPThatCanBeChanged.Remove(key.DependencyProperty);
            }
        }
开发者ID:mparsin,项目名称:Elements,代码行数:21,代码来源:DependencyPropertyExtensions.cs

示例3: VerifyReadOnlyProperty

 private static void VerifyReadOnlyProperty(DependencyProperty dependencyProperty, DependencyPropertyKey dependencyPropertyKey)
 {
     if (dependencyProperty.IsReadOnly &&
         (dependencyPropertyKey == null || dependencyPropertyKey.DependencyProperty != dependencyProperty || !DependencyProperty.IsValidReadOnlyKey(dependencyPropertyKey)))
     {
         throw new Granular.Exception("Can't modify the read-only dependency property \"{0}\" without its key", dependencyProperty);
     }
 }
开发者ID:highzion,项目名称:Granular,代码行数:8,代码来源:DependencyObject.cs

示例4: OverrideMetadata

		public void OverrideMetadata (Type forType, PropertyMetadata typeMetadata, DependencyPropertyKey key)
		{
			if (forType == null)
				throw new ArgumentNullException ("forType");
			if (typeMetadata == null)
				throw new ArgumentNullException ("typeMetadata");


			// further checking?  should we check
			// key.DependencyProperty == this?

			typeMetadata.DoMerge (DefaultMetadata, this, forType);
			metadataByType.Add (forType, typeMetadata);
		}
开发者ID:Clancey,项目名称:XamlForIphone,代码行数:14,代码来源:DependencyAttribute.cs

示例5: FrameworkPropertyMetadata

        static ContentControl3D()
        {
            DefaultStyleKeyProperty.OverrideMetadata(
                typeof (ContentControl3D),
                new FrameworkPropertyMetadata(typeof (ContentControl3D)));

            AnimationLengthProperty =
                DependencyProperty.Register(
                    "AnimationLength",
                    typeof (int),
                    typeof (ContentControl3D),
                    new UIPropertyMetadata(600, OnAnimationLengthChanged));

            BackContentProperty = DependencyProperty.Register(
                "BackContent",
                typeof (object),
                typeof (ContentControl3D));

            BackContentTemplateProperty = DependencyProperty.Register(
                "BackContentTemplate",
                typeof (DataTemplate),
                typeof (ContentControl3D),
                new UIPropertyMetadata(null));

            IsFrontInViewPropertyKey = DependencyProperty.RegisterReadOnly(
                "IsFrontInView",
                typeof (bool),
                typeof (ContentControl3D),
                new UIPropertyMetadata(true));
            IsFrontInViewProperty = IsFrontInViewPropertyKey.DependencyProperty;
        }
开发者ID:merbla,项目名称:Kinecting,代码行数:31,代码来源:ContentControl3D.cs

示例6: TransitionControl

        static TransitionControl()
        {
            DefaultStyleKeyProperty.OverrideMetadata(
            typeof(TransitionControl),
            new FrameworkPropertyMetadata(typeof(TransitionControl)));

            TransitionEffectProperty = DependencyProperty.Register(
               "TransitionEffect",
               typeof(TransitionEffects),
               typeof(TransitionControl),
               new FrameworkPropertyMetadata(TransitionEffects.None));

            StaleContentProperty = DependencyProperty.Register(
            "StaleContent",
            typeof(Object),
            typeof(TransitionControl),
            new FrameworkPropertyMetadata(null));

            ContentControl.ContentProperty.OverrideMetadata(
            typeof(TransitionControl),
            new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnContentChanged)));

            IsContentChangedPropertyKey = DependencyProperty.RegisterReadOnly(
               "IsContentChanged",
               typeof(Boolean),
               typeof(TransitionControl),
               new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));

            IsContentChangedProperty = IsContentChangedPropertyKey.DependencyProperty;
        }
开发者ID:jasine,项目名称:KinectExplorer,代码行数:30,代码来源:TransitionControl.cs

示例7: WaitIndicator

 static WaitIndicator() {
     Type ownerType = typeof(WaitIndicator);
     DeferedVisibilityProperty = DependencyProperty.Register("DeferedVisibility", typeof(bool), ownerType, new PropertyMetadata(false, OnDeferedVisibilityPropertyChanged));
     ShowShadowProperty = DependencyProperty.Register("ShowShadow", typeof(bool), ownerType, new PropertyMetadata(true));
     ContentPaddingProperty = DependencyProperty.Register("ContentPadding", typeof(Thickness), ownerType, new PropertyMetadata(new Thickness()));
     ActualContentPropertyKey = DependencyProperty.RegisterReadOnly("ActualContent", typeof(object), ownerType, new FrameworkPropertyMetadata(null));
     ActualContentProperty = ActualContentPropertyKey.DependencyProperty;
 }
开发者ID:LINDAIS,项目名称:DevExpress.Mvvm.Free,代码行数:8,代码来源:WaitIndicators.cs

示例8: LicensePage

 /// <summary>
 /// Initializes static members of the LicensePage class.
 /// </summary>
 static LicensePage()
 {
     _MustBeShownPropertyKey = DependencyProperty.RegisterReadOnly(
         "MustBeShown",
         typeof(bool),
         typeof(LicensePage),
         new PropertyMetadata(false));
     MustBeShownProperty = _MustBeShownPropertyKey.DependencyProperty;
 }
开发者ID:erindm,项目名称:route-planner-csharp,代码行数:12,代码来源:LicensePage.xaml.cs

示例9: AutoHideChannel

        static AutoHideChannel()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(AutoHideChannel), new FrameworkPropertyMetadata(typeof(AutoHideChannel)));

            //Register Dependency Properties
            ChannelWidthProperty = DependencyProperty.RegisterReadOnly("ChannelWidth", typeof(double), typeof(AutoHideChannel), new UIPropertyMetadata(0d));
            ChannelHeightProperty = DependencyProperty.RegisterReadOnly("ChannelHeight", typeof(double), typeof(AutoHideChannel), new UIPropertyMetadata(0d));
            CurrentWindowViewProperty = DependencyProperty.RegisterReadOnly("CurrentWindowView", typeof(View), typeof(AutoHideChannel), new UIPropertyMetadata(null));
        }
开发者ID:pedone,项目名称:DockingLibrary,代码行数:9,代码来源:AutoHideChannel.cs

示例10: FormulaControl

 static FormulaControl()
 {
     var registator = new DependencyPropertyRegistator<FormulaControl>();
     FormulaProperty = registator.Register<string>("Formula", propertyChanged:FormulaChanged, coerceValueCallback:OnFormulaCoerceCallback);
     FormulaVisualPropertyKey = registator.RegisterReadOnly<DrawingVisual>("FormulaVisual");
     EditableNowPropertyKey = registator.RegisterReadOnly<bool>("EditableNow");
     FormulaVisualProperty = FormulaVisualPropertyKey.DependencyProperty;
     EditableNowProperty = EditableNowPropertyKey.DependencyProperty;
 }
开发者ID:hinduCoder,项目名称:Diploma,代码行数:9,代码来源:FormulaControl.cs

示例11: AlignPart

 static AlignPart()
 {
     AlignedPartsPropertyKey = DependencyProperty.RegisterReadOnly("AlignedParts", typeof(PartRefSet), typeof(AlignPart),
         new PropertyMetadata(default(PartRefSet),
         (o, e) =>
         {
             var _this = (AlignPart)o;
             //_this.CoerceValue(dps.TextProperty);
         }));
 }
开发者ID:hehaotian,项目名称:igt-editor,代码行数:10,代码来源:parts.cs

示例12: TransitionPresenter

        static TransitionPresenter()
        {
            FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(
                typeof(TransitionPresenter), new FrameworkPropertyMetadata(typeof(TransitionPresenter)));

            //Registering RoutedEvents and Dependency Properties
            PreviousTransitionStartedEvent = EventManager.RegisterRoutedEvent("PreviousTransitionStarted", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TransitionPresenter));
            PreviousTransitionEndedEvent = EventManager.RegisterRoutedEvent("PreviousTransitionEnded", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TransitionPresenter));
            NextTransitionStartedEvent = EventManager.RegisterRoutedEvent("NextTransitionStarted", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TransitionPresenter));
            NextTransitionEndedEvent = EventManager.RegisterRoutedEvent("NextTransitionEnded", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TransitionPresenter));
            IsSelectTransitionRunningPropertyKey = DependencyProperty.RegisterReadOnly("IsSelectTransitionRunning", typeof(bool), typeof(TransitionPresenter), new FrameworkPropertyMetadata(false, new PropertyChangedCallback(TransitionPresenter.OnIsSelectTransitionRunningChanged)));
            IsSelectTransitionRunningProperty = IsSelectTransitionRunningPropertyKey.DependencyProperty;
        }
开发者ID:AmrReda,项目名称:PixelSenseLibrary,代码行数:13,代码来源:TransitionPresenter.cs

示例13: DragDropViewInfo

		static DragDropViewInfo() {
			Type ownerType = typeof(DragDropViewInfo);
			DraggingRowsPropertyKey = DependencyPropertyManager.RegisterReadOnly("DraggingRows", typeof(IList), ownerType, new UIPropertyMetadata(null));
			DraggingRowsProperty = DraggingRowsPropertyKey.DependencyProperty;
			DropTargetTypePropertyKey = DependencyPropertyManager.RegisterReadOnly("DropTargetType", typeof(DropTargetType), ownerType, new UIPropertyMetadata(DropTargetType.None));
			DropTargetTypeProperty = DropTargetTypePropertyKey.DependencyProperty;
			DropTargetRowPropertyKey = DependencyPropertyManager.RegisterReadOnly("DropTargetRow", typeof(object), ownerType, new UIPropertyMetadata(null));
			DropTargetRowProperty = DropTargetRowPropertyKey.DependencyProperty;
			GroupInfoPropertyKey = DependencyPropertyManager.RegisterReadOnly("GroupInfo", typeof(IList<GroupInfo>), ownerType, new UIPropertyMetadata(null));
			GroupInfoProperty = GroupInfoPropertyKey.DependencyProperty;
			FirstDraggingObjectPropertyKey = DependencyPropertyManager.RegisterReadOnly("FirstDraggingObject", typeof(object), ownerType, new UIPropertyMetadata(null));
			FirstDraggingObjectProperty = FirstDraggingObjectPropertyKey.DependencyProperty;
		}
开发者ID:phanvanthanh,项目名称:QLThueBao,代码行数:13,代码来源:DragDropViewInfo.cs

示例14: QuickLink

 // Methods
 static QuickLink()
 {
     LinkProperty = DependencyProperty.Register("Link", typeof(IQuickLink), typeof(QuickLink), new PropertyMetadata((sender, args) => ((QuickLink)sender).UpdateIsDefault()));
     IsDefaultLinkPropertyKey = DependencyProperty.RegisterReadOnly("IsDefaultLink", typeof(bool), typeof(QuickLink), new PropertyMetadata(false));
     IsDefaultLinkProperty = IsDefaultLinkPropertyKey.DependencyProperty;
     StripProperty = DependencyProperty.Register("Strip", typeof(MenuStrip), typeof(QuickLink), new PropertyMetadata(delegate(DependencyObject sender, DependencyPropertyChangedEventArgs args)
     {
         QuickLink link = (QuickLink)sender;
         DependencyPropertyDescriptor descriptor = DependencyPropertyDescriptor.FromProperty(MenuStrip.DefaultLinkProperty, typeof(MenuStrip));
         if (args.OldValue != null)
         {
             descriptor.RemoveValueChanged(args.OldValue, new EventHandler(link.DefaultLinkPropertyChanged));
             MenuStrip oldValue = (MenuStrip)args.OldValue;
             oldValue.MouseEnter -= new MouseEventHandler(link.Strip_MouseEnter);
             oldValue.MouseLeave -= new MouseEventHandler(link.Strip_MouseLeave);
         }
         if (args.NewValue != null)
         {
             descriptor.AddValueChanged(args.NewValue, new EventHandler(link.DefaultLinkPropertyChanged));
             link.UpdateIsDefault();
             MenuStrip newValue = (MenuStrip)args.NewValue;
             newValue.MouseEnter += new MouseEventHandler(link.Strip_MouseEnter);
             newValue.MouseLeave += new MouseEventHandler(link.Strip_MouseLeave);
         }
     }));
     NormalisedNonFocusImageProperty = DependencyProperty.Register("NormalisedNonFocusImage", typeof(ImageSource), typeof(QuickLink));
     NonFocusImageProperty = DependencyProperty.Register("NonFocusImage", typeof(ImageSource), typeof(QuickLink), new PropertyMetadata(delegate(DependencyObject sender, DependencyPropertyChangedEventArgs args)
     {
         QuickLink link = (QuickLink)sender;
         ImageSource imageSource = (ImageSource)args.NewValue;
         ImageSource image = link.Link.Image;
         if (((imageSource != null) && (image != null)) && ((imageSource.Width != image.Width) || (imageSource.Height != image.Height)))
         {
             double x = (image.Width - imageSource.Width) / 2.0;
             double y = (image.Height - imageSource.Height) / 2.0;
             DrawingVisual visual = new DrawingVisual();
             using (DrawingContext context = visual.RenderOpen())
             {
                 context.DrawImage(imageSource, new Rect(x, y, imageSource.Width, imageSource.Height));
             }
             RenderTargetBitmap bitmap = new RenderTargetBitmap((int)image.Width, (int)image.Height, 96.0, 96.0, PixelFormats.Default);
             bitmap.Render(visual);
             link.SetValue(NormalisedNonFocusImageProperty, bitmap);
         }
         else
         {
             link.SetValue(NormalisedNonFocusImageProperty, imageSource);
         }
     }));
 }
开发者ID:kingpin2k,项目名称:MCS,代码行数:51,代码来源:QuickLink.xaml.cs

示例15: TreeGridColumnHeader

        static TreeGridColumnHeader()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(TreeGridColumnHeader), new FrameworkPropertyMetadata(typeof(TreeGridColumnHeader)));
            ContentControl.ContentTemplateProperty.OverrideMetadata(typeof(TreeGridColumnHeader), new FrameworkPropertyMetadata(new PropertyChangedCallback(PropertyChanged)));
            ContentControl.ContentTemplateSelectorProperty.OverrideMetadata(typeof(TreeGridColumnHeader), new FrameworkPropertyMetadata(new PropertyChangedCallback(PropertyChanged)));
            FrameworkElement.StyleProperty.OverrideMetadata(typeof(TreeGridColumnHeader), new FrameworkPropertyMetadata(new PropertyChangedCallback(PropertyChanged)));
            FrameworkElement.ContextMenuProperty.OverrideMetadata(typeof(TreeGridColumnHeader), new FrameworkPropertyMetadata(new PropertyChangedCallback(PropertyChanged)));
            FrameworkElement.ToolTipProperty.OverrideMetadata(typeof(TreeGridColumnHeader), new FrameworkPropertyMetadata(new PropertyChangedCallback(PropertyChanged)));
            UIElement.FocusableProperty.OverrideMetadata(typeof(TreeGridColumnHeader), new FrameworkPropertyMetadata(BooleanBoxes.False));

            ColumnPropertyKey = DependencyProperty.RegisterReadOnly("Column", typeof(TreeGridColumn), typeof(TreeGridColumnHeader), null);
            ColumnProperty = ColumnPropertyKey.DependencyProperty;
            RolePropertyKey = DependencyProperty.RegisterReadOnly("Role", typeof(TreeGridColumnHeaderRole), typeof(TreeGridColumnHeader), new FrameworkPropertyMetadata(TreeGridColumnHeaderRole.Normal));
            RoleProperty = RolePropertyKey.DependencyProperty;
        }
开发者ID:569550384,项目名称:Rafy,代码行数:15,代码来源:TreeGridColumnHeader.cs


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