Why cant i add Orientation property to the style setter in WPF

Posted by nihi_l_ist on Stack Overflow See other posts from Stack Overflow or by nihi_l_ist
Published on 2010-05-27T13:50:36Z Indexed on 2010/05/27 13:51 UTC
Read the original article Hit count: 204

Filed under:
|
|
|

When i write something like this:

  <Style x:Key="panelS">
            <Setter Property="Orientation" Value="Horizontal" />
            <Setter Property="DockPanel.Dock" Value="Top" />
  </Style>

I get the error that says: Cannot resolve the Style Property 'Orientation'. Verify that the owning type is the Style's TargetType, or use Class.Property syntax to specify the Property.
Sure i have a Dock panel with many Stackpanels in it so i want to move Stackpanel's properties to the style. But there is this error and i dont quite understand what it means and what is the workaround(..i'd wanted not to assign Orientation on every Stackpanel).

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf