How to expand and select first treeview item by default in treeview control in WPF

<TreeView Height="288" HorizontalAlignment="Left" Margin="18,23,0,0"  VerticalAlignment="Top" Width="89"
                  x:Name="tvCita" ItemsSource="{Binding CitaCol,Mode=TwoWay}" ItemTemplate="{StaticResource MasterTemplate}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectedItemChanged">
                    <cmd:EventToCommand Command="{Binding TreeviewItemClick}" CommandParameter="{Binding  SelectedItem, ElementName= tvCita, Mode=OneWay}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
 </TreeView>
<DataTemplate x:Key="DetailTemplate">
            <TextBlock Text="{Binding Swift_File_Name}"/>
        </DataTemplate>
           
        <HierarchicalDataTemplate x:Key="MasterTemplate"
                                  ItemsSource="{ Binding SwiftCol,Mode=TwoWay}"
                                  ItemTemplate="{StaticResource DetailTemplate}">
            <TextBlock Text="{Binding CITA_Info_Id}"/>
        </HierarchicalDataTemplate>

I tried like this , but I am getting error

I created style under window.resource

<Style TargetType="TreeViewItem">      
<Setter Property="IsExpanded" Value="True" />  
</Style>  

I called this style in treeview control like this style="<staticResource TreeViewItem>

but i am getting runtime exception like this

'Set property 'System.Windows.FrameworkElement.Style' threw an exception.' Line number '40' and line position '79'.

How to fix it or How to expand and select first treeview item by default in treeview control in WPF
kravindraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anurag ThakurTechnical ManagerCommented:
maybe the following link will be of some help
http://bea.stollnitz.com/blog/?p=59
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.