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

iis网站伪静态网站wordpress 归档页面地址

iis网站伪静态网站,wordpress 归档页面地址,wordpress调用分类和文章,帮人做网站犯法WPF的数据绑定系统自动生成列表项对象#xff0c;为单个项应用所需的样式不是很容易。解决方案是ItemContainerStyle 属性。如果设置了ItemContainerStyle 属性#xff0c;当创建列表项时#xff0c;列表控件会将其向下传递给每个项。对于ListBox控件#xff0c;每个项有Li…WPF的数据绑定系统自动生成列表项对象为单个项应用所需的样式不是很容易。解决方案是ItemContainerStyle 属性。如果设置了ItemContainerStyle 属性当创建列表项时列表控件会将其向下传递给每个项。对于ListBox控件每个项有ListBoxItem 对象表示对于CombBox 控件则对应是 CombBoxItem。 交替条目样式 WPF通过两个属性为交替项提供内置支持AlternationCount 和 AlternationIndex。 WindowWindow.ResourcesStyle x:KeylistBoxItemStyle TargetType{x:Type ListBoxItem}Setter PropertyBackground ValueLightBlue/Setter PropertyMargin Value5/SetterSetter PropertyPadding Value5/SetterStyle.TriggersTrigger PropertyItemsControl.AlternationIndex Value1Setter PropertyBackground ValueLightBlue//TriggerTrigger PropertyIsSelected ValueTrueSetter PropertyBackground ValueDarkRed/Setter PropertyForeground ValueWhite/Setter PropertyBorderBrush ValueBlack/Setter PropertyBorderThickness Value10//Trigger/Style.Triggers/Style/Window.ResourcesGrid x:NamemyGridGrid.ColumnDefinitionsColumnDefinition/ColumnDefinition//Grid.ColumnDefinitionsGrid.RowDefinitionsRowDefinition/RowDefinition/RowDefinition MinHeight100//Grid.RowDefinitionsListBox Grid.Row0 Grid.Column0 ItemContainerStyle{StaticResource listBoxItemStyle} ItemsSource{Binding PathOrders} AlternationCount2 DisplayMemberPathPrice//Grid /Window 也可以直接将样式设置到ListBox层次 WindowWindow.ResourcesStyle x:KeycheckBoxListStyle TargetType{x:Type ListBox}Setter PropertySelectionMode ValueMultiple/SetterSetter PropertyItemContainerStyleSetter.ValueStyle TargetType{x:Type ListBoxItem}Setter PropertyMargin Value2/Setter PropertyTemplateSetter.ValueControlTemplate TargetType{x:Type ListBoxItem}CheckBox IsChecked{Binding PathIsSelected,RelativeSource{RelativeSource TemplatedParent},ModeTwoWay}ContentPresenter//CheckBox/ControlTemplate/Setter.Value/Setter/Style/Setter.Value/Setter/Style/Window.ResourcesGrid x:NamemyGridGrid.ColumnDefinitionsColumnDefinition/ColumnDefinition//Grid.ColumnDefinitionsGrid.RowDefinitionsRowDefinition/RowDefinition/RowDefinition MinHeight100//Grid.RowDefinitionsListView Grid.Row1 Grid.Column0 Style{StaticResource checkBoxListStyle} ItemsSource{Binding PathOrders} DisplayMemberPathPrice NamecheckButtonListBox//Grid /Window 样式选择器 可以使用样式选择器来为不同的子项提供不同的样式自定义样式选择器需要继承自 StyleSelector 类需要重写 SelectStyle() 方法。 public class SingleCriteriaHighlightStyleSelector : StyleSelector {public Style DefaultStyle { get; set; }public Style HighlightStyle { get; set; }public string PropertyToEvaluate { get; set; }public string PropertyValueToHighlight { get; set; }public override Style SelectStyle(object item, DependencyObject container){Order order (Order)item;if (order.Price 1000){return HighlightStyle;}else{return DefaultStyle;}} } 完整的代码文件 MainWindow.xaml Window x:ClassListBoxStyle.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:ListBoxStylemc:IgnorabledTitleMainWindow Height450 Width800Window.ResourcesStyle x:KeylistBoxItemStyle TargetType{x:Type ListBoxItem}Setter PropertyBackground ValueBlue/Setter PropertyMargin Value5/SetterSetter PropertyPadding Value5/SetterStyle.TriggersTrigger PropertyItemsControl.AlternationIndex Value1Setter PropertyBackground ValueLightBlue//TriggerTrigger PropertyIsSelected ValueTrueSetter PropertyBackground ValueDarkRed/Setter PropertyForeground ValueWhite/Setter PropertyBorderBrush ValueBlack/Setter PropertyBorderThickness Value10//Trigger/Style.Triggers/StyleStyle x:KeyradioButtonListStyle TargetType{x:Type ListBoxItem}Setter PropertyBackground ValueBlue/Setter PropertyMargin Value5/SetterSetter PropertyTemplateSetter.ValueControlTemplate TargetType{x:Type ListBoxItem}RadioButton FocusableFalse IsChecked{Binding PathIsSelected,RelativeSource{RelativeSource TemplatedParent},ModeTwoWay}ContentPresenter//RadioButton/ControlTemplate/Setter.Value/Setter/StyleStyle x:KeycheckBoxListStyle TargetType{x:Type ListBox}Setter PropertySelectionMode ValueMultiple/SetterSetter PropertyItemContainerStyleSetter.ValueStyle TargetType{x:Type ListBoxItem}Setter PropertyMargin Value2/Setter PropertyTemplateSetter.ValueControlTemplate TargetType{x:Type ListBoxItem}CheckBox IsChecked{Binding PathIsSelected,RelativeSource{RelativeSource TemplatedParent},ModeTwoWay}ContentPresenter//CheckBox/ControlTemplate/Setter.Value/Setter/Style/Setter.Value/Setter/StyleStyle x:KeyDefaultStyle TargetType{x:Type ListBoxItem}Setter PropertyBackground ValueLightYellow /Setter PropertyPadding Value2 //StyleStyle x:KeyHighlightStyle TargetType{x:Type ListBoxItem}Setter PropertyBackground ValueLightSteelBlue /Setter PropertyFontWeight ValueBold /Setter PropertyPadding Value2 //Style/Window.ResourcesGrid x:NamemyGridGrid.ColumnDefinitionsColumnDefinition/ColumnDefinition//Grid.ColumnDefinitionsGrid.RowDefinitionsRowDefinition/RowDefinition/RowDefinition MinHeight100//Grid.RowDefinitionsListBox Grid.Row0 Grid.Column0 ItemContainerStyle{StaticResource listBoxItemStyle} ItemsSource{Binding PathOrders} AlternationCount3 DisplayMemberPathPrice/ListBox Grid.Row0 Grid.Column1 ItemContainerStyle{StaticResource radioButtonListStyle} ItemsSource{Binding PathOrders} DisplayMemberPathPrice NameradioButtonListBox/ListView Grid.Row1 Grid.Column0 Style{StaticResource checkBoxListStyle} ItemsSource{Binding PathOrders} DisplayMemberPathPrice NamecheckButtonListBox/ListBox Grid.Row1 Grid.Column1 ItemsSource{Binding PathOrders} DisplayMemberPathPrice NamestyleSelectorListBoxListBox.ItemContainerStyleSelectorlocal:SingleCriteriaHighlightStyleSelector DefaultStyle{StaticResource DefaultStyle} HighlightStyle{StaticResource HighlightStyle}/local:SingleCriteriaHighlightStyleSelector/ListBox.ItemContainerStyleSelector/ListBoxButton Grid.Row4 ClickButton_ClickTest/ButtonButton Grid.Row4 Grid.Column1 ClickButton_Click_1Test/Button/Grid /WindowMainWindow.xaml.cs using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes;namespace ListBoxStyle;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 SetPropertyT(ref T member, T value, [CallerMemberName] string? propertyName null){if (EqualityComparerT.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 SingleCriteriaHighlightStyleSelector : StyleSelector {public Style DefaultStyle { get; set; }public Style HighlightStyle { get; set; }public string PropertyToEvaluate { get; set; }public string PropertyValueToHighlight { get; set; }public override Style SelectStyle(object item, DependencyObject container){Order order (Order)item;if (order.Price 1000){return HighlightStyle;}else{return DefaultStyle;}} }public partial class MainWindow : Window {public MainWindow(){InitializeComponent();myGrid.DataContext this;Order order1 new Order();Order order2 new Order();Order order3 new Order();Order order4 new Order();order1.Price 100;order1.Volume 10;order2.Price 1000;order2.Volume 100;order3.Price 10000;order3.Volume 1000;order4.Price 100000;order4.Volume 10000;Orders.Add(order1);Orders.Add(order2);Orders.Add(order3);Orders.Add(order4);}public ObservableCollectionOrder Orders {get; set;} new ();private void Button_Click(object sender, RoutedEventArgs e){string message ;if(radioButtonListBox.SelectedItem ! null){Order order (Order)radioButtonListBox.SelectedItem;message order.Price.ToString();}message \n;foreach (var selectedItem in checkButtonListBox.SelectedItems){Order order (Order)selectedItem;message order.Price.ToString() ;}MessageBox.Show(message);}private void Button_Click_1(object sender, RoutedEventArgs e){Orders[1].Price 50000;StyleSelector selector styleSelectorListBox.ItemContainerStyleSelector;styleSelectorListBox.ItemContainerStyleSelector null;styleSelectorListBox.ItemContainerStyleSelector selector;} }
http://www.huolong8.cn/news/12416/

相关文章:

  • 外贸免费开发网站模板乌苏市电力建设工程公司网站
  • 为朋友做的网站舆情处置的五个步骤
  • 网站与网页的关系wordpress非凡主题里导航下拉菜单
  • 做网站免费送域名网站cn域名注册
  • 网站建设必备的功能模块寮步镇仿做网站
  • 丽水市莲都区建设局网站ae模板
  • 路由下做网站映射Wordpress 相同tag
  • iis .net 网站架设做网站反链
  • 做自媒体需要用的网站济宁教育平台网站建设
  • 自己可以建设网站卖东西吗西安网站建设推广公司哪家好
  • 个人备案能做企业网站吗wordpress怎么不调用文字内容
  • 新乡网站建设哪家好wordpress群晖
  • 网站开发json解析wordpress媒体库默认路径
  • 网站怎么做弹幕播放器结合七牛云 做视频网站
  • 做报名表的网站互联网公司简介ppt范本
  • 有哪些购物的网站网页设计素材网站推荐
  • 国外网站国内做好还是国外做app开发公司部门
  • 网站建设合同 模板网架公司需要给设计院提交的资料
  • 整形网站开发嘉兴信息网站
  • 做个企业网站 优帮云江苏建设官方网站
  • 怎样做优惠券网站网站建设实践课程报告
  • 运营实力 网站建设电商网站开发环境
  • 假链接制作网站网站建设中轩网怎么样
  • 网站备案 影响吗怎么做网站省钱
  • 上海浦东建筑建设网站污水处理工程wordpress1.4
  • 定制网站开发公司哪家好?点击查看空间资源
  • 域名购买哪个网站好一家三口的室内设计方案ppt
  • 深圳市建设工程造价站官网app制作平台哪个好用
  • 河北住房和城乡建设厅网站首做相片网站
  • 继续访问这个网站店铺设计餐饮