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


C# Rectangle.SetBinding方法代码示例

本文整理汇总了C#中Rectangle.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.SetBinding方法的具体用法?C# Rectangle.SetBinding怎么用?C# Rectangle.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rectangle的用法示例。


在下文中一共展示了Rectangle.SetBinding方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetRangeRectangle

 internal Rectangle GetRangeRectangle()
 {
     RangeRect = new Rectangle();
     Binding fillBinding = new Binding();
     fillBinding.Source = this;
     fillBinding.Path = new PropertyPath("Fill");
     RangeRect.SetBinding(Rectangle.FillProperty, fillBinding);
     return RangeRect;
 }
开发者ID:jcw-,项目名称:sparrowtoolkit,代码行数:9,代码来源:QualitativeRange.cs

示例2: MeasureOverride

        protected override Size MeasureOverride(Size availableSize)
        {
            base.MeasureOverride(availableSize);
            var rows = (int)Math.Ceiling(availableSize.Height / TileSize);
            var cols = (int)Math.Ceiling(availableSize.Width / TileSize);

            var cellCount = rows * cols;

            if (this.Children.Count < cellCount || this.Children.Count > cellCount)
            {
                var missingItems = rows * cols - this.Children.Count;
                for (int i = 0; i < missingItems; i++)
                {
                    var rectangle = new Rectangle();
                    rectangle.SetBinding(Rectangle.FillProperty, new Binding() { Source = this, Path = new PropertyPath("Fill") });
                    this.Children.Add(rectangle);
                }
                if (missingItems < 0)
                {
                    for (int i = 0; i > missingItems; i--)
                    {
                        this.Children.Remove(this.Children.Last());
                    }
                }
            }

            foreach (var item in Children)
            {
                item.Measure(new Size(TileSize, TileSize));
            }
            return availableSize;
        }
开发者ID:notour,项目名称:WygwamToolkit,代码行数:32,代码来源:TileTexturePanel.cs

示例3: GetMeasureElement

 internal Rectangle GetMeasureElement()
 {
     MeasureElement = new Rectangle();
     Binding fillBinding = new Binding();
     fillBinding.Source = this;
     fillBinding.Path = new PropertyPath("Fill");
     MeasureElement.SetBinding(Rectangle.FillProperty, fillBinding);
     return MeasureElement;
 }
开发者ID:jcw-,项目名称:sparrowtoolkit,代码行数:9,代码来源:PerformanceMeasure.cs

示例4: OnApplyTemplate

		public override void OnApplyTemplate()
#endif
        {
            base.OnApplyTemplate();

            SampleSelector = GetTemplateChild(SampleSelectorName) as Grid;
            SelectedHueColor = GetTemplateChild(SelectedHueColorName) as Rectangle;

            var body = GetTemplateChild(BodyName) as Grid;

            if (body != null)
            {
                _monitor = new MovementMonitor();
                _monitor.Movement += _monitor_Movement;
                _monitor.MonitorControl(body);
            }

            ColorSlider = GetTemplateChild(ColorSliderName) as ColorSlider;

            if (ColorSlider != null)
            {
                if (Thumb == null)
                    Thumb = new ColorSliderThumb();

                ColorSlider.ColorChanged += ColorSlider_ColorChanged;

                if(SelectedHueColor != null)
                {
#if WINDOWS_STORE || WINDOWS_PHONE_APP
                    var binding = new Windows.UI.Xaml.Data.Binding();
#elif WINDOWS_PHONE
			        var binding = new System.Windows.Data.Binding();
#endif
                    binding.Source = ColorSlider;
                    binding.Path = new PropertyPath("SolidColorBrush");

                    SelectedHueColor.SetBinding(Shape.FillProperty, binding);
                }
            }
        }
开发者ID:selaromdotnet,项目名称:Coding4FunToolkit,代码行数:40,代码来源:ColorPicker.cs


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