首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏林德熙的博客

    WPF 修改 ItemContainerStyle 鼠标移动到未选中项效果和选中项背景

    本文告诉大家如何通过修改 ItemContainerStyle 让 ListView 或 ListBox 的选择效果如鼠标移动到未选中项的效果或选择项的背景 先写一些简单的代码用于界面的绑定 public </DataTemplate> </ListView.ItemTemplate> </ListView> 通过写样式在 ItemContainerStyle 在 ListView 使用刚才写的样式,运行代码可以看到下面图片 <ListView ItemsSource="{Binding Items}" ItemContainerStyle

    1.7K20编辑于 2022-08-04
  • 来自专栏林德熙的博客

    WPF 修改 ItemContainerStyle 鼠标移动到未选中项效果和选中项背景

    本文告诉大家如何通过修改 ItemContainerStyle 让 ListView 或 ListBox 的选择效果如鼠标移动到未选中项的效果或选择项的背景 先写一些简单的代码用于界面的绑定 public </DataTemplate> </ListView.ItemTemplate> </ListView> 通过写样式在 ItemContainerStyle 在 ListView 使用刚才写的样式,运行代码可以看到下面图片 <ListView ItemsSource="{Binding Items}" ItemContainerStyle /53557393/6116637 ---- 本文会经常更新,请阅读原文: https://lindexi.gitee.io/post/WPF-%E4%BF%AE%E6%94%B9-ItemContainerStyle

    3K20发布于 2019-03-13
  • 来自专栏ASP.NETCore

    MVVM绑定多层级数据到TreeView并设置项目展开

    数据绑定做完后,我还想在一开始加载就屏开TreeView中的所有项,其实这个只需要设置一下ItemContainerStyle的Style就可以了,如下 <TreeView.ItemContainerStyle TreeViewItem}"> <Setter Property="IsExpanded" Value="True" /> </Style> </TreeView.ItemContainerStyle

    1.4K20发布于 2018-09-05
  • 来自专栏林德熙的博客

    CSDN 阅读 源代码 ListView宽度过小获取博客

    <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> Value="Stretch"></Setter> </Style> </ListView.ItemContainerStyle

    99410发布于 2018-09-18
  • 来自专栏葡萄城控件技术团队

    WPF下可编辑Header的Tab控件实现

    现在就来添加一个WPF TabControl,并应用ItemContainerStyle。 --> </Style> <Style x:Key="<em>ItemContainerStyle</em>" TargetType="TabItem"> <Setter DataTemplate> </Window.Resources> <Grid> <TabControl Grid.Row="0" ItemsSource="{Binding Data}" ItemContainerStyle ="{StaticResource ItemContainerStyle}" ContentTemplate="{StaticResource ContentTemplate}" /> </Grid

    1.4K60发布于 2018-01-10
  • 来自专栏林德熙的博客

    win10 uwp 兴趣线

    要我们的ListView的Item有和ListView一样的宽度可以简单设置ItemContainerStyle <ListView.ItemContainerStyle Value="Stretch" /> </Style> </ListView.ItemContainerStyle ApplicationPageBackgroundThemeBrush}"> <ListView ItemsSource="{x:Bind View.Str}"> <ListView.ItemContainerStyle VerticalContentAlignment" Value="Stretch"></Setter> </Style> </ListView.ItemContainerStyle

    55020编辑于 2022-08-12
  • 来自专栏林德熙的博客

    WPF 列表右键菜单比较符合 MVVM 的命令绑定方法

    他使用的是 GridView 做的,于是我告诉他需要自己写 ItemContainerStyle 在 GridViewRowPresenter 里添加右键的逻辑。 只需要通过 ItemContainerStyle 设置给 ListView 的每一项就可以了,如下面代码 <ListView Style="{x:Null}" ItemsSource="{Binding Path=DownloadFileInfoList}"> <ListView.ItemContainerStyle> <Style TargetType="{x:Type ListViewItem Binding AddedTime}"/> </GridView> </ListView.View> </ListView> 可以看到,主要的代码如下 <ListView.ItemContainerStyle > 通过 ItemContainerStyle 设置一个样式,在样式里面更改 ContextMenu 的内容就可以了,代码量十分少 还有一个问题是如何让右键菜单知道当前点的哪一项?

    4.2K20发布于 2020-07-28
  • 来自专栏林德熙的博客

    win10 uwp 右击浮出窗在点击位置

    <ListView ItemsSource="{x:Bind View.Str}"> <ListView.ItemContainerStyle> <Style TargetType Property="VerticalContentAlignment" Value="Center"></Setter> </Style> </ListView.ItemContainerStyle

    1K10发布于 2018-09-18
  • 来自专栏林德熙的博客

    win10 uwp 提示 Cannot find a Resource with the Name Key 找不到资源

    BorderThickness="0" ItemTemplateSelector="{StaticResource ItemTemplateSelector}"> <GridView.ItemContainerStyle <Setter Property="Margin" Value="0, 0, 0, 32"/> </Style> </GridView.ItemContainerStyle BorderThickness="0" ItemTemplateSelector="{StaticResource ItemTemplateSelector}"> <GridView.ItemContainerStyle <Setter Property="Margin" Value="0, 0, 0, 32"/> </Style> </GridView.ItemContainerStyle

    1.1K30编辑于 2022-08-12
  • 来自专栏张高兴的博客

    张高兴的 UWP 开发笔记:横向 ListView

    在“编辑其他模板”中有 ItemTemplate,ItemContainerStyle,ItemsPanel 三个选项。 ItemContainerStyle 是容器的样式,说白了就是 ListView 中的 Item 的显示样式,像 Width,Background 等都可以在其中定制。 ItemsSource="{x:Bind Books}" ItemTemplate="{StaticResource DataTemplate}" ItemContainerStyle

    1.5K70发布于 2018-05-18
  • 来自专栏hbbliyong

    WPF中ListView如何改变选中条背景颜色

    .> <ListView.ItemContainerStyle> <Style TargetType="{x:Type ListViewItem}"> < Color="Transparent"/> </Style.Resources> </Style> </ListView.ItemContainerStyle

    4.4K70发布于 2018-03-05
  • 来自专栏菩提树下的杨过

    Silverlight Telerik控件学习:带CheckBox复选框的树形TreeView控件

    SampleDataSource}, Path=SamplePlaceItemCollection}" Margin="10" BorderThickness="0"> <sdk:TreeView.ItemContainerStyle <Setter Property="IsExpanded" Value="True"/> </Style> </sdk:TreeView.ItemContainerStyle " IsRootLinesEnabled="True" IsTriStateMode="True" Margin="10"> <telerik:RadTreeView.ItemContainerStyle Setter Property="IsExpanded" Value="True"/> </Style> </telerik:RadTreeView.ItemContainerStyle

    2.6K70发布于 2018-01-23
  • 来自专栏林德熙的博客

    win10 UWP ListView

    ListView 宽度 使用下面的代码可以让 WPF 的 ListView 的 Item 宽度和他一样 HorizontalContentAlignment="Stretch" 或 <ListBox.ItemContainerStyle <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> </Style> </ListBox.ItemContainerStyle

    1.5K20发布于 2018-09-19
  • 来自专栏hbbliyong

    WPF备忘录(4)打个勾画个叉娱乐下

    True"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemContainerStyle </Setter.Value> </Setter> </Style> </ListView.ItemContainerStyle

    1.2K40发布于 2018-03-05
  • 来自专栏林德熙的博客

    win10 uwp dataGrid Microsoft.Toolkit.Uwp.UI.Controls.DataGrid表格控件

    其实简单UWP ListView宽度过小,可以通过下面代码修改 <ListView.ItemContainerStyle> <Style Value="Stretch"></Setter> </Style> </ListView.ItemContainerStyle

    3.3K10发布于 2018-09-18
  • 来自专栏林德熙的博客

    UWP 开发中,需要知道的1000个问题

    设置 ListView 列表项宽度 默认 ListViewItem 是宽度压缩,在 ListView 添加代码 <ListView.ItemContainerStyle HorizontalContentAlignment" Value="Stretch"/> </Style> </ListView.ItemContainerStyle

    2.2K20编辑于 2022-08-04
  • 来自专栏CSharp编程大全

    C# WPF MVVM项目实战(进阶②)

    <TreeViewItem Header="MatrixTransform"/> </TreeViewItem> <TreeView.ItemContainerStyle Selected] = [Action item_SelectedItemChanged($source,$eventArgs)]"/> </Style> </TreeView.ItemContainerStyle

    2.3K21发布于 2021-10-19
  • 来自专栏菩提树下的杨过

    Silvelright:ListBox无法用Tab顺序切换内部元素焦点的解决

    "10"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemContainerStyle </Setter.Value> </Setter> </Style> </ListBox.ItemContainerStyle

    1.6K100发布于 2018-01-24
  • 来自专栏林德熙的博客

    WPF 鼠标光标大全

    > <WrapPanel /> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListBox.ItemContainerStyle <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> </ListBox.ItemContainerStyle

    3.1K30编辑于 2021-12-23
  • 来自专栏林德熙的博客

    win10 UWP ListView

    ListView 宽度 使用下面的代码可以让 WPF 的 ListView 的 Item 宽度和他一样 HorizontalContentAlignment="Stretch" 或 <ListBox.ItemContainerStyle <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> </Style> </ListBox.ItemContainerStyle

    1K10编辑于 2022-08-04
领券