Ugrás a tartalomhoz

.NET Programming Technologies

Gergely Kovásznai, Csaba Biró

Eszterházy Károly College

Content property

Content property

It is possible to enter the hidden Content property, which we cannot see in the previous examples.

<Button>

Button

</Button>

The Content property has an object type, that is why (as the example shows) a gradient filled ellipse can be placed on the button instead of a simple text.

     <Button Width="150" Height="30" Background="Yellow">

          <Button.Content>

              <Ellipse Width="20" Height="20">

                  <Ellipse.Fill>

                      <RadialGradientBrush>

                          <GradientStop Color="Red" Offset="0" />

                          <GradientStop Color="#FFD3FF42" Offset="1" />

                      </RadialGradientBrush>

                  </Ellipse.Fill>

              </Ellipse>

        </Button.Content>

     </Button>