本文整理汇总了C#中System.Windows.Controls.ContentControl.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# ContentControl.GetValue方法的具体用法?C# ContentControl.GetValue怎么用?C# ContentControl.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.ContentControl
的用法示例。
在下文中一共展示了ContentControl.GetValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOrCreateBehavior
private static SingleViewBehavior GetOrCreateBehavior(ContentControl control)
{
SingleViewBehavior behavior = control.GetValue(SingleViewBehaviorProperty) as SingleViewBehavior;
if (behavior == null)
{
behavior = new SingleViewBehavior(control);
control.SetValue(SingleViewBehaviorProperty, behavior);
}
return behavior;
}
示例2: Eval
internal static Object Eval(Object source, String pathExpression)
{
Binding binding = new Binding(pathExpression) { Source = source };
ContentControl dependencyObject = new ContentControl();
BindingOperations.SetBinding(dependencyObject, DummyProperty, binding);
return dependencyObject.GetValue(DummyProperty);
}
示例3: GetModuleInfo
public static ModuleInfo GetModuleInfo(ContentControl control)
{
return control.GetValue(ModuleInfoProperty) as ModuleInfo;
}
示例4: GetViewType
public static string GetViewType(ContentControl control)
{
return control.GetValue(ViewTypeProperty) as string;
}
示例5: AddViewPassesSameScopeByDefaultToNamedView
public void AddViewPassesSameScopeByDefaultToNamedView()
{
var regionManager = new MockRegionManager();
IRegion region = new Region();
region.RegionManager = regionManager;
var myView = new ContentControl();
region.Add(myView, "MyView");
Assert.AreSame(regionManager, myView.GetValue(RegionManager.RegionManagerProperty));
}
示例6: AddViewPassesDiferentScopeWhenAdding
public void AddViewPassesDiferentScopeWhenAdding()
{
var regionManager = new MockRegionManager();
IRegion region = new Region();
region.RegionManager = regionManager;
var myView = new ContentControl();
region.Add(myView, "MyView", true);
Assert.AreNotSame(regionManager, myView.GetValue(RegionManager.RegionManagerProperty));
}
示例7: GetSharedResources
public static ResourceUri GetSharedResources(ContentControl element)
{
return (ResourceUri)element.GetValue(SharedResourcesProperty);
}
示例8: IsNewItem
private bool IsNewItem(ContentControl child)
{
return (bool)child.GetValue(IsNewProperty);
}
示例9: DetectCollision
public bool DetectCollision(ContentControl controlOne, ContentControl controlTwo)
{
// new Rect(X1, Y1, X2, Y2);
Rect c1Rect = new Rect(
new Point(Convert.ToDouble(controlOne.GetValue(Canvas.LeftProperty)),
Convert.ToDouble(controlOne.GetValue(Canvas.TopProperty))
),
new Point(Convert.ToDouble(controlOne.GetValue(Canvas.LeftProperty)) + controlOne.ActualWidth,
Convert.ToDouble(controlOne.GetValue(Canvas.TopProperty)) + controlOne.ActualHeight
)
);
Rect c2Rect = new Rect(
new Point(Convert.ToDouble(controlTwo.GetValue(Canvas.LeftProperty)),
Convert.ToDouble(controlTwo.GetValue(Canvas.TopProperty))
),
new Point(Convert.ToDouble(controlTwo.GetValue(Canvas.LeftProperty)) + controlTwo.ActualWidth,
Convert.ToDouble(controlTwo.GetValue(Canvas.TopProperty)) + controlTwo.ActualHeight
)
);
c1Rect.Intersect(c2Rect);
return !(c1Rect == Rect.Empty);
}
示例10: GetOnSelectedTabChanged
public static bool GetOnSelectedTabChanged(ContentControl element)
{
return (bool)element.GetValue(OnDataContextChangedProperty);
}
示例11: GetContentChangedAnimation
public static Storyboard GetContentChangedAnimation(ContentControl element)
{
return (Storyboard)element.GetValue(ContentChangedAnimationProperty);
}