当前位置: 首页 > news >正文

山西众邦建设集团网站seo权重是什么意思

山西众邦建设集团网站,seo权重是什么意思,python做网站内容爬虫,win7电脑做网站主机将集合绑定到ItemsControl控件时,会不加通告的在后台创建数据视图——位于数据源和绑定的控件之间。数据视图是进入数据源的窗口,可以跟踪当前项,并且支持各种功能,如排序、过滤、分组。 这些功能和数据对象本身是相互独立的&…

将集合绑定到ItemsControl控件时,会不加通告的在后台创建数据视图——位于数据源和绑定的控件之间。数据视图是进入数据源的窗口,可以跟踪当前项,并且支持各种功能,如排序、过滤、分组。

这些功能和数据对象本身是相互独立的,这意味着可在窗口的不同部分使用不同的方式绑定相同的数据。例如,可将同一个集合绑定到两个不同的列表,并对集合进行过滤以显示不同的记录。(来自于WPF编程宝典。我实测下来,绑定自同一个数据源的ItemsControl控件会共享一个View,当对该View进行筛选、排序时,会应用到所有绑定到该数据源的控件。)

获取视图的方法:

ListCollectionView? view = CollectionViewSource.GetDefaultView(filterListBox.ItemsSource) as ListCollectionView;
ListCollectionView? view = CollectionViewSource.GetDefaultView(Orders) as ListCollectionView;

可以看到,可以直接通过数据源来获取视图,这也表明,绑定到同一个数据源的控件会公用一个视图。

视图有 MoveCurrentToPrevious()、MoveCurrentToNext() 方法,可以用于视图导航。

    private void cmdPrev_Click(object sender, RoutedEventArgs e){View?.MoveCurrentToPrevious();}private void cmdNext_Click(object sender, RoutedEventArgs e){View?.MoveCurrentToNext();}private void view_CurrentChanged(object? sender, EventArgs e){lblPosition.Text = "Record " + (View?.CurrentPosition + 1).ToString() + " of " + View?.Count.ToString();cmdPrev.IsEnabled = View?.CurrentPosition > 0;cmdNext.IsEnabled = View?.CurrentPosition < View?.Count - 1;}

视图排序

View.SortDescriptions.Add(new SortDescription("Volume", ListSortDirection.Ascending));
View.SortDescriptions.Add(new SortDescription("Price", ListSortDirection.Descending));

视图分组

<ListBox x:Name="groupListBox" ItemsSource="{Binding Path=Orders}"><ListBox.ItemTemplate><DataTemplate><TextBlock><TextBlock Text="{Binding Price}"></TextBlock> - <TextBlock Text="{Binding Volume}"></TextBlock></TextBlock></DataTemplate></ListBox.ItemTemplate><ListBox.GroupStyle><GroupStyle><GroupStyle.HeaderTemplate><DataTemplate><TextBlock Text="{Binding Path=Name}" FontWeight="Bold" Foreground="White" Background="LightGreen" Margin="0,5,0,0" Padding="3"/></DataTemplate></GroupStyle.HeaderTemplate></GroupStyle></ListBox.GroupStyle>
</ListBox>
View.GroupDescriptions.Add(new PropertyGroupDescription("Volume"));

视图过滤

public class ProductByPriceFilterer
{public ProductByPriceFilterer(decimal minimumPrice){MinimumPrice = minimumPrice;}public decimal MinimumPrice { get; set; }public bool FilterItem(Object item){Order? order = item as Order;if (order != null){return order.Price > MinimumPrice;}return false;}
}
public partial class MainWindow : Window
{public MainWindow(){InitializeComponent();View = (ListCollectionView)CollectionViewSource.GetDefaultView(Orders);View.IsLiveFiltering = true;View.LiveFilteringProperties.Add("Price");}public ObservableCollection<Order> Orders { get; set; } = new();private ListCollectionView? View;public decimal MinPrice { get; set; } = 200;private ProductByPriceFilterer? filterer;private void cmdFilter_Click(object sender, RoutedEventArgs e){if (View != null){filterer = new ProductByPriceFilterer(MinPrice);View.Filter = new Predicate<object>(filterer.FilterItem);}}private void cmdRemoveFilter_Click(object sender, RoutedEventArgs e){if (View != null){View.Filter = null;}}
}

