cost 76 ms
Maui:有条件地更改 gridView 模板 - Maui: Change gridView template conditionally

我在 CollectionView 中有一个网格,我需要根据特定条件更改布局,动态更改列和行的大小并隐藏/显示某些特定列。 collectionView 的数据源始终相同。 基本上,我想实现这样的目标: 默认布局: 替代布局: 我看到也许我可以使用 DataTemplateSelectors, ...

使用 CollectionView 和 DataTemplate 时,如何显示/使用我的项目的索引/位置? - When using CollectionView and DataTemplate, how can I display/Use the index/position of my item?

我想要一个至少有 2 个标签的 CollectionView 第一个 label 用于 indexOf object 第二个 label 用于属性(名称),因为这是一个 CustomView 我只能访问 Enumerable ItemsSource。 但不是实际的列表。 ...

如何在 WinUI 3 的 ToggleSwith.HeaderTemplate 的 DataTemplate 中使用 x:Bind - How to use x:Bind in a DataTemplate for a ToggleSwith.HeaderTemplate in WinUI 3

我正在尝试为给定Page (WinUI 3 v1.2 桌面项目)上所有ToggleSwitche的Header创建一个简单的Style 。 我真的很想将x:Bind用于我的所有绑定(不是Binding )。 这是我的Page.Resources<Page.Resources> ...

通过(Visible/Invisible)-property动态调整DataTemplates中的环境 - dynamic adjustment of the environment in DataTemplates through (Visible/Invisible)-property

问题是,如果您将来自 CollectionView 的 ContentPage.Resources 的 DataTemplate 和 ItemTemplate 包含在一起,并使其中的字段可见或不可见,那么环境将无法适应这种变化。 我在下面创建了一个简短的例子。 您有一个按钮,在按钮下方有一个 lab ...

如何将 DataTemplate 中的 ToolTip 属性绑定到父 UserControl 的属性? - How binding the ToolTip property from within the DataTemplate to the property of the parent UserControl?

如何绑定用户控件的依赖属性? 我希望 ToolTip 依赖属性IsEnabled从 UserControl 依赖属性IsShowToolTip绑定。 我尝试了RelativeSource,但这找不到来源。 在 UserControl 我有: 在 xaml 中:<UserControl> ...

带有 MVMM 的 Dotnet MAUI - 基于 ObservableCollection 的动态数据模板<t>其中 T 是一个接口</t> - Dotnet MAUI with MVMM - Dynamic dataTemplate based on ObservableCollection<T> where T is an interface

我正在尝试构建一个新的 DotNet MAUI 应用程序。 我有一个这样的数据源: public ObservableCollection&lt;IIpxElement&gt; IpxElements { get; } public ObservableCollection&lt;IIpxEleme ...

有没有办法将 Item/DataTemplate 注入自定义样式或用户控件? - Is there a way to inject an Item/DataTemplate into a custom Style or UserControl?

我有一个小型 WPF 应用程序,其中包含多个小型游戏克隆,例如扫雷、连接 4、井字游戏等。 所有这些的共同点是它们都是一个统一的方格,每个方格都由一个按钮控制。 对于这些游戏中的每一个,我在他们的 XAML 中定义了一个带有 UniformGrid ItemsPanelTemplate 的 Use ...

Select 视图取决于屏幕分辨率 - Select view depending on screen resolution

我有一个 WPF 应用程序,用于具有特定分辨率的 LCD 显示器。 WPF 应用程序是固定大小的。 视图通过DataTemplate绑定到它的视图 model ,如下所示: 现在我想让这个应用程序可用于第二种 LCD 显示器类型。 观点会完全不同。 有没有办法根据分辨率将视图 model 绑定到不 ...

与 StaticResource 或 x:Static 一起使用时,控件模板触发器无法设置值 - Control template triggers cannot set value when used with StaticResource or x:Static

我遇到的奇怪问题。 当尝试将StaticResource或x:Static与来自ControlTemplate.Trigger的转换器一起使用时,转换器value始终为NULL 。 在下面的示例中,显示了不同的用法,没有任何问题: 上面的代码导致: 到目前为止一切都很好, Static ...

需要指导以最佳方式最小化 Xamarin 表单中的数据模板代码 - Need direction for best way to minimize data template code in Xamarin form

在 MVC ASP.net Core 中,我使用部分来重用页面的块。 在 Xamarin 中,我们有 DataTemplates 和 ControlTemplates,但我不确定如何最好地使用它们。 在我的一个页面中,我有以下内容: 模板选择器是(后面会有更多选择): 现在我可以使用一些方 ...

Xamarin 的 RadioBox 列表从视图模型中设置 GroupName - Xamarin list of RadioBox set GroupName from view model

到目前为止,我发现的所有 RadioButtons 示例都将值硬编码在页面的 xaml 中。 我正在寻找从数据库中提供字符串列表(目前)并遇到 GroupName 的问题。 只要我对 ViewCell 中的 RadioButton 的 GroupName 进行硬编码,一切正常,但我最终会为页面上 ...

如何将不同的数据上下文绑定到数据模板? - How to binding different data context to data template?

我尝试简化我的主用户控件,其中包含 8 个完全相同的用户控件,但它们绑定到不同的 VM 以显示其数据。 目前,我必须为每个用户控件创建一个模板并绑定到每个 VM。 似乎我可以为所有 8 个用户控件创建一个数据模板,并将数据模板应用于具有不同 VM 实例的每个用户控件。 这是我的代码,当前我必须对包 ...


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