views:

554

answers:

1

I'll just show an example

<Style TargetType="{x:Type f:WorkflowPage}">
    <Setter Property="Template">
     <Setter.Value>
      <ControlTemplate>
       <DockPanel Background="Red">
        <StackPanel Style="{StaticResource Header}">
         <Grid>
          <Grid.ColumnDefinitions>
           <ColumnDefinition Width="Auto"/>
           <ColumnDefinition Width="205"/>
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
           <RowDefinition Height="50"/>
          </Grid.RowDefinitions>
          <Rectangle Style="{StaticResource HeaderTile}"/>
          <Rectangle Style="{StaticResource HeaderLogo}"/>
         </Grid>
        </StackPanel>
        <StackPanel Style="{StaticResource Content}">
         <ContentPresenter/>
        </StackPanel>
        <StackPanel Style="{StaticResource Footer}">
        </StackPanel>
       </DockPanel>
      </ControlTemplate>
     </Setter.Value>
    </Setter>
</Style>

I was trying to take that grid out of there and set it externally. Or is the wrong direction?

A: 

I'm not sure exactly what you are trying to achieve, but I'd say that this is not the way :).

Stackpanel, Grid etc are just containers. You cannot define their content through styles.

if you describe what you want to achieve, maybe we can help you find a way to do it.

Denis Troller