本文整理汇总了C#中System.Windows.DependencyPropertyKey类的典型用法代码示例。如果您正苦于以下问题:C# DependencyPropertyKey类的具体用法?C# DependencyPropertyKey怎么用?C# DependencyPropertyKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DependencyPropertyKey类属于System.Windows命名空间,在下文中一共展示了DependencyPropertyKey类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: SetValue
[FriendAccessAllowed] // Built into Base, also used by Core and Framework.
internal void SetValue(DependencyPropertyKey dp, bool value)
{
SetValue(dp, MS.Internal.KnownBoxes.BooleanBoxes.Box(value));
}
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:5,代码来源:DependencyObject.cs
示例6: SetupPropertyChange
/// <summary>
/// Called by SetValue or ClearValue to verify that the property
/// can be changed.
/// </summary>
private PropertyMetadata SetupPropertyChange(DependencyPropertyKey key, out DependencyProperty dp)
{
if ( key != null )
{
dp = key.DependencyProperty;
if ( dp != null )
{
dp.VerifyReadOnlyKey(key);
// Get type-specific metadata for this property
return dp.GetMetadata(DependencyObjectType);
}
else
{
throw new ArgumentException(SR.Get(SRID.ReadOnlyKeyNotAuthorized, dp.Name));
}
}
else
{
throw new ArgumentNullException("key");
}
}
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:27,代码来源:DependencyObject.cs
示例7: ContainsValue
public bool ContainsValue(DependencyPropertyKey dependencyPropertyKey)
{
return ContainsValue(dependencyPropertyKey.DependencyProperty);
}
开发者ID:highzion,项目名称:Granular,代码行数:4,代码来源:DependencyObject.cs
示例8: SafeSetValue
private void SafeSetValue(DependencyPropertyKey property, object value) {
if (Dispatcher.CheckAccess()) {
SetValue(property, value);
} else {
Dispatcher.BeginInvoke((Action)(() => SetValue(property, value)));
}
}
开发者ID:RussBaz,项目名称:PTVS,代码行数:7,代码来源:AddVirtualEnvironmentView.cs
示例9: ClearValue
private void ClearValue(DependencyProperty dependencyProperty, DependencyPropertyKey dependencyPropertyKey, BaseValueSource source)
{
VerifyReadOnlyProperty(dependencyProperty, dependencyPropertyKey);
IDependencyPropertyValueEntry entry;
if (!entries.TryGetValue(dependencyProperty, out entry))
{
return;
}
IExpression expression = entry.GetBaseValue((int)source, false) as IExpression;
if (expression is IDisposable)
{
((IDisposable)expression).Dispose();
}
entry.ClearBaseValue((int)source);
entry.ClearCurrentValue();
}
开发者ID:highzion,项目名称:Granular,代码行数:19,代码来源:DependencyObject.cs
示例10: SetValue
private void SetValue(DependencyProperty dependencyProperty, DependencyPropertyKey dependencyPropertyKey, object value, bool setCurrentValue = false, BaseValueSource source = BaseValueSource.Unknown)
{
VerifyReadOnlyProperty(dependencyProperty, dependencyPropertyKey);
IExpressionProvider newExpressionProvider = value as IExpressionProvider;
if (newExpressionProvider == null && !dependencyProperty.IsValidValue(value))
{
return; // invalid value
}
IDependencyPropertyValueEntry entry = GetInitializedValueEntry(dependencyProperty);
IExpression oldExpression = setCurrentValue ?
entry.GetBaseValue(false) as IExpression : // current value may be set in the top priority expression
entry.GetBaseValue((int)source, false) as IExpression;
if (newExpressionProvider != null)
{
value = newExpressionProvider.CreateExpression(this, dependencyProperty);
}
else if (oldExpression != null && oldExpression.SetValue(value))
{
return; // value (current or not) was set in the existing expression, nothing else to do
}
if (setCurrentValue)
{
entry.SetCurrentValue(value);
return; // base value isn't changed
}
if (oldExpression is IDisposable) // expression is being replaced
{
((IDisposable)oldExpression).Dispose();
}
entry.SetBaseValue((int)source, value);
entry.ClearCurrentValue();
}
开发者ID:highzion,项目名称:Granular,代码行数:39,代码来源:DependencyObject.cs
示例11: ClearValue
/// <summary>
/// Clears the local value of a property
/// </summary>
public void ClearValue(DependencyPropertyKey key)
{
// Do not allow foreign threads to clear properties.
// (This is a noop if this object is not assigned to a Dispatcher.)
//
this.VerifyAccess();
DependencyProperty dp;
// Cache the metadata object this method needed to get anyway.
PropertyMetadata metadata = SetupPropertyChange(key, out dp);
EntryIndex entryIndex = LookupEntry(dp.GlobalIndex);
ClearValueCommon(entryIndex, dp, metadata);
}
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:19,代码来源:DependencyObject.cs
示例12: 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
示例13: 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
示例14: 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
示例15: 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
示例16: 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
示例17: 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
示例18: 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
示例19: 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
示例20: 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
注:本文中的System.Windows.DependencyPropertyKey类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论