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


C# Primitives.Selector类代码示例

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


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

示例1: SelectorAutomationPeer

		protected SelectorAutomationPeer (Selector owner) : base (owner)
		{
			owner.SelectionChanged += (o, e) => {
				// Selection Pattern Automation Events
				// - CanSelectMultiple and IsSelectionRequired not raised because value doesn't change/
				// - Selection.SelectionProperty:
				RaisePropertyChangedEvent (SelectionPatternIdentifiers.SelectionProperty,
				                           GetProviderArrayFromPeer (oldSelectedPeer),
							   GetProviderArrayFromPeer (GetSelectedAutomationPeer ()));

				// SelectionItem Pattern Automation Events
				// (Only raising SelectionItemPatternOnElementSelected because Selector 
				//  supports one selected item)
				if (oldSelectedPeer != null) // Old Selected Item
					oldSelectedPeer.RaisePropertyChangedEvent (SelectionItemPatternIdentifiers.IsSelectedProperty,
					                                           true, 
										   false);
				oldSelectedPeer = GetSelectedAutomationPeer ();
				if (oldSelectedPeer != null) { // New Selected Item
					oldSelectedPeer.RaisePropertyChangedEvent (SelectionItemPatternIdentifiers.IsSelectedProperty,
					                                           false, 
										   true);
					oldSelectedPeer.RaiseAutomationEvent (AutomationEvents.SelectionItemPatternOnElementSelected);
				}
			};
			oldSelectedPeer = GetSelectedAutomationPeer ();
		}
开发者ID:dfr0,项目名称:moon,代码行数:27,代码来源:SelectorAutomationPeer.cs

示例2: AttachBehaviors

        protected override void AttachBehaviors(IRegion region, Selector regionTarget)
        {
            base.AttachBehaviors(region, regionTarget);

            OutlookBarPublishBehavior behavior = new OutlookBarPublishBehavior(regionTarget, eventAggregator);
            behavior.Attach();
        }
开发者ID:jfromaniello,项目名称:prismcontrib,代码行数:7,代码来源:OutlookBarControlRegionAdapter.cs

示例3: GetCommandParameter

        public static object GetCommandParameter(Selector selector)
        {
            if (selector == null)
                throw new ArgumentNullException("selector");

            return selector.GetValue(CommandParameterProperty);
        }
开发者ID:resnikb,项目名称:GitWorkflows,代码行数:7,代码来源:SelectionChanged.cs

示例4: GetValueBySelectedItem

 /// <summary>
 /// </summary>
 /// <param name="listView"> </param>
 /// <param name="key"> </param>
 private static string GetValueBySelectedItem(Selector listView, string key)
 {
     var type = listView.SelectedItem.GetType();
     var property = type.GetProperty(key);
     return property.GetValue(listView.SelectedItem, null)
                    .ToString();
 }
开发者ID:hjsb0629,项目名称:ffxivapp-plugin-event,代码行数:11,代码来源:MainViewModel.cs

示例5: SetCommand

        public static void SetCommand(Selector selector, ICommand command)
        {
            if (selector == null)
                throw new ArgumentNullException("selector");

            selector.SetValue(CommandProperty, command);
        }
开发者ID:resnikb,项目名称:GitWorkflows,代码行数:7,代码来源:SelectionChanged.cs

示例6: CreateEditor

 protected override UIElement CreateEditor()
 {
     Selector = CreateSelector();
     Selector.VerticalAlignment = VerticalAlignment.Center;
     Selector.SelectionChanged += Selector_SelectionChanged;
     return Selector;
 }
开发者ID:ondrej11,项目名称:o106,代码行数:7,代码来源:SelectorPropertyEditor.cs

示例7: SetCommandParameter

        public static void SetCommandParameter(Selector selector, object parameter)
        {
            if (selector == null)
                throw new ArgumentNullException("selector");

            selector.SetValue(CommandParameterProperty, parameter);
        }
开发者ID:resnikb,项目名称:GitWorkflows,代码行数:7,代码来源:SelectionChanged.cs

示例8: Adapt

        protected override void Adapt(IRegion region, Selector regionTarget)
        {
            if (!(regionTarget is OutlookBarControl))
                throw new ArgumentException(Resources.RegionTargetNotValidException);

            base.Adapt(region, regionTarget);
        }
开发者ID:jfromaniello,项目名称:prismcontrib,代码行数:7,代码来源:OutlookBarControlRegionAdapter.cs

示例9: GetCommand

        public static ICommand GetCommand(Selector selector)
        {
            if (selector == null)
                throw new ArgumentNullException("selector");

            return selector.GetValue(CommandProperty) as ICommand;
        }
开发者ID:resnikb,项目名称:GitWorkflows,代码行数:7,代码来源:SelectionChanged.cs

示例10: DecrementSelection

 private void DecrementSelection(Selector itemsSelector)
 {
     if (itemsSelector.Items == null || !itemsSelector.HasItems || itemsSelector.SelectedIndex <= 0)
     {
         return;
     }
     itemsSelector.SelectedIndex--;
 }
开发者ID:iXab3r,项目名称:WpfAutoCompleteControls,代码行数:8,代码来源:SelectionAdapter.cs

示例11: SelectTabItem

 private static void SelectTabItem(Selector tabControl, object tabItemHeader)
 {
     if (tabItemHeader == null) return;
     foreach (var tabItem in tabControl.Items.Cast<object>().Where(item => item.GetType() == typeof (TabItem)).Cast<TabItem>().Where(tabItem => Equals(tabItem.Header, tabItemHeader)))
     {
         tabControl.SelectedItem = tabItem;
     }
 }
开发者ID:KH8,项目名称:PlcAgent,代码行数:8,代码来源:MainWindow.xaml.cs

示例12: ItemCommand

 public ItemCommand(Selector selector, EventHandler<ItemCanExecuteEventArgs> canExecute, EventHandler<ItemExecutedEventArgs> executed)
 {
     if (selector == null)
         throw new ArgumentNullException("selector");
     Selector = selector;
     Selector.SelectionChanged += Selector_SelectionChanged;
     Executed = executed;
     canExecuteHandler = canExecute;
 }
开发者ID:liny4cn,项目名称:ComBoost,代码行数:9,代码来源:ItemCommand.cs

示例13: SetFocus

		public static void SetFocus(Selector selector, object obj, DispatcherPriority prio) {
			selector.Dispatcher.BeginInvoke(prio, new Action(() => {
				if (selector.SelectedItem == obj) {
					var item = selector.ItemContainerGenerator.ContainerFromItem(obj) as IInputElement;
					if (item != null)
						item.Focus();
				}
			}));
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:UIUtils.cs

示例14: SelectedItemsSync

 public SelectedItemsSync (Selector selector, IList modelSelectedItems)
 {
     if (!(selector is MultiSelector) && !(selector is ListBox))
         throw new ArgumentException(ErrorUnsupportedSelectorType.Fmt(Selector.GetTypeFullName()), "selector");
     if (modelSelectedItems != null && !(modelSelectedItems is INotifyCollectionChanged))
         throw new ArgumentException("Selected items collection must implement INotifyCollectionChanged", "modelSelectedItems");
     Selector = selector;
     _modelSelectedItems = modelSelectedItems;
     AttachSelectedItems();
 }
开发者ID:binki,项目名称:Alba.Framework,代码行数:10,代码来源:SelectorProps.cs

示例15: TryCleanUpOldItem

        private static void TryCleanUpOldItem(Selector selector)
        {
            selector.SelectionChanged -= SelectorSelectionChanged;  // Remove a previously added event handler.

            var item = multiSelectorWithObservableList.FirstOrDefault(x => x.Item1.Selector == selector);
            if (item == null) { return; }

            multiSelectorWithObservableList.Remove(item);
            CollectionChangedEventManager.RemoveHandler(item.Item2, ListCollectionChanged);    
        }
开发者ID:electrobreath,项目名称:musicmanager,代码行数:10,代码来源:SelectionBehavior.cs


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