本文整理汇总了C#中System.Windows.Controls.ListView类的典型用法代码示例。如果您正苦于以下问题:C# ListView类的具体用法?C# ListView怎么用?C# ListView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListView类属于System.Windows.Controls命名空间,在下文中一共展示了ListView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.ProgramsMenuAppsView = ((System.Windows.Controls.ListView)(target));
return;
case 2:
this.InstalledAppsView = ((System.Windows.Controls.ListView)(target));
return;
case 3:
#line 106 "..\..\AppGrabberUI.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SkipWizard);
#line default
#line hidden
return;
case 4:
#line 112 "..\..\AppGrabberUI.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
示例2: FocusListView
public static void FocusListView(ListView view)
{
if (!view.IsVisible)
view.IsVisibleChanged += view_IsVisibleChanged;
else
FocusListViewInternal(view);
}
示例3: AddOption
private void AddOption(ListView listview, string optionName, object obj, string propertyName)
{
ConfigClasses.EquipmentConfig config = Manager.ConfigManager.Instance.Config;
if (config.OptionSettingList == null)
config.OptionSettingList = new FALibrary.Utility.SerializableDictionary<string, ConfigClasses.OptionSetting>();
if (config.OptionSettingList.ContainsKey(propertyName) == false)
config.OptionSettingList.Add(propertyName, new ConfigClasses.OptionSetting());
ConfigClasses.OptionSetting optionSetting = config.OptionSettingList[propertyName];
optionSetting.Source = obj;
optionSetting.Descriptoin = optionName;
CheckBox checkBoxUse = CreateCheckBox(obj, propertyName);
CheckBox checkBoxEnabledValueChecking = CreateCheckBox(optionSetting, "EnabledValueChecking");
CheckBox checkBoxCorrectValue = CreateCheckBox(optionSetting, "CorrectValue");
listview.Items.Add(new
{
CheckBoxUse = checkBoxUse,
Name = optionName,
ValueChecking = checkBoxEnabledValueChecking,
CorrectValue = checkBoxCorrectValue,
Self = this
});
OptionManager.Instance.SetOptionList();
}
示例4: ImagePage
public ImagePage(ListView parentList)
{
_parentList = parentList;
InitializeComponent();
UpdateImageFromParent();
_parentList.SelectionChanged += _parentList_SelectionChanged;
}
示例5: OnApplyTemplate
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_ItemsView = (ListView)GetTemplateChild("PART_ItemsView");
_ItemsView.SelectionMode = SelectionMode.Multiple;
}
示例6: checkFile
//checks if the safe file settings.txt exists.
//if it exists, viewing content in the listview
//if not, creating a new one
public void checkFile(ListView listView)
{
try
{
//getting the text out of the .txt
string[] lines = File.ReadAllLines("settings.txt");
for (int i = 0; i < lines.Length;)
{
//fill the Item with needed values
var extractedIcon = System.Drawing.Icon.ExtractAssociatedIcon(lines[i + 1]);
var bmSrc = Imaging.CreateBitmapSourceFromHIcon(
extractedIcon.Handle,
Int32Rect.Empty,
System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
extractedIcon.Dispose();
Item item = new Item(bmSrc, lines[i], lines[i+1]);
//adding Item to ListView
listView.Items.Add(item);
i += 2;
}
}
//if the file does not exist, creating a new one
catch (FileNotFoundException e)
{
File.Create("settings.txt");
}
}
示例7: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 13 "..\..\MainWindow.xaml"
((System.Windows.Controls.TreeView)(target)).SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler<object>(this.SelectedDirectoryChanged);
#line default
#line hidden
return;
case 2:
this.listViewFiles = ((System.Windows.Controls.ListView)(target));
#line 22 "..\..\MainWindow.xaml"
this.listViewFiles.ContextMenuOpening += new System.Windows.Controls.ContextMenuEventHandler(this.listViewFiles_ContextMenuOpening);
#line default
#line hidden
#line 22 "..\..\MainWindow.xaml"
this.listViewFiles.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.listViewFiles_MouseDown);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
示例8: ImageListView
public ImageListView(ListView lstImage)
{
// TODO: Complete member initialization
this.lstImage = lstImage;
this.initImageList();
spyer.ImageListView = this;
}
示例9: OnInitialized
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
_errorList = Content as ListView;
}
示例10: BuildDockingLayout
void BuildDockingLayout()
{
dockManager.Content = null;
//TreeView dockable content
var trv = new TreeView();
trv.Items.Add(new TreeViewItem() { Header = "Item1" });
trv.Items.Add(new TreeViewItem() { Header = "Item2" });
trv.Items.Add(new TreeViewItem() { Header = "Item3" });
trv.Items.Add(new TreeViewItem() { Header = "Item4" });
((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = "SubItem1" });
((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = "SubItem2" });
((TreeViewItem)trv.Items[1]).Items.Add(new TreeViewItem() { Header = "SubItem3" });
((TreeViewItem)trv.Items[2]).Items.Add(new TreeViewItem() { Header = "SubItem4" });
var treeviewContent = new DockableContent() { Title = "Explorer", Content = trv };
treeviewContent.Show(dockManager, AnchorStyle.Bottom);
//TextBox invo dockable content
var treeviewInfoContent = new DockableContent() { Title = "Explorer Info", Content = new TextBox() { Text = "Explorer Info Text", IsReadOnly = true } };
treeviewContent.ContainerPane.Items.Add(treeviewInfoContent);
//ListView dockable content
var gridView = new GridView();
gridView.Columns.Add(new GridViewColumn() { Header = "Date" });
gridView.Columns.Add(new GridViewColumn() { Header = "Day Of Weeek", DisplayMemberBinding = new Binding("DayOfWeek") });
gridView.Columns.Add(new GridViewColumn() { Header = "Year", DisplayMemberBinding = new Binding("Year") });
gridView.Columns.Add(new GridViewColumn() { Header = "Month", DisplayMemberBinding = new Binding("Month") });
gridView.Columns.Add(new GridViewColumn() { Header = "Second", DisplayMemberBinding = new Binding("Second") });
var listView = new ListView() { View = gridView };
listView.Items.Add(DateTime.Now);
listView.Items.Add(DateTime.Now.AddYears(-1));
listView.Items.Add(DateTime.Now.AddMonths(15));
listView.Items.Add(DateTime.Now.AddHours(354));
var listViewContent = new DockableContent() { Title = "Date & Times", Content = listView };
listViewContent.ShowAsFloatingWindow(dockManager, true);
//TextBox dockable content
var textboxSampleContent = new DockableContent() { Title = "Date & Times Info", Content = new TextBox() { Text = "Date & Times Info Text", IsReadOnly = true } };
listViewContent.ContainerPane.Items.Add(textboxSampleContent);
//DataGrid document
//var dataGrid = new DataGrid();
//var rnd = new Random();
//var data = new List<Tuple<double, double, double, double>>();
//for (int i = 0; i < 100; i++)
//{
// data.Add(Tuple.Create(rnd.NextDouble(), rnd.NextDouble() * 10.0, rnd.NextDouble() * 100.0, rnd.NextDouble() * 1000.0));
//}
//dataGrid.ItemsSource = data;
//var dataGridDocument = new DocumentContent() { Title = "Data", IsLocked = true, Content = dataGrid };
//dataGridDocument.Show(dockManager);
////DataGrid Info Text sample
//var dataGridInfoContent = new DockableContent() { Title = "Data Info", Content = new TextBox() { Text = "Data Info Text" } };
//dataGridInfoContent.ShowAsDocument(dockManager);
}
示例11: DeleteListViewSelectedItem
private void DeleteListViewSelectedItem(ListView lv)
{
object obj = lv.SelectedItem;
if (obj is NwdPortableDeviceFolder)
{
MessageBox.Show("folder delete not supported yet");
}
if (obj is NwdPortableDeviceFile)
{
NwdPortableDeviceFile pdf = (NwdPortableDeviceFile)obj;
if (MessageBox.Show("Are you sure you want to delete " + pdf.Name,
"Confirm Deletion",
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
_currentDevice.DeleteFile(pdf);
MessageBox.Show("file deleted");
}
}
if (obj == null)
{
MessageBox.Show("null selection");
}
}
示例12: PerfMarginPanel
public PerfMarginPanel()
{
Logger.SetLogger(AggregateLogger.AddOrReplace(logger, Logger.GetLogger(), l => l is PerfEventActivityLogger));
// grid
mainGrid = new Grid();
mainGrid.ColumnDefinitions.Add(new ColumnDefinition());
mainGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
mainGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
// set diagnostic list
this.mainListView = CreateContent(new ActivityLevel[] { model.RootNode }.Concat(model.RootNode.Children), useWrapPanel: true);
this.mainListView.SelectionChanged += OnPerfItemsListSelectionChanged;
Grid.SetRow(this.mainListView, 0);
mainGrid.Children.Add(this.mainListView);
this.Content = mainGrid;
this.timer = new DispatcherTimer(TimeSpan.FromMilliseconds(500), DispatcherPriority.Background, UpdateUI, this.Dispatcher);
StartTimer();
model.RootNode.IsActiveChanged += (s, e) =>
{
if (this.stopTimer)
{
StartTimer();
}
};
}
示例13: ImageWindow
public ImageWindow(ListView view)
{
parentView = view;
InitializeComponent();
image.Source = (parentView.SelectedItem as Image).Source;
parentView.SelectionChanged += View_SelectionChanged;
}
示例14: LRM
public LRM(string domain, ListView view)
{
this.domain = domain;
resources = new Dictionary<string, SNPLink>();
linkConnections = new Dictionary<string, Topology.Link>();
this.links = view;
}
示例15: checkFile
public void checkFile(ListView listView)
{
try
{
string[] lines = File.ReadAllLines("settings.txt");
for (int i = 0; i < lines.Length;)
{
Item item = new Item();
item.game = lines[i];
item.path = lines[i + 1];
var extractedIcon = System.Drawing.Icon.ExtractAssociatedIcon(item.path);
var bmSrc = Imaging.CreateBitmapSourceFromHIcon(
extractedIcon.Handle,
Int32Rect.Empty,
System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
extractedIcon.Dispose();
item.icon = bmSrc;
listView.Items.Add(item);
i += 2;
}
}
catch (FileNotFoundException e)
{
File.Create("settings.txt");
}
}