當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。