如何使用系统控件创建磁贴自定义控件? [英] How to create tiles custom control with system controls?

查看:76
本文介绍了如何使用系统控件创建磁贴自定义控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用普通的WPF控件创建一个自定义平铺控件,而不使用第三方控件,它将使ItemSource绑定数据并具有最大化和最小化设置。根据最小化或最大化,ItemTemplate可以随着选定的平铺数据而改变。



我尝试过:



尝试在ContentControl中添加带有Collection的ItemControl,并且瓷砖进入屏幕,但不确定如何在Maximize上使用另一个模板。

Hi, I need to create a Custom Tile control with normal WPF controls without using Third Party control which will have ItemSource to bind the data and have the Maximize and Minimize setting. And According to Minimize or Maximize the ItemTemplate can change with the Selected Tile Data.

What I have tried:

Tried to add the ItemControl with Collection in ContentControl and tiles are getting in the screen but not sure how to use another template on Maximize.

推荐答案

使用DataTemplate选择器。



DataTemplateSelector类(System.Windows.Controls)| Microsoft Docs [ ^ ]
Use a DataTemplate selector.

DataTemplateSelector Class (System.Windows.Controls) | Microsoft Docs[^]


这篇关于如何使用系统控件创建磁贴自定义控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