UserControl的多个副本需要不同的内容(图像+ tekst) [英] Multiple copies of UserControl need different content (image + tekst)

查看:71
本文介绍了UserControl的多个副本需要不同的内容(图像+ tekst)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我已经构建了一个用作(可扩展)按钮的UserControl。

I've Build a UserControl that functions as a (enfoldable) button.

我已经多次复制了这个控件并给了他们一个名字

I've copied this control multiple times and gave them them a name

(FileTab1,FileTab2,FileTab3,FileTab4等)

(FileTab1, FileTab2, FileTab3, FileTab4 etc.)

我希望能够为每个UserControl添加不同的Image和tekst。

I would like to be able to add a different Image and tekst to each UserControl.

问题:当我更改其中一个Userconrols中的任何内容时,它将应用于所有USerControls

Problem: When I change anything in one of the Userconrols it is applied to all the USerControls

UserControl里面有一个路径,一个ImageContol,一个ContentPresenter和一个(不可见)按钮。

The UserControl has a path, an ImageContol, a ContentPresenter and a (invisible) button inside of it.

 

如何更改其中一个UserControls的图像和图像?

How can I change the image and tekst of just one of the UserControls?

推荐答案

你确定你不会只使用带TabItems / TabItemContentPresenter的TabControl吗?听起来更适合您的目的。
Are you sure you wouldn't rather just use a TabControl with TabItems / TabItemContentPresenter? Sounds a little better suited for your purposes.


这篇关于UserControl的多个副本需要不同的内容(图像+ tekst)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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