cost 102 ms
如何将不同的参数传递给 DataTemplateSelector Select 方法 - How can I pass a different argument to DataTemplateSelector Select method

我的数据模板和 Xaml 位于 AssemblyX 中,而我的视图模型位于 AssemblyY 中,但 AssemblyX 不(也不能)引用 AssemblyY。 因此,目前我无法将 item 对象参数转换为我需要的类型,例如 实际上,SelectTemplate 方法不需要整个 View M ...

当 ItemsControl.ItemContainerStyle 与 ItemsControl.ItemTemplateSelector 一起指定时,后者被忽略 - When ItemsControl.ItemContainerStyle is specified together with ItemsControl.ItemTemplateSelector, the later is ignored

我有以下代码 - 只有 3 个类: 主窗口.xaml 主窗口.xaml.cs 模板选择器 使用当前代码,DropdownItemTemplate 被忽略,我们没有得到 组合框项的 TemplateSelector 中的方法。 如果我从 ComboBox 中删除ItemContainerStyle=" ...

为什么ListBox ItemTemplateSelector =“ {StaticResource MyDataTemplateSelector}”不能与资源一起使用? - Why is the ListBox ItemTemplateSelector=“{StaticResource MyDataTemplateSelector}” not working with the resource?

主题:我正在通过使用以下Microsoft示例来学习DataTemplate概念: https : //docs.microsoft.com/zh-cn/dotnet/framework/wpf/data/data-templating-overview和GitHub上的https : ://g ...

在UWP / WinRT中使用模板选择器选择ListboxItem模板 - Selected ListboxItem template using Template Selector in UWP/WinRT

我有一组列表框项目,用于显示手掌的不同手指。 我正在使用TemplateSelector来显示模板,每个模板都用一根手指。 现在我的问题是,当选择“列表框”项目时,需要显示不同的彩色图像,该图像对于每个项目都会有所不同,否则,该图像应该是模板中设置的灰色图像。 问题是,如何为列表框 ...

相对面板/网格无法在项目模板选择器中对齐水平对齐方式 - relative panel / grid cannot align the horizontal alignment in item template selector

我正在研究聊天应用程序。 聊天页面由itemTemplateSelector组成,该ItemTemplateSelector通过检查bool值根据发送者将文本对齐到右端/左端。 这是代码 ItemTemplateSelecter: 随着聊天框的更改,itemtempla ...

带有AutoGenerateColumns的WPF Datagrid中的ItemTemplateSelector - ItemTemplateSelector in WPF Datagrid with AutoGenerateColumns

在我们的数据网格中,我们使用ItemTemplateSelector根据绑定到特定单元格的数据在两个数据模板之间切换。 由于列数取决于当前数据集,我们在DataGrid使用AutoGenerateColumns 。 似乎这种特殊组合效果不佳 - 甚至没有调用模板选择器。 ...

更改放置在Windows Phone 8数据透视控件的DataTemplate中的ItemControl的ItemTemplate - Changing ItemTemplate of ItemControl placed inside DataTemplate of pivot control in windows phone 8

我是Windows Phone 8开发的新手。 我正在尝试在应用程序中创建一个类似于布局的日历。 为此,我在下面的xaml中使用了Pivot控件 对于Itemcontrol,我有两个DataTemplates定义为页面资源,如下所示。 现在,我的要求是在这些模板之间进行选择, ...

WPF Treeview HierarchicalDataTemplate ItemTemplateSelector - WPF Treeview HierarchicalDataTemplate ItemTemplateSelector

我试图在WPF(MVVM方法)中创建一个简单的2级Treeview。 对于我的第一个级别,我有一个标准的数据模板,对于我的第二个级别,我想使用模板选择器,以便我可以根据其中一个属性更改每个项目的外观。 下面是我的Treeview xaml 我的第一个级别是 只会显示一个名 ...

LongListSelector第一个和最后一个项目的不同项目模板 - LongListSelector different item template for first and last item

我正在编写我的Windows Phone 8应用程序,它使用LongListSelector来显示一些数据。 如何为LongListSelector中的第一个和最后一个项设置不同的项模板? 基本上我只想在每个项目中显示相同的信息,但在最后和第一项中使用很少的不同项目“布局”。 ...

模板选择器中的Windows Phone网格拉伸宽度 - Windows phone Grid Stretch Width in Template selector

嗨,大家好,这是我的第一个问题,所以,我会尽量明确:我有一个带样式和模板的ListBox,使其成为两列样式视图。 这是ListBoxItem的模板 : 这是ListBox: 结果如下: 此时,一切都很好,因此我实现了TemplateSelector来根据ListBo ...

WPF TabControl-我需要一个ItemTemplateSelector *和一个ContentTemplateSelector吗? - WPF TabControl - Do I need an ItemTemplateSelector *and* a ContentTemplateSelector?

因此,在我的WPF应用程序中,我有一个TabControl作为主要的用户TabControl ,它将支持几种不同的视图(基本上是数据输入的形式)及其底层视图模型(基本上是ORM映射)。 我构建了ContentTemplateSelector来抛出所选项目的正确内容视图。 所以我的问题 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM