简体   繁体   English

ContentControl WPF的一部分的背景

[英]background of a part of ContentControl WPF

I want to get the background of spesific area of ContentControl. 我想获得ContentControl特殊区域的背景。

Here is my ContentControl ; 这是我的ContentControl;

CompleteContentControl

The area I would like to have is (topright of the ContentControl) ; 我想拥有的区域是(ContentControl的右上角);

区域

How can I do that? 我怎样才能做到这一点?

Put your content control into another content control and set the horizontal and vertical position to topright. 将您的内容控件放入另一个内容控件,并将水平和垂直位置设置为topright。 In the following example I use an image in a grid. 在以下示例中,我在网格中使用图像。

<Grid>
        <Image
            x:Name="MyImage"
            Height="22"
            HorizontalAlignment="Right"
            Margin="10"
            VerticalAlignment="Top"
            Width="22" />
</Grid>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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