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


C# ItemsChangedEventArgs类代码示例

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


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

示例1: OnItemsChanged

        protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args) {
            ItemsControl itemsOwner;
            switch (args.Action) {
            case NotifyCollectionChangedAction.Remove:
            case NotifyCollectionChangedAction.Replace:
            case NotifyCollectionChangedAction.Move:
                // THE HACK
                RemoveChildRange(args.Position, args.ItemCount, args.ItemUICount);
                return;

            case NotifyCollectionChangedAction.Reset:
                itemsOwner = ItemsControl.GetItemsOwner(this);
                if (itemsOwner == null)
                    return;
                if (PreviousItemCount != itemsOwner.Items.Count) {
                    if (Orientation != Orientation.Horizontal) {
                        SetHorizontalOffset(0.0);
                        break;
                    }
                    SetVerticalOffset(0.0);
                }
                break;

            default:
                return;
            }
            var itemCount = itemsOwner.Items.Count;
            PreviousItemCount = itemCount;
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:29,代码来源:CustomVirtualizingWrapPanel.cs

示例2: ItemContainerGeneratorOnItemsChanged

 private void ItemContainerGeneratorOnItemsChanged(object sender, ItemsChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Reset)
     {
         MixListScrollViewer.ScrollToTop();
     }
 }
开发者ID:kristian-pettersen,项目名称:torshify-r4dio,代码行数:7,代码来源:MixListView.xaml.cs

示例3: ItemContainerGenerator_ItemsChanged

 void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Add)
     {
         Position item = lstPositions.Items.Last() as Position;
         location = new GeoCoordinate(item.Latitude, item.Longitude);
         mapPositions.Center = location;
         layer = new MapLayer();
         grid = new Grid();
         grid.DataContext = item;
         grid.Hold += grid_Hold;
         textBlock = new TextBlock();
         textBlock.Text = item.Counter.ToString();
         textBlock.VerticalAlignment = VerticalAlignment.Bottom;
         textBlock.HorizontalAlignment = HorizontalAlignment.Center;
         brush = new ImageBrush();
         brush.ImageSource = image;
         ellipse = new Ellipse();
         ellipse.Height = 100;
         ellipse.Width = 100;
         ellipse.Fill = brush;
         grid.Children.Add(ellipse);
         grid.Children.Add(textBlock);
         overlay = new MapOverlay();
         overlay.Content = grid;
         overlay.GeoCoordinate = location;
         layer.Add(overlay);
         mapPositions.Layers.Add(layer);
     }
 }
开发者ID:JorgeCupi,项目名称:SmartGuard,代码行数:30,代码来源:BroadcastView.xaml.cs

示例4: OnItemsChangedItemContainerGenerator

		void OnItemsChangedItemContainerGenerator(object sender, ItemsChangedEventArgs e)
		{
			ItemsControl ic = ItemsControl.ItemsControlFromItemContainer(item);

			if (null == ic)
				return;
			item.SetValue(IsLastOneProperty, ic.ItemContainerGenerator.IndexFromContainer(item) == ic.Items.Count - 1);
		}
开发者ID:vosen,项目名称:UAM.TextProcessing,代码行数:8,代码来源:TVIExtender.cs

示例5: ModifyModelActionOnItemsChanged

 private void ModifyModelActionOnItemsChanged(object sender, ItemsChangedEventArgs e){
     foreach (var itemChangesType in e.ChangedItemsInfo.Where(pair => pair.Value==ChoiceActionItemChangesType.Add)){
         var choiceActionItem = itemChangesType.Key as ChoiceActionItem;
         if (choiceActionItem != null && choiceActionItem.Id==ModifyModelActionChoiceItemsUpdater.ChangeViewModel) {
             choiceActionItem.Active.BeginUpdate();
             choiceActionItem.Active["ModelNotConfigured"] = ((IModelViewConfigurationView)View.Model).ConfigurationView != null;
             choiceActionItem.Active.EndUpdate();
         }
     }
 }
开发者ID:derjabkin,项目名称:eXpand,代码行数:10,代码来源:ModelConfigurationController.cs

示例6: OnItemsChangedInternal

		void OnItemsChangedInternal (object sender, ItemsChangedEventArgs args)
 		{
			InvalidateMeasure ();
			if (args.Action == NotifyCollectionChangedAction.Reset) {
				Children.Clear ();
				ItemContainerGenerator.RemoveAll ();
				OnClearChildren ();
			}

			OnItemsChanged (sender, args);
 		}
开发者ID:dfr0,项目名称:moon,代码行数:11,代码来源:VirtualizingPanel.cs

示例7: OnItemsChanged

 void OnItemsChanged(object sender, ItemsChangedEventArgs itemsChangedEventArgs) {
     var changedItemsInfo = itemsChangedEventArgs.ChangedItemsInfo;
     foreach (var actionItemChangesType in changedItemsInfo) {
         if (actionItemChangesType.Key is ChoiceActionItem && actionItemChangesType.Value == ChoiceActionItemChangesType.Add) {
             var choiceActionItem = ((ChoiceActionItem)actionItemChangesType.Key);
             var transition = choiceActionItem.Data as ITransition;
             if (transition != null)
                 choiceActionItem.Active["Permission"] = !IsGranted(transition.TargetState);
         }
     }
 }
开发者ID:paulute,项目名称:eXpand,代码行数:11,代码来源:StatePermissionController.cs

示例8: OnItemsChanged

 protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)
 {
     switch (args.Action)
     {
         case NotifyCollectionChangedAction.Move:
         case NotifyCollectionChangedAction.Remove:
         case NotifyCollectionChangedAction.Replace:
             RemoveInternalChildRange(args.Position.Index, args.ItemUICount);
             break;
     }
     base.OnItemsChanged(sender, args);
 }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:12,代码来源:PilePanel.cs

示例9: AddNodeActionOnItemsChanged

 void AddNodeActionOnItemsChanged(object sender, ItemsChangedEventArgs itemsChangedEventArgs) {
     var singleChoiceAction = (sender) as SingleChoiceAction;
     if (singleChoiceAction != null && (singleChoiceAction.Id == "Add" && itemsChangedEventArgs.ChangedItemsInfo.Values.Contains(ChoiceActionItemChangesType.ItemsAdd))) {
         if (CurrentModelNode.ModelNode.GetType().Name == "ModelLogicRules") {
             var modelTreeListNode = CurrentModelNode.Parent;
             for (int i = singleChoiceAction.Items.Count - 1; i > -1; i--) {
                 var value = modelTreeListNode.ModelNode.Id.Replace("Conditional", "");
                 if (!singleChoiceAction.Items[i].Id.StartsWith(value))
                     singleChoiceAction.Items.RemoveAt(i);
             }
         }
     }
 }
开发者ID:kevin3274,项目名称:eXpand,代码行数:13,代码来源:ModelEditorViewController.cs

示例10: AddNodeActionOnItemsChanged

 void AddNodeActionOnItemsChanged(object sender, ItemsChangedEventArgs itemsChangedEventArgs) {
     var singleChoiceAction = (sender) as SingleChoiceAction;
     if ((singleChoiceAction != null && singleChoiceAction.Id == "Add") && (itemsChangedEventArgs.ChangedItemsInfo.Values.Contains(ChoiceActionItemChangesType.ItemsAdd | ChoiceActionItemChangesType.ItemsRemove))) {
         string name = CurrentModelNode.ModelNode.GetType().Name;
         switch (name) {
             case "ModelLogicRules":
                 FilterModelLogicRules(singleChoiceAction);
                 break;
             case "ModelBOModelClassMembers":
                 EnableBOModelClassMembersAddMenu();
                 break;
         }
     }
 }
开发者ID:dimajanzen,项目名称:eXpand,代码行数:14,代码来源:ModelEditorViewController.cs

示例11: ItemsChanged

 /// <summary>
 /// Event handler for the items changed event
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">A <see cref="ItemsChangedEventArgs"/> that contains the event data.</param>
 private static void ItemsChanged(object sender, ItemsChangedEventArgs e)
 {
     ItemsControl control;
     if (itemsControls.TryGetValue(sender, out control))
     {
         if (ShouldShowWatermark(control))
         {
             ShowWatermark(control);
         }
         else
         {
             RemoveWatermark(control);
         }
     }
 }
开发者ID:GlxSeg,项目名称:SEGClone,代码行数:20,代码来源:WatermarkService.cs

示例12: ItemContainerGeneratorOnItemsChanged

 private void ItemContainerGeneratorOnItemsChanged(object sender, ItemsChangedEventArgs itemsChangedEventArgs)
 {
     //throw new NotImplementedException();
 }
开发者ID:CensoredHF,项目名称:Snappie,代码行数:4,代码来源:DragablzItemsControl.cs

示例13: singleChoiceAction_ItemsChanged

 private void singleChoiceAction_ItemsChanged(object sender, ItemsChangedEventArgs e)
 {
     if ((
         from a in e.ChangedItemsInfo.Values
         where a == ChoiceActionItemChangesType.Items
         select a).Count<ChoiceActionItemChangesType>() > 0)
     {
         this.ItemChanged(this, ChoiceActionItemChangesType.Items);
     }
 }
开发者ID:LSTANCZYK,项目名称:devexpress_xaf_aurum,代码行数:10,代码来源:ActionMenuItem.cs

示例14: OnItemsMove

 private void OnItemsMove(ItemsChangedEventArgs args)
 {
     RemoveChildRange(args.OldPosition, args.ItemCount, args.ItemUICount);
 }
开发者ID:pusp,项目名称:o2platform,代码行数:4,代码来源:DataGridCellsPanel.cs

示例15: OnItemsChanged

 		protected override void OnItemsChanged (object sender, ItemsChangedEventArgs args)
 		{
			base.OnItemsChanged (sender, args);
			IItemContainerGenerator generator = ItemContainerGenerator;
			ItemsControl owner = ItemsControl.GetItemsOwner (this);
			int index, offset, viewable, delta;
			
			switch (args.Action) {
			case NotifyCollectionChangedAction.Add:
				// The following logic is meant to keep the current viewable items in view
				// after adjusting for added items.
				index = generator.IndexFromGeneratorPosition (args.Position);
				if (Orientation == Orientation.Horizontal)
					offset = (int) HorizontalOffset;
				else
					offset = (int) VerticalOffset;
				
				if (index <= offset) {
					// items have been added earlier in the list than what is viewable
					offset += args.ItemCount;
				}
				
				if (Orientation == Orientation.Horizontal)
					SetHorizontalOffset (offset);
				else
					SetVerticalOffset (offset);
				break;
			case NotifyCollectionChangedAction.Remove:
				// The following logic is meant to keep the current viewable items in view
				// after adjusting for removed items.
				index = generator.IndexFromGeneratorPosition (args.Position);
				if (Orientation == Orientation.Horizontal) {
					offset = (int) HorizontalOffset;
					viewable = (int) ViewportWidth;
				} else {
					viewable = (int) ViewportHeight;
					offset = (int) VerticalOffset;
				}
				
				if (index < offset) {
					// items earlier in the list than what is viewable have been removed
					offset = Math.Max (offset - args.ItemCount, 0);
				}
				
				// adjust for items removed in the current view and/or beyond the current view
				offset = Math.Min (offset, owner.Items.Count - viewable);
				offset = Math.Max (offset, 0);
				
				if (Orientation == Orientation.Horizontal)
					SetHorizontalOffset (offset);
				else
					SetVerticalOffset (offset);
				
				RemoveInternalChildRange (args.Position.Index, args.ItemUICount);
				break;
			case NotifyCollectionChangedAction.Replace:
				RemoveInternalChildRange (args.Position.Index, args.ItemUICount);
				break;
			case NotifyCollectionChangedAction.Reset:
				// DO NOTHING
				break;
			}
			
			InvalidateMeasure ();
			
			if (ScrollOwner != null)
				ScrollOwner.InvalidateScrollInfo ();
 		}
开发者ID:shana,项目名称:moon,代码行数:68,代码来源:VirtualizingStackPanel.cs


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