【发布时间】:2015-09-11 15:21:45
【问题描述】:
设置了用户控件的背景,但该背景隐藏了包含的控件。如何解决?
<UserControl x:Class="PL_Wpf.CustomControls.Conditioner"
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"
xmlns:local="clr-namespace:PL_Wpf.CustomControls"
mc:Ignorable="d" Height="166" Width="349">
<UserControl.Background>
<ImageBrush ImageSource="Conditioner.png" Stretch="None"/>
</UserControl.Background>
<Grid >
<ComboBox x:Name="combo1" HorizontalAlignment="Right" Width="57" Margin="0,68,53.206,70" />
<ToggleButton x:Name="ToggleSwitch" Height="50" Click="ToggleSwitch_Click" Margin="97.205,55,115.206,61" d:LayoutOverrides="Width" >
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}">
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content">
<Setter.Value>
<Image Source="../Pics/switch_on.png" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsChecked" Value="False">
<Setter Property="Content">
<Setter.Value>
<Image Source="../Pics/switch_off.png" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>
</Grid>
【问题讨论】:
-
应该有一个用于拟人化控件的技术术语。它给了我最好的心理形象......