本文整理汇总了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++];
}
示例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]);
}
}
示例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;
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例8: SetAutoScrollToSelectedItem
public static void SetAutoScrollToSelectedItem(ListView element, bool value)
{
element.SetValue(AutoScrollToSelectedItemProperty, value);
}
示例9: SetCurrentSortColumn
public static void SetCurrentSortColumn(ListView listView, SortableGridViewColumn value) {
listView.SetValue(CurrentSortColumnProperty, value);
}
示例10: SetSortDirection
public static void SetSortDirection(ListView listView, ColumnSortDirection value) {
listView.SetValue(SortDirectionProperty, value);
}
示例11: SetSortMode
public static void SetSortMode(ListView listView, ListViewSortMode value) {
listView.SetValue(SortModeProperty, value);
}
示例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":
//.........这里部分代码省略.........
示例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);
}
示例14: SetCanUserSortColumns
public static void SetCanUserSortColumns(ListView element, bool value)
{
element.SetValue(CanUserSortColumnsProperty, value);
}
示例15: SetShowSortGlyph
public static void SetShowSortGlyph(ListView obj, bool value)
{
obj.SetValue(ShowSortGlyphProperty, value);
}