在WPF中,使用设计时间仅在创建USERCORTROL时设置TextBlock的文本
<UserControl x:Class="MachineStatusPlugin.MachineStatus_UC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
DataContext="{Binding RelativeSource={RelativeSource Mode=Self}, Mode=OneTime}"
d:DesignHeight="7">
我想使用类似于DesignHeight和DesignWidth的内容来设置文本屏体的文本,按钮的内容以及在设计时间内仅使用标签的内容。这可能吗?我找不到有关可以通过system.componentmodel.designerproperties.isindesignmodeproperty
修改的有关所附属性的任何文档。
<UserControl x:Class="MachineStatusPlugin.MachineStatus_UC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
DataContext="{Binding RelativeSource={RelativeSource Mode=Self}, Mode=OneTime}"
d:DesignHeight="7">
I want to use something similar to DesignHeight and DesignWidth to set the Text of a TextBlock, the Content of a Button, and the Content of a Label only during design time. Is this possible? I haven't been able to find any documentation as to what the attached properties are that can be modified with System.ComponentModel.DesignerProperties.IsInDesignModeProperty
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)