Benutzer:MovGP0/WPF/Templates

aus Wikipedia, der freien Enzyklopädie
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      


WPF Templates

<ControlTemplate TargetType="Button">
    <Grid>
        <Rectangle Fill="{TemplateBinding Background}" RadiusX="5" RadiusY="5" />
        <ContentPresenter RecognizesAccessKey="True" 
                  Content="{TemplateBinding Content}" 
                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
    </Grid>
</ControlTemplate>

Framework Elements

Base Elements:

  • Rectangle, Ellipse, Path
  • TextBlock
  • Image, Media

Control class derives from FrameworkElement. Control introduces Template-Property