Binding SelectedItem to IsChecked
<p>I have listBox modified for check boxes. I would like to bind the <code>selectedItem</code> to the check so that I can use <code>$WPFlbSiteList.SelectedItem</code> as the basis of selecting items that are checked.</p>

<p>Basically, I have generated a list I need the checks to equate to the selected item. This selected item also needs to work in a multi selection capacity rather than one at a time.</p>

<pre><code>&lt;ListBox x:Name="lbSiteList" SelectionMode="MultiExtended" Margin="355,45,411,1014" ItemsSource="{Binding .}"&gt;
     &lt;ListBox.ItemTemplate&gt;
           &lt;DataTemplate&gt;
               &lt;CheckBox Content="{Binding .}" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Margin="2,2,0,0"/&gt;
           &lt;/DataTemplate&gt;
     &lt;/ListBox.ItemTemplate&gt;
&lt;/ListBox&gt;
</code></pre>

<p>My function to write to the console which of my checked items are selected.</p>

<pre><code>$WPFbtnUpdate.Add_Click({ 

    #List the sites that are ticked
    foreach ($WPFlbSiteList.Items in $WPFlbSiteList){

        $x=$WPFlbSiteList.SelectedItems

        write-host $x
    }
})
</code></pre>