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