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


C# ContentControl.GetValue方法代码示例

本文整理汇总了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;
        }
开发者ID:neurosoup,项目名称:mymoon,代码行数:11,代码来源:SingleView.cs

示例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);
 }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:7,代码来源:DataMapping.cs

示例3: GetModuleInfo

 public static ModuleInfo GetModuleInfo(ContentControl control)
 {
     return control.GetValue(ModuleInfoProperty) as ModuleInfo;
 }
开发者ID:neurosoup,项目名称:mymoon,代码行数:4,代码来源:SingleView.cs

示例4: GetViewType

 public static string GetViewType(ContentControl control)
 {
     return control.GetValue(ViewTypeProperty) as string;
 }
开发者ID:neurosoup,项目名称:mymoon,代码行数:4,代码来源:SingleView.cs

示例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));
        }
开发者ID:selvendiranj,项目名称:compositewpf-copy,代码行数:11,代码来源:RegionFixture.cs

示例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));
        }
开发者ID:selvendiranj,项目名称:compositewpf-copy,代码行数:11,代码来源:RegionFixture.cs

示例7: GetSharedResources

 public static ResourceUri GetSharedResources(ContentControl element)
 {
     return (ResourceUri)element.GetValue(SharedResourcesProperty);
 }
开发者ID:JohanLarsson,项目名称:Gu.Wpf.SharedResources,代码行数:4,代码来源:SharedResourceDictionary.cs

示例8: IsNewItem

 private bool IsNewItem(ContentControl child)
 {
     return (bool)child.GetValue(IsNewProperty);
 }
开发者ID:weiqiyiji,项目名称:Gymnastika,代码行数:4,代码来源:AnimatedListPanel.cs

示例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);
        }
开发者ID:BrianJVarley,项目名称:Side_Scroller_Mini_Game,代码行数:25,代码来源:MainPage.xaml.cs

示例10: GetOnSelectedTabChanged

 public static bool GetOnSelectedTabChanged(ContentControl element)
 {
     return (bool)element.GetValue(OnDataContextChangedProperty);
 }
开发者ID:gjhwssg,项目名称:MahApps.Metro,代码行数:4,代码来源:ReloadBehavior.cs

示例11: GetContentChangedAnimation

 public static Storyboard GetContentChangedAnimation(ContentControl element)
 {
     return (Storyboard)element.GetValue(ContentChangedAnimationProperty);
 }
开发者ID:fantasticswallow,项目名称:SylphyHorn,代码行数:4,代码来源:ContentControlHelper.cs


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