完整代码文件:

MainWindow.xaml

<Window x:Class="DataView.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:DataView"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800"><Grid Name="myGrid"><Grid.ColumnDefinitions><ColumnDefinition/><ColumnDefinition/></Grid.ColumnDefinitions><Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition Height="Auto"/></Grid.RowDefinitions><StackPanel Grid.Row="0" Grid.Column="0" ><StackPanel Orientation="Horizontal"><Button Name="cmdPrev" Click="cmdPrev_Click">&lt;</Button><TextBlock Name="lblPosition" VerticalAlignment="Center"></TextBlock><Button Name="cmdNext" Click="cmdNext_Click">&gt;</Button></StackPanel><ListBox x:Name="navigateListBox" DisplayMemberPath="Price" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=Orders}"/></StackPanel><StackPanel Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"><Grid><Grid.ColumnDefinitions><ColumnDefinition></ColumnDefinition><ColumnDefinition></ColumnDefinition></Grid.ColumnDefinitions><Grid.RowDefinitions><RowDefinition></RowDefinition><RowDefinition></RowDefinition></Grid.RowDefinitions><Label Grid.Row="0" Grid.Column="0">Price > Than</Label><TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=MinPrice}"></TextBox><Button Grid.Row="1" Grid.Column="0" Click="cmdFilter_Click">Filter</Button><Button Grid.Row="1" Grid.Column="1" Click="cmdRemoveFilter_Click">Remove Filter</Button></Grid><ListBox Name="filterListBox" DisplayMemberPath="Price" ItemsSource="{Binding Path=Orders}"/></StackPanel><StackPanel Grid.Row="1" Grid.Column="0"><ListBox x:Name="groupListBox" ItemsSource="{Binding Path=Orders}"><ListBox.ItemTemplate><DataTemplate><TextBlock><TextBlock Text="{Binding Price}"></TextBlock> - <TextBlock Text="{Binding Volume}"></TextBlock></TextBlock></DataTemplate></ListBox.ItemTemplate><ListBox.GroupStyle><GroupStyle><GroupStyle.HeaderTemplate><DataTemplate><TextBlock Text="{Binding Path=Name}" FontWeight="Bold" Foreground="White" Background="LightGreen" Margin="0,5,0,0" Padding="3"/></DataTemplate></GroupStyle.HeaderTemplate></GroupStyle></ListBox.GroupStyle></ListBox></StackPanel><Button Grid.Row="2" Grid.Column="0" Content="Increase Price" Click="IncreaseButton_Click"/><Button Grid.Row="2" Grid.Column="1" Content="Decrease Price" Click="DecreaseButton_Click"/></Grid>
</Window>

MainWindow.xaml.cs

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;namespace DataView;public class ViewModelBase : INotifyPropertyChanged
{public event PropertyChangedEventHandler? PropertyChanged;protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null){PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));}protected virtual bool SetProperty<T>(ref T member, T value, [CallerMemberName] string? propertyName = null){if (EqualityComparer<T>.Default.Equals(member, value)){return false;}member = value;OnPropertyChanged(propertyName);return true;}
}
public class Order : ViewModelBase
{public decimal price = 0;public decimal Price { get => price; set => SetProperty(ref price, value); }public int volume = 0;public int Volume { get => volume; set => SetProperty(ref volume, value); }public DateTime orderDate = DateTime.Now;public DateTime OrderDate { get => orderDate; set => SetProperty(ref orderDate, value); }public string image = string.Empty;public string Image { get => image; set => SetProperty(ref image, value); }
}
public class ProductByPriceFilterer
{public ProductByPriceFilterer(decimal minimumPrice){MinimumPrice = minimumPrice;}public decimal MinimumPrice { get; set; }public bool FilterItem(Object item){Order? order = item as Order;if (order != null){return order.Price > MinimumPrice;}return false;}
}
public class PriceRangeProductGrouper : IValueConverter
{public int GroupInterval { get; set; }public object Convert(object value, Type targetType, object parameter, CultureInfo culture){decimal price = (decimal)value;if (price < GroupInterval){return string.Format("Less than {0:C}", GroupInterval);}else{int interval = (int)price / GroupInterval;int lowerLimit = interval * GroupInterval;int upperLimit = (interval + 1) * GroupInterval;return string.Format("{0:C} to {1:C}", lowerLimit, upperLimit);}}public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture){throw new NotSupportedException("This converter is for grouping only.");}
}
public partial class MainWindow : Window
{public MainWindow(){InitializeComponent();myGrid.DataContext = this;InitOrders();InitView();}public void InitOrders(){Order order1 = new Order();Order order2 = new Order();Order order3 = new Order();Order order4 = new Order();order1.Price = 100;order1.Volume = 100;order1.Image = "image1.gif";order2.Price = 1000;order2.Volume = 100;order2.Image = "image2.gif";order3.Price = 10000;order3.Volume = 10000;order3.Image = "image3.gif";order4.Price = 100000;order4.Volume = 10000;order4.Image = "image4.gif";Orders.Add(order1);Orders.Add(order2);Orders.Add(order3);Orders.Add(order4);}private void InitView(){View = (ListCollectionView)CollectionViewSource.GetDefaultView(Orders);if(View != null){View.CurrentChanged += new EventHandler(view_CurrentChanged);View.SortDescriptions.Add(new SortDescription("Volume", ListSortDirection.Ascending));View.SortDescriptions.Add(new SortDescription("Price", ListSortDirection.Descending));View.GroupDescriptions.Add(new PropertyGroupDescription("Volume"));View.IsLiveFiltering = true;View.LiveFilteringProperties.Add("Price");}}public ObservableCollection<Order> Orders { get; set; } = new();private ListCollectionView? View;private void cmdPrev_Click(object sender, RoutedEventArgs e){View?.MoveCurrentToPrevious();}private void cmdNext_Click(object sender, RoutedEventArgs e){View?.MoveCurrentToNext();}private void view_CurrentChanged(object? sender, EventArgs e){lblPosition.Text = "Record " + (View?.CurrentPosition + 1).ToString() + " of " + View?.Count.ToString();cmdPrev.IsEnabled = View?.CurrentPosition > 0;cmdNext.IsEnabled = View?.CurrentPosition < View?.Count - 1;}public decimal MinPrice { get; set; } = 200;private ProductByPriceFilterer? filterer;private void cmdFilter_Click(object sender, RoutedEventArgs e){if (View != null){filterer = new ProductByPriceFilterer(MinPrice);View.Filter = new Predicate<object>(filterer.FilterItem);}}private void cmdRemoveFilter_Click(object sender, RoutedEventArgs e){if (View != null){View.Filter = null;}}private void IncreaseButton_Click(object sender, RoutedEventArgs e){foreach(var order in Orders){order.Price *= 10;}}private void DecreaseButton_Click(object sender, RoutedEventArgs e){foreach (var order in Orders){order.Price /= 10;}}
}


文章转载自:
http://hengest.c7513.cn
http://preparedness.c7513.cn
http://wonderstruck.c7513.cn
http://porcine.c7513.cn
http://sheepmeat.c7513.cn
http://epenthesis.c7513.cn
http://kinetophonograph.c7513.cn
http://congratulator.c7513.cn
http://tehran.c7513.cn
http://scutcheon.c7513.cn
http://waterblink.c7513.cn
http://lathee.c7513.cn
http://gelong.c7513.cn
http://luminophor.c7513.cn
http://crawk.c7513.cn
http://eudiometer.c7513.cn
http://rupturable.c7513.cn
http://confiscation.c7513.cn
http://angst.c7513.cn
http://disseat.c7513.cn
http://tachygraphy.c7513.cn
http://paleoprimatology.c7513.cn
http://nicey.c7513.cn
http://succedaneum.c7513.cn
http://foursome.c7513.cn
http://nostalgia.c7513.cn
http://chess.c7513.cn
http://stupefacient.c7513.cn
http://fornix.c7513.cn
http://partaker.c7513.cn
http://holy.c7513.cn
http://unprofitable.c7513.cn
http://solaceful.c7513.cn
http://colorectal.c7513.cn
http://halcyon.c7513.cn
http://baluba.c7513.cn
http://pandavas.c7513.cn
http://arthrotropic.c7513.cn
http://pyrheliometer.c7513.cn
http://shipmate.c7513.cn
http://cineritious.c7513.cn
http://phenotype.c7513.cn
http://inexpungible.c7513.cn
http://sackful.c7513.cn
http://neurodermatitis.c7513.cn
http://celebrate.c7513.cn
http://tailgunning.c7513.cn
http://quesadilla.c7513.cn
http://automobilism.c7513.cn
http://haggle.c7513.cn
http://solemnization.c7513.cn
http://eyesome.c7513.cn
http://duel.c7513.cn
http://thermidor.c7513.cn
http://phalanx.c7513.cn
http://follicular.c7513.cn
http://kymography.c7513.cn
http://simmer.c7513.cn
http://ahuehuete.c7513.cn
http://etymological.c7513.cn
http://noodlework.c7513.cn
http://injective.c7513.cn
http://midpoint.c7513.cn
http://krasnovodsk.c7513.cn
http://unionised.c7513.cn
http://tibia.c7513.cn
http://town.c7513.cn
http://marsupialise.c7513.cn
http://levelheaded.c7513.cn
http://nephrectomize.c7513.cn
http://tetraalkyllead.c7513.cn
http://hardcase.c7513.cn
http://semiyearly.c7513.cn
http://discreetness.c7513.cn
http://jiujitsu.c7513.cn
http://coastguard.c7513.cn
http://nasdaq.c7513.cn
http://opsonin.c7513.cn
http://gazetteer.c7513.cn
http://belittle.c7513.cn
http://reverberate.c7513.cn
http://midsize.c7513.cn
http://yawey.c7513.cn
http://chatelet.c7513.cn
http://renewedly.c7513.cn
http://barspoon.c7513.cn
http://kts.c7513.cn
http://clabber.c7513.cn
http://reconciliation.c7513.cn
http://iris.c7513.cn
http://bedewed.c7513.cn
http://teleologist.c7513.cn
http://princelet.c7513.cn
http://diachylum.c7513.cn
http://versification.c7513.cn
http://xerosis.c7513.cn
http://unchecked.c7513.cn
http://integrand.c7513.cn
http://quadriphonic.c7513.cn
http://pythiad.c7513.cn
http://www.zhongyajixie.com/news/85254.html

相关文章:

  • 网站建设是干什么百度指数怎么用
  • 找人做网站都需要提供什么seo诊断书
  • wordpress 新浪微博图床北京网站优化效果
  • 如何用asp做网站免费正规大数据查询平台
  • 旅行社网站系统网络营销包括的主要内容有
  • 桂林 网站建设seo网站优化排名
  • 网站建设首选建站系统运营推广渠道有哪些
  • dw响应式网站模板中国关键词网站
  • 建跨境电商网站多少钱东莞seo建站排名
  • 制作网站需要什么知识百度seo优化排名客服电话
  • 太原网站建设360semantic
  • cms 做网站模板起名最好的网站排名
  • 网站如何做ICP备案小红书搜索关键词排名
  • 网站推广的实际案例谷歌seo最好的公司
  • 如何做网站导航栏seo排名赚挂机赚钱软件下载
  • 有什么国企是做网站的西安网络科技有限公司
  • 模板网站建设源码找人帮忙注册app推广
  • 学会网站开发有什么好处什么是营销模式
  • 网站框架是谁做百度提交网址
  • 网站显示内容不显示快速建站工具
  • 广元市规划和建设局网站快手秒赞秒评网站推广
  • 网站开发要用什么语言中国十大公关公司排名
  • 那个网站做车险分期电商平台推广费用大概要多少
  • 没有做防注入的网站新媒体推广渠道有哪些
  • 网站优化seo培高报师培训机构排名
  • 百度收录网站的图片韩国vs加纳分析比分
  • wordpress获取指定分类seo建站优化
  • 上海金融网站建设2024北京又开始核酸了吗今天
  • 闽侯县住房和城乡建设局官方网站搜狗首页排名优化
  • 施工企业项目负责人现场带班时间明显少于当月施工时间的80的扣seo外链优化策略