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


C# Controls.UIElementCollection类代码示例

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


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

示例1: TreeGridViewRowPresenter

		public TreeGridViewRowPresenter()
		{
			_childs = new UIElementCollection(this, this);
			DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty(ColumnsProperty, typeof(TreeGridViewRowPresenter));
			if (dpd != null)
				dpd.AddValueChanged(this, (s, e) => EnsureLines());
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:TreeGridViewRowPresenter.cs

示例2: SudokuCell

        public SudokuCell(UIElementCollection panel, int bsize, SudokuBoard sb)
        {
            this.sb = sb;
            this.bsize = bsize;
            this.children = new List<SudokuCell>();
            this.panel = panel;
            isLeaf = false;
            int size = bsize * bsize;
            int bss = size * size;
            int[] data = new int[bss];
            for (var i = 0; i < bss; i++) data[i] = i;

            for (var i = 0; i < bsize; i++)
            {
                for (var j = 0; j < bsize; j++)
                {
                    var t = new List<int>();
                    for (var k = i * bsize; k < (i + 1) * bsize; k++)
                    {
                        for (var l = j * bsize; l < (j + 1) * bsize; l++)
                        {
                            t.Add(data[k * size + l]);
                        }
                    }
                    var sc = new SudokuCell(this.panel, t.ToArray(), j, i, bsize, sb);
                    children.Add(sc);
                }
            }
        }
开发者ID:vabc3,项目名称:KarSudoku,代码行数:29,代码来源:SudokuCell.cs

示例3: AddPasswordBox

 private static void AddPasswordBox(
     UIElementCollection labelCollection, UIElementCollection inputCollection,
     UIElementCollection checkBoxCollection,
     string content, object dataContext, string key, int index)
 {
     var viewModel = (INotifyPropertyChanged)dataContext;
     labelCollection.Add(new Label() { Content = content });
     var control = new PasswordBox() { DataContext = dataContext, TabIndex = index };
     var parameters = (IDictionary<string, string>)((dynamic)dataContext).Dictionary;
     control.Password = parameters[key];
     PropertyChangedEventHandler onSourceChanged = (sender, e) =>
     {
         if (e.PropertyName != key)
         {
             return;
         }
         if (control.Password == parameters[key])
         {
             return;
         }
         control.Password = parameters[key];
     };
     viewModel.PropertyChanged += onSourceChanged;
     control.PasswordChanged += (sender, e) =>
     {
         if (parameters[key] != control.Password)
         {
             parameters[key] = control.Password;
         }
     };
     control.Unloaded += (sender, e) => viewModel.PropertyChanged -= onSourceChanged;
     inputCollection.Add(new UserControl() { Content = control });
     checkBoxCollection.Add(new FrameworkElement());
 }
开发者ID:gitter-badger,项目名称:pecastarter5,代码行数:34,代码来源:ComponentFactory.cs

示例4: ItemCount

        public static double ItemCount(CalendarAppointmentItem currentApp, UIElementCollection children)
        {
            double count = 0;
            foreach (UIElement child in children)
            {
                if (child is CalendarAppointmentItem)
                {
                    var currentChild = child as CalendarAppointmentItem;

                    var cStart = currentApp.GetValue(TimeSlotPanel.StartTimeProperty) as DateTime?;
                    var cEnd = currentApp.GetValue(TimeSlotPanel.EndTimeProperty) as DateTime?;
                    var toTest = new DateRange(cStart.Value, cEnd.Value);

                    var aStart = currentChild.GetValue(TimeSlotPanel.StartTimeProperty) as DateTime?;
                    var aEnd = currentChild.GetValue(TimeSlotPanel.EndTimeProperty) as DateTime?;
                    var current = new DateRange(aStart.Value, aEnd.Value);

                    if (toTest.Overlaps(current))
                    {
                        count++;
                    }
                }
            }
            return count;
        }
开发者ID:seniorOtaka,项目名称:ndoctor,代码行数:25,代码来源:Overlapping.cs

示例5: Draw

 public void Draw(UIElementCollection children)
 {
     foreach (SingleVortex sv in reds)
         children.Add(sv);
     foreach (SingleVortex sv in blues)
         children.Add(sv);
 }
开发者ID:verbatium,项目名称:KinectFish,代码行数:7,代码来源:Vortices.cs

示例6: ElementMovOrRes

		public ElementMovOrRes(CommandStack commandStack, UIElementCollection selection, Rect newrect, Rect oldrect, int editingOperationCount)
			: base(commandStack) {
			_selection = selection;
			_newrect = newrect;
			_oldrect = oldrect;
			_editingOperationCount = editingOperationCount;
		}
开发者ID:paradoxfm,项目名称:ledx2,代码行数:7,代码来源:UndoInkElement.cs

示例7: Draw

        public void Draw(UIElementCollection children)
        {
            if (!isAlive)
                return;

            DateTime cur = DateTime.Now;

            foreach (var segment in segments)
            {
                PlayerUtils.Segment seg = segment.Value.GetEstimatedSegment(cur);
                if (seg.IsCircle())
                {
                    var circle = new Ellipse();
                    circle.Width = seg.radius * 2;
                    circle.Height = seg.radius * 2;
                    circle.SetValue(Canvas.LeftProperty, seg.x1 - seg.radius);
                    circle.SetValue(Canvas.TopProperty, seg.y1 - seg.radius);
                    circle.Stroke = brJoints;
                    circle.StrokeThickness = 1;
                    circle.Fill = brBones;
                    children.Add(circle);
                }
            }

            // Remove unused players after 1/2 second.
            if (DateTime.Now.Subtract(lastUpdated).TotalMilliseconds > 500)
                isAlive = false;
        }
开发者ID:grazulis,项目名称:KinectRainbowSynth,代码行数:28,代码来源:Player.cs

示例8: AddAllStrokesAtOriginalIndex

		private void AddAllStrokesAtOriginalIndex(UIElementCollection toBeAdded) {
			foreach (UIElement elm in toBeAdded) {
				//int strokeIndex = (int)elm.GetPropertyData(STROKE_INDEX_PROPERTY);
				//if (strokeIndex > _commandStack.StrokeCollection.Count)
				//  strokeIndex = _commandStack.StrokeCollection.Count;
				_commandStack.ElementCollection.Add(elm);
			}
		}
开发者ID:paradoxfm,项目名称:ledx2,代码行数:8,代码来源:UndoInkElement.cs

示例9: Viewport3DDecorator

 /// <summary>
 /// Creates the Viewport3DDecorator
 /// </summary>
 public Viewport3DDecorator()
 {
     // create the two lists of children
     _preViewportChildren = new UIElementCollection(this, this);
     _postViewportChildren = new UIElementCollection(this, this);
             
     // no content yet
     _content = null;
 }           
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:12,代码来源:Viewport3DDecorator.cs

示例10: Viewport3DDecorator

        /// <summary>
        /// Initializes a new instance of the <see cref="Viewport3DDecorator"/> class. 
        ///     Creates the Viewport3DDecorator
        /// </summary>
        protected Viewport3DDecorator()
        {
            // create the two lists of children
            this._preViewportChildren = new UIElementCollection(this, this);
            this._postViewportChildren = new UIElementCollection(this, this);

            // no content yet
            this._content = null;
        }
开发者ID:tddold,项目名称:High-Quality-Code-Homeworks,代码行数:13,代码来源:Viewport3DDecorator.cs

示例11: ElementAddOrRem

		public ElementAddOrRem(CommandStack commandStack, InkCanvasEditingMode editingMode,
			UIElementCollection added, UIElementCollection removed, int editingOperationCount)
			: base(commandStack) {
			_editingMode = editingMode;

			_added = added;
			_removed = removed;

			_editingOperationCount = editingOperationCount;
		}
开发者ID:paradoxfm,项目名称:ledx2,代码行数:10,代码来源:UndoInkElement.cs

示例12: SetBlocksMouseEvent

 private void SetBlocksMouseEvent( UIElementCollection collection )
 {
     foreach ( UIElement block in collection )
     {
         //block.PreviewMouseLeftButtonDown += new MouseButtonEventHandler( m_dragController.OnPreviewMouseLeftButtonDown );
         block.MouseLeftButtonDown += new MouseButtonEventHandler( m_dragController.OnPreviewMouseLeftButtonDown );
         block.PreviewMouseMove += new MouseEventHandler( m_dragController.OnPreviewMouseMove );
         //block.MouseMove += new MouseEventHandler( m_dragController.OnMouseMove );
         block.PreviewMouseLeftButtonUp += new MouseButtonEventHandler( m_dragController.OnPreviewMouseUp );
     }
 }
开发者ID:yoursalary,项目名称:EPL,代码行数:11,代码来源:MainWindow.xaml.cs

示例13: getBloodType

 private BloodType getBloodType(UIElementCollection radioButtonList)
 {
     //convert the selected radioButton to a BloodType
     BloodType b = BloodType.O;
     foreach (RadioButton r in radioButtonList)
     {
         if ((bool)r.IsChecked)
             b = (BloodType)Enum.Parse(typeof(BloodType), r.Content.ToString());
     }
     return b;
 }
开发者ID:reubencummins,项目名称:AssignmentsEtc,代码行数:11,代码来源:MainWindow.xaml.cs

示例14: AddTextBox

 private static void AddTextBox(
     UIElementCollection labelCollection, UIElementCollection inputCollection,
     UIElementCollection checkBoxCollection,
     string labelText, object dataContext, string key, int tabIndex)
 {
     labelCollection.Add(new Label() { Content = labelText });
     var control = new TextBox() { DataContext = dataContext, TabIndex = tabIndex };
     control.SetBinding(TextBox.TextProperty, new Binding(key));
     inputCollection.Add(new UserControl() { Content = control });
     checkBoxCollection.Add(new FrameworkElement());
 }
开发者ID:gitter-badger,项目名称:pecastarter5,代码行数:11,代码来源:ComponentFactory.cs

示例15: CalculateHeightOfColumn

        /// <summary>
        /// Calculates the height of column.
        /// </summary>
        /// <param name="i">The starting point.</param>
        /// <param name="startOfColumnElementIndex">Start index of the of column element.</param>
        /// <param name="endOfColumnElementIndex">End index of the of column element.</param>
        /// <param name="children">The children.</param>
        /// <returns></returns>
        public static int CalculateHeightOfColumn(int i, int[] startOfColumnElementIndex, int[] endOfColumnElementIndex, UIElementCollection children)
        {
            var thisColHeight = 0;
            for (var j = startOfColumnElementIndex[i]; j <= endOfColumnElementIndex[i]; j++)
            {
                var height = (int)children[j].DesiredSize.Height;
                thisColHeight += height;
            }

            return thisColHeight;
        }
开发者ID:FoundOPS,项目名称:server,代码行数:19,代码来源:DynamicWrapPanelTools.cs


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