Welcome to
aleprojects.com

toolkit:ExpanderView - removing vertical line and workaround for HitTestVisible items when collapsed (XAML, .NET, C#, Windows Phone).

This is modification of original ExpanderView style taken from toolkit source. Applying this style removes vertical line and indent from left side.

applying modified style

That's how Expander looks like with modified style.

Problem with HitTest visibility of hidden items of collapsed ExpanderView is described here: https://phone.codeplex.com/workitem/11710. Below is a possible workaround. Items of ExpanderView are grouped by StackPanel which IsHitTestVisible property manages hit test visibility of children. Initial value of StackPanel IsHitTestVisible should be set to false.

private void ExpanderView_Collapsed(object sender, RoutedEventArgs e)
{
    StackPanel sp = (sender as ExpanderView).Items[0] as StackPanel;
    if (sp != null) sp.IsHitTestVisible = false;
}
 
private void ExpanderView_Expanded(object sender, RoutedEventArgs e)
{
    StackPanel sp = (sender as ExpanderView).Items[0] as StackPanel;
    if (sp != null) sp.IsHitTestVisible = true;
}