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


C# ListView.SetValue方法代码示例

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


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

示例1: AddNewPanel

 public Panel AddNewPanel()
 {
     ListView newLV = new ListView();
     ComboBox newCB = new ComboBox();
     panels.Add(new Panel(newCB, newLV));
     newLV.Style = Resources["PanelListView"] as Style;
     newLV.ItemContainerStyle = Resources["PanelListViewItem"] as Style; ;
     GridView columns = new GridView();
     columns.Columns.Add(AddGridViewColumn( "Name", "Name"));
     columns.Columns.Add(AddGridViewColumn( "Type", "Extension"));
     columns.Columns.Add(AddGridViewColumn( "Size", "Length"));
     columns.Columns.Add(AddGridViewColumn( "Date of creation", "CreationTime"));
     newLV.View = columns;
     newLV.Loaded += PanelInitialized;
     newCB.Style = Resources["DrivesComboBox"] as Style;
     ColumnDefinition newColumn = new ColumnDefinition();
     newColumn.Width = new GridLength(1, GridUnitType.Star);
     PanelsGrid.ColumnDefinitions.Add(newColumn);
     newLV.SetValue(Grid.RowProperty, 1);
     newLV.SetValue(Grid.ColumnProperty, numOfPanels);
     newCB.SetValue(Grid.RowProperty, 0);
     newCB.SetValue(Grid.ColumnProperty, numOfPanels);
     PanelsGrid.Children.Add(newLV);
     PanelsGrid.Children.Add(newCB);
     AddDrivesInComboBox(newCB);
     newCB.SelectionChanged += DiskChanged;
     return panels[numOfPanels++];
 }
开发者ID:pseudowolfvn,项目名称:FileManager,代码行数:28,代码来源:MainWindow.xaml.cs

示例2: PrepareWeekGrid

        private void PrepareWeekGrid()
        {

            for (int i = 0; i < 4; i++)//Creating listviews where we will display Timesatmps for rows
            {
                ListView list = new ListView();
                //Little bit of tinkering with properties to get desired result;
                list.SetValue(ScrollViewer.HorizontalScrollBarVisibilityProperty, ScrollBarVisibility.Disabled);
                Label timelabel = new Label();//We will display timestamp on this label
                timelabel.Content = TimePeriodToString((timeperiod)i);//setting
                list.Items.Add(timelabel);//adding label to listview
                TimeStamps.Children.Add(list);//Adding listview to grid;
            }

            Label[] weekDayLabels = new Label[7];//Labels for dispaly weekday name
            List<DayOfWeek> customday = new List<DayOfWeek>();// reshuffling weekady enum to set monday as first day of week
            foreach (DayOfWeek day in Enum.GetValues(typeof(DayOfWeek))
                              .OfType<DayOfWeek>()
                              .ToList()//monday is second day by default
                              .Skip(1))//so we skip sunday 
            {
                customday.Add(day);//adding 
            }
            customday.Add(DayOfWeek.Sunday);//and add sunday as last

            for (int i = 0; i < weekDayLabels.Length; i++)//Placing all the labels at grid;
            {
                weekDayLabels[i] = new Label();
                weekDayLabels[i].Background = Brushes.LightBlue;
                weekDayLabels[i].Content = customday.ElementAt(i).ToString();//With appropriate day name;(This will correspond to actual date-weekday)
                DayLabels.Children.Add(weekDayLabels[i]);

            }
        }
开发者ID:McArren,项目名称:GymApp,代码行数:34,代码来源:MainWindow.xaml.cs

示例3: GetOrCreateBehavior

        private static ListViewResizeBehavior GetOrCreateBehavior(ListView element)
        {
            var behavior = element.GetValue(GridViewColumnResizeBehaviorProperty) as ListViewResizeBehavior;
              if (behavior == null) {
            behavior = new ListViewResizeBehavior(element);
            element.SetValue(ListViewResizeBehaviorProperty, behavior);
              }

              return behavior;
        }
开发者ID:sakya,项目名称:wpfmpdclient,代码行数:10,代码来源:GridViewColumnResize.cs

示例4: LoadedModulesPad

		public LoadedModulesPad()
		{
			var res = new CommonResources();
			res.InitializeComponent();
			
			listView = new ListView();
			listView.View = (GridView)res["loadedModulesGridView"];
			listView.SetValue(GridViewColumnAutoSize.AutoWidthProperty, "50%;70;50%;35;120");
			
			WindowsDebugger.RefreshingPads += RefreshPad;
			RefreshPad();
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:12,代码来源:LoadedModulesPad.cs

示例5: AddListView

        public void AddListView(IEnumerable<Core.Fragment> ie, int colIndex)
        {
            if (mainGrid != null)
            {
                ListView lv = new ListView();
                lv.SetValue(Grid.ColumnProperty, colIndex);
                lv.SetValue(Grid.RowProperty, 1);

                ComboBox cmb = new ComboBox();
                cmb.SetValue(Grid.ColumnProperty, colIndex);
                cmb.SetValue(Grid.RowProperty, 0);
                cmb.SelectionChanged += Cmb_SelectionChanged;
                Associate(lv, cmb);

                mainGrid.Children.Add(cmb);
                mainGrid.Children.Add(lv);

                lv.ItemsSource = ie;
                listViews.Insert(colIndex, lv);
                RefreshMetaKeys(cmb, lv);
                lv.UpdateLayout();
            }
        }
开发者ID:BBuchholz,项目名称:NineWorldsDeep,代码行数:23,代码来源:WorkbenchListViewsController.cs

示例6: CallStackPad

		public CallStackPad()
		{
			var res = new CommonResources();
			res.InitializeComponent();
			
			listView = new ListView();
			listView.View = (GridView)res["callstackGridView"];
			listView.MouseDoubleClick += listView_MouseDoubleClick;
			listView.SetValue(GridViewColumnAutoSize.AutoWidthProperty, "100%");
			
			listView.ContextMenu = CreateMenu();
			
			WindowsDebugger.RefreshingPads += RefreshPad;
			RefreshPad();
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:15,代码来源:CallStackPad.cs

示例7: ThreadsPad

		public ThreadsPad()
		{
			var res = new CommonResources();
			res.InitializeComponent();
			
			ContextMenu contextMenu = new ContextMenu();
			contextMenu.Opened += FillContextMenuStrip;
			
			listView = new ListView();
			listView.View = (GridView)res["threadsGridView"];
			listView.ContextMenu = contextMenu;
			listView.MouseDoubleClick += listView_MouseDoubleClick;
			listView.SetValue(GridViewColumnAutoSize.AutoWidthProperty, "70;100%;75;75");
			
			WindowsDebugger.RefreshingPads += RefreshPad;
			RefreshPad();
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:17,代码来源:ThreadsPad.cs

示例8: SetAutoScrollToSelectedItem

 public static void SetAutoScrollToSelectedItem(ListView element, bool value)
 {
     element.SetValue(AutoScrollToSelectedItemProperty, value);
 }
开发者ID:grarup,项目名称:SharpE,代码行数:4,代码来源:ListViewHelper.cs

示例9: SetCurrentSortColumn

		public static void SetCurrentSortColumn(ListView listView, SortableGridViewColumn value) {
			listView.SetValue(CurrentSortColumnProperty, value);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:3,代码来源:SortableGridViewColumn.cs

示例10: SetSortDirection

		public static void SetSortDirection(ListView listView, ColumnSortDirection value) {
			listView.SetValue(SortDirectionProperty, value);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:3,代码来源:SortableGridViewColumn.cs

示例11: SetSortMode

		public static void SetSortMode(ListView listView, ListViewSortMode value) {
			listView.SetValue(SortModeProperty, value);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:3,代码来源:SortableGridViewColumn.cs

示例12: UpdateChat

        private void UpdateChat(object sender, ElapsedEventArgs e)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(async () =>
            {
                if (Client.CurrentStatus != StatusBox.Text && StatusBox.Text != "Set your status message")
                    Client.CurrentStatus = StatusBox.Text;
                else if (StatusBox.Text == "Set your status message")
                    Client.CurrentStatus = "Online";

                Settings.Default.StatusMsg = StatusBox.Text;
                Settings.Default.Save();
                if (!Client.UpdatePlayers)
                    return;

                Client.UpdatePlayers = false;

                ChatListView.Children.Clear();

                #region "Groups"
                while (!Client.loadedGroups)
                {
                    await Task.Delay(1000);
                }
                foreach (Group g in Client.Groups)
                {
                    var playersListView = new ListView
                    {
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        VerticalContentAlignment = VerticalAlignment.Stretch
                    };
                    playersListView.SetValue(ScrollViewer.HorizontalScrollBarVisibilityProperty,
                        ScrollBarVisibility.Disabled);
                    playersListView.Foreground = Brushes.White;
                    playersListView.Background = null;
                    playersListView.BorderBrush = null;
                    playersListView.MouseDoubleClick += PlayersListView_MouseDoubleClick;
                    playersListView.SelectionChanged += ChatListView_SelectionChanged;
                    playersListView.PreviewMouseWheel += PlayersListView_PreviewMouseWheel;

                    int players = 0;

                    foreach (var chatPlayerPair in Client.AllPlayers.ToArray().OrderBy(u => u.Value.Username))
                    {
                        var player = new ChatPlayer
                        {
                            Tag = chatPlayerPair.Value,
                            DataContext = chatPlayerPair.Value,
                            ContextMenu = (ContextMenu)Resources["PlayerChatMenu"],
                            PlayerName = { Content = chatPlayerPair.Value.Username },
                            LevelLabel = { Content = chatPlayerPair.Value.Level }
                        };

                        var bc = new BrushConverter();
                        var brush = (Brush)bc.ConvertFrom("#FFFFFFFF");
                        player.PlayerStatus.Content = chatPlayerPair.Value.Status;
                        player.PlayerStatus.Foreground = brush;

                        if (chatPlayerPair.Value.IsOnline && g.GroupName == chatPlayerPair.Value.Group)
                        {
                            player.Width = 250;
                            bc = new BrushConverter();
                            brush = (Brush)bc.ConvertFrom("#FFFFFFFF");
                            player.PlayerStatus.Foreground = brush;
                            string UriSource = Path.Combine(Client.ExecutingDirectory, "Assets", "profileicon",
                                chatPlayerPair.Value.ProfileIcon + ".png");
                            player.ProfileImage.Source = Client.GetImage(UriSource);

                            if (chatPlayerPair.Value.GameStatus != "outOfGame")
                            {
                                switch (chatPlayerPair.Value.GameStatus)
                                {
                                    case "inGame":
                                        champions inGameChamp = champions.GetChampion(chatPlayerPair.Value.Champion);
                                        if (inGameChamp != null)
                                            player.PlayerStatus.Content = "In Game as " + inGameChamp.displayName;
                                        else
                                            player.PlayerStatus.Content = "In Game";
                                        break;
                                    case "hostingPracticeGame":
                                        player.PlayerStatus.Content = "Creating Custom Game";
                                        break;
                                    case "inQueue":
                                        player.PlayerStatus.Content = "In Queue";
                                        break;
                                    case "spectating":
                                        player.PlayerStatus.Content = "Spectating";
                                        break;
                                    case "championSelect":
                                        player.PlayerStatus.Content = "In Champion Select";
                                        break;
                                    case "hostingRankedGame":
                                        player.PlayerStatus.Content = "Creating Ranked Game";
                                        break;
                                    case "teamSelect":
                                        player.PlayerStatus.Content = "In Team Select";
                                        break;
                                    case "hostingNormalGame":
                                        player.PlayerStatus.Content = "Creating Normal Game";
                                        break;
                                    case "hostingCoopVsAIGame":
//.........这里部分代码省略.........
开发者ID:osiato,项目名称:LegendaryClient,代码行数:101,代码来源:FriendList.xaml.cs

示例13: SetSortAtHeaderClick

 /// <summary>
 /// Setzt den Wert der angefügten SortAtHeaderClick Abhängigkeitseigenschaft für eine bestimmte <see cref="System.Windows.Controls.ListView"/>.
 /// </summary>
 /// <param name="lv">Die <see cref="System.Windows.Controls.ListView"/> deren Wert gesetzt werdne soll.</param>
 /// <param name="value">Der zu setzende Wert. <c>true</c> wenn das Sortierren des ListViews erlaubt ist; andernfalls <c>false</c></param>
 public static void SetSortAtHeaderClick(ListView lv, bool value)
 {
     lv.SetValue(SortAtHeaderClickProperty, value);
 }
开发者ID:Koopakiller,项目名称:School,代码行数:9,代码来源:ListViewSort.cs

示例14: SetCanUserSortColumns

 public static void SetCanUserSortColumns(ListView element, bool value)
 {
     element.SetValue(CanUserSortColumnsProperty, value);
 }
开发者ID:vincenthamm,项目名称:ATF,代码行数:4,代码来源:GridViewSortBehavior.cs

示例15: SetShowSortGlyph

 public static void SetShowSortGlyph(ListView obj, bool value)
 {
     obj.SetValue(ShowSortGlyphProperty, value);
 }
开发者ID:GAMP,项目名称:DataInterfaces,代码行数:4,代码来源:GridViewBehavior.cs


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