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


C# ListBox.GetValue方法代码示例

本文整理汇总了C#中System.Windows.Controls.ListBox.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# ListBox.GetValue方法的具体用法?C# ListBox.GetValue怎么用?C# ListBox.GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.ListBox的用法示例。


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

示例1: SetHasBindableSelectedItems

 public static void SetHasBindableSelectedItems(ListBox source, bool value)
 {
     SelectionChangedHandler Handler = (SelectionChangedHandler)source.GetValue(SelectionChangedHandlerProperty);
     if (value && Handler == null)
     {
         Handler = new SelectionChangedHandler(source);
         source.SetValue(SelectionChangedHandlerProperty, Handler);
     }
     else if (!value && Handler != null)
     { source.ClearValue(SelectionChangedHandlerProperty); }
 }
开发者ID:gitter-badger,项目名称:myManga,代码行数:11,代码来源:ListBoxExtentions.cs

示例2: GetOrCreateBehavior

        private static SelectedItemsBehavior GetOrCreateBehavior(ListBox target, IList list)
        {
            var behavior = target.GetValue(SelectedItemsBehaviorProperty) as SelectedItemsBehavior;
            if (behavior == null)
            {
                behavior = new SelectedItemsBehavior(target, list);
                target.SetValue(SelectedItemsBehaviorProperty, behavior);
            }

            return behavior;
        }
开发者ID:Jitlee,项目名称:WPFMonitor,代码行数:11,代码来源:MutiListBox.cs

示例3: GetOrCreateBehavior

        private static ListSelectCommandBehavior GetOrCreateBehavior(ListBox selector)
        {
            var behavior = selector.GetValue(SelectCommandBehaviorProperty) as ListSelectCommandBehavior;
            if (behavior == null)
            {
                behavior = new ListSelectCommandBehavior(selector);
                selector.SetValue(SelectCommandBehaviorProperty, behavior);
            }

            return behavior;
        }
开发者ID:JohnDMathis,项目名称:Pippin,代码行数:11,代码来源:ListSelect.cs

示例4: SetAutoScroll

 public static void SetAutoScroll(ListBox instance, bool value)
 {
     var oldHandler = (AutoScrollHandler)instance.GetValue(AutoScrollHandlerProperty);
     if (oldHandler != null)
     {
         oldHandler.Dispose();
         instance.SetValue(AutoScrollHandlerProperty, null);
     }
     instance.SetValue(AutoScrollProperty, value);
     if (value)
         instance.SetValue(AutoScrollHandlerProperty, new AutoScrollHandler(instance));
 }
开发者ID:leo90skk,项目名称:qdms,代码行数:12,代码来源:ListBoxExt.cs

示例5: GetOrCreateBehavior

        private static ListBoxSelectionChangedCommandBehavior GetOrCreateBehavior(ListBox ListBox)
        {
            ListBoxSelectionChangedCommandBehavior behavior =
            ListBox.GetValue(SelectCommandBehaviorProperty) as ListBoxSelectionChangedCommandBehavior;

              if (behavior == null)
              {
            behavior = new ListBoxSelectionChangedCommandBehavior(ListBox);
            ListBox.SetValue(SelectCommandBehaviorProperty, behavior);
              }
              return behavior;
        }
开发者ID:mohankumarcm,项目名称:sse554-project3,代码行数:12,代码来源:ListBoxSelect.cs

示例6: GetChangedHandler

 private static ListChangedHandler GetChangedHandler(ListBox obj)
 {
     return (ListChangedHandler)obj.GetValue(ChangedHandlerProperty);
 }
开发者ID:Boddlnagg,项目名称:WordsLive,代码行数:4,代码来源:Activator.cs

示例7: GetIsActivatable

 public static bool GetIsActivatable(ListBox obj)
 {
     return (bool)obj.GetValue(IsActivatableProperty);
 }
开发者ID:Boddlnagg,项目名称:WordsLive,代码行数:4,代码来源:Activator.cs

示例8: GetItems

 public static IList GetItems(ListBox listBox)
 {
     return listBox.GetValue(ItemsProperty) as IList;
 }
开发者ID:pmacn,项目名称:VoiceRecorder.WP8,代码行数:4,代码来源:SelectedItemsBehavior.cs

示例9: GetIsListboxItemBringIntoView

 public static bool GetIsListboxItemBringIntoView(ListBox listBox)
 {
     return (bool)listBox.GetValue(IsListboxItemBringIntoViewProperty);
 }
开发者ID:powernick,项目名称:CodeLib,代码行数:4,代码来源:ListBoxBehavior.cs

示例10: GetIsSelectedItemScrolledIntoView

 public static bool GetIsSelectedItemScrolledIntoView(ListBox listBox)
 {
     return (bool)listBox.GetValue(IsSelectedItemScrolledIntoViewProperty);
 }
开发者ID:ichengzi,项目名称:SharpDevelop,代码行数:4,代码来源:ListBoxBehaviour.cs

示例11: DragStarted

        private void DragStarted(ListBox listbox)
        {
            listbox.ClearValue(IsDownProperty); // SetValue to false would also work.

            // Add the bound item, available as DraggingElement, to a DataObject, however we see fit.
            Artist draggingElement = (Artist)listbox.GetValue(DraggingElementProperty);
            DataObject d = new DataObject(DataFormats.Dif, draggingElement);
            DragDropEffects effects = DragDrop.DoDragDrop(listbox, d, DragDropEffects.Copy);
            if ((effects & DragDropEffects.Move) != 0)
            {
                // Move rather than copy, so we should remove from bound list.
                DataList<Artist> collection = (DataList<Artist>)listbox.ItemsSource;
                collection.Remove(draggingElement);
            }
        }
开发者ID:nexus49,项目名称:grado,代码行数:15,代码来源:MediaLibraryArtist.xaml.cs

示例12: GetCenterSelectedItemOnLoad

 public static bool GetCenterSelectedItemOnLoad(ListBox ListBox)
 {
     return (bool)ListBox.GetValue(CenterSelectedItemOnLoadProperty);
 }
开发者ID:ptownsend1984,项目名称:SampleApplications,代码行数:4,代码来源:ControlExtensions.cs

示例13: GetAutoScroll

 public static bool GetAutoScroll(ListBox instance)
 {
     return (bool)instance.GetValue(AutoScrollProperty);
 }
开发者ID:leo90skk,项目名称:qdms,代码行数:4,代码来源:ListBoxExt.cs

示例14: GetIsAutoCenterItem

 public static bool GetIsAutoCenterItem(ListBox element)
 {
     return (bool)element.GetValue(IsAutoCenterItemProperty);
 }
开发者ID:ptownsend1984,项目名称:SampleApplications,代码行数:4,代码来源:ControlExtensions.cs

示例15: GetCommand

 /// <summary>
 /// Retrieves the <see cref="ICommand"/> attached to the <see cref="TextBox"/>.
 /// </summary>
 /// <param name="selector">TextBox containing the Command dependency property</param>
 /// <returns>The value of the command attached</returns>
 public static ICommand GetCommand(ListBox selector)
 {
     return selector.GetValue(CommandProperty) as ICommand;
 }
开发者ID:JohnDMathis,项目名称:Pippin,代码行数:9,代码来源:ListSelect.cs


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