title: set the content of togglebutton based on condition in xaml
body: <p>I don't have that much experiences in WPF and XAML files, and maybe my question is very simple. so let me get your help if possible.</p>
  
  <p>As a brief, it's a survey system that will go through some questions, where each question has exactly three answers. Answers are in a ListBox. </p>
  
  <p>In order to make it easier for illiterate people, I want that the ToogleButton in each answer to have different shape: 1st is square, 2nd is Circle and 3rd is Triangle. my objective is to set the shape based on the ListBoxItem index.</p>
  
  <p>Code is below with a static shape (Currently Triangle):</p>
  
  <pre><code>&lt;ListBox x:Name="AnswersListBox" Margin="0 16 0 16" ItemsSource="{Binding Path=CurrentQuestion.Answers, ElementName=Questionctl}" Grid.Row="1"&gt;
  &lt;ListBox.ItemTemplate&gt;
      &lt;DataTemplate DataType="{x:Type DAL:Answer}"&gt;
          &lt;Grid Height="85"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="80"/&gt;
                  &lt;ColumnDefinition Width="300*"/&gt;
              &lt;/Grid.ColumnDefinitions&gt;
  
              &lt;ToggleButton Margin="10 0" Style="{StaticResource MaterialDesignActionToggleButton}" ToolTip="Click to Select" VerticalAlignment="Center"                        
              IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"&gt;
                  &lt;Viewbox Width="32" Height="32"&gt;
                      &lt;Canvas Width="32" Height="32"&gt;
                          &lt;Path Data="M12,2L1,21H23M12,6L19.53,19H4.47" Width="32" Height="32" Stretch="Fill"
                          Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ToggleButton}}, Path=Foreground}"/&gt;
                      &lt;/Canvas&gt;
                  &lt;/Viewbox&gt;
  
              &lt;/ToggleButton&gt;
  
              &lt;TextBlock Text="{Binding Path=AnswerID, Converter={StaticResource AnswerTextConverter}}" VerticalAlignment="Center" TextWrapping="Wrap" 
                     Foreground="#424242" Grid.Column="1" FontSize="24"/&gt;
          &lt;/Grid&gt;
      &lt;/DataTemplate&gt;
  &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>I want to change the property <strong>Data</strong> of the object <strong>Path</strong> based on the  Main Container's index which is a ListBoxItem. Most probably, I have to use triggers to set the Data value based on the index number of the ListBoxItem, but unable to do that...</p>
  
  <p>Is that possible?</p>