• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ItemsChangedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: OnItemsChanged

		protected override void OnItemsChanged (object sender, ItemsChangedEventArgs args)
		{
			if (OnItemsChangedAction != null)
				OnItemsChangedAction ();
			base.OnItemsChanged (sender, args);
		}
开发者ID:kangaroo,项目名称:moon,代码行数:6,代码来源:ItemContainerGeneratorTest_Panel.cs


示例17: OnItemsChanged

        /// <summary>
        ///     Called when the Items collection associated with the containing ItemsControl changes.
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="args">Event arguments</param>
        protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)
        {
            base.OnItemsChanged(sender, args);

            switch (args.Action)
            {
                case NotifyCollectionChangedAction.Remove:
                    OnItemsRemove(args);
                    break;

                case NotifyCollectionChangedAction.Replace:
                    OnItemsReplace(args);
                    break;

                case NotifyCollectionChangedAction.Move:
                    OnItemsMove(args);
                    break;

                case NotifyCollectionChangedAction.Reset:
                    break;
            }
        }
开发者ID:pusp,项目名称:o2platform,代码行数:27,代码来源:DataGridCellsPanel.cs


示例18: ShouldItemsChangeAffectLayoutCore

 /// <summary>
 ///     Returns whether an Items collection change affects layout for this panel.
 /// </summary>
 /// <param name="args">Event arguments</param>
 /// <param name="areItemChangesLocal">Says if this notification represents a direct change to this Panel's collection</param>
 protected virtual bool ShouldItemsChangeAffectLayoutCore(bool areItemChangesLocal, ItemsChangedEventArgs args)
 {
     return true;
 }
开发者ID:salim18,项目名称:DemoProject2,代码行数:9,代码来源:VirtualizingPanel.cs


示例19: ItemContainerGenerator_ItemsChanged

 static void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
 {
     RefreshWidth(sender as ItemsControl);
 }
开发者ID:squaredinfinity,项目名称:Foundation,代码行数:4,代码来源:UniformItemsSize.cs


示例20: OnItemsChanged

        protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)
        {
            CalculateItemSizes();

            base.OnItemsChanged(sender, args);
        }
开发者ID:TomGillen,项目名称:MBT,代码行数:6,代码来源:PanoramaPanel.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ItemsControl类代码示例发布时间:2022-05-24
下一篇:
C# Items类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap