Note that there are some explanatory texts on larger screens.

plurals
  1. POFire event on expanderView item selection
    primarykey
    data
    text
    <p>I have a expanderview in my application and I'm trying to fire an event when the user selects an item from the expanderview but I can't for the life of me get this to work.</p> <p>my xaml looks like this:</p> <pre><code>&lt;!--Custom header template--&gt; &lt;DataTemplate x:Key="CustomHeaderTemplate"&gt; &lt;TextBlock Text="" FontSize="28" /&gt; &lt;/DataTemplate&gt; &lt;!--Custom expander template--&gt; &lt;DataTemplate x:Key="CustomExpanderTemplate"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="auto" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Rectangle Width="400" Height="60" Fill="#FFF1F1F1" HorizontalAlignment="Stretch" StrokeThickness="0" Grid.Row="0" Grid.Column="0" /&gt; &lt;TextBlock Text="{Binding procedureName}" FontSize="30" Foreground="#FF00457C" FontWeight="Normal" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Margin="10,0,0,0" /&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;!--Custom expander items template--&gt; &lt;DataTemplate x:Key="ExpanderViewItems" &gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="15" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="auto" /&gt; &lt;ColumnDefinition Width="auto" /&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Image Source="{Binding flagIcon}" Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" /&gt; &lt;TextBlock FontSize="26" Text="{Binding N}" Foreground="Black" FontWeight="Normal" Grid.Row="0" Grid.Column="1"/&gt; &lt;TextBlock FontSize="20" Text="{Binding RNG}" Foreground="Black" FontWeight="Normal" HorizontalAlignment="Right" Grid.Row="0" Grid.Column="2"/&gt; &lt;TextBlock FontSize="26" Text="{Binding ValueAndUnit}" Foreground="Black" FontWeight="Medium" HorizontalAlignment="Right" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"/&gt; &lt;TextBlock FontSize="18" Text="{Binding COM}" Foreground="Black" FontWeight="Normal" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" TextWrapping="Wrap" /&gt; &lt;Line StrokeThickness="1" Stroke="#C4C6CC" Stretch="Fill" X1="0" X2="1" Y1="0" Y2="0" VerticalAlignment="Center" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" /&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;!--Listbox Containing ExpanderViews--&gt; &lt;ListBox Name="testsList" Grid.Row="3" Grid.Column="0" &gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;!--ExpanderView--&gt; &lt;toolkit:ExpanderView Header="{Binding}" HeaderTemplate="{StaticResource CustomHeaderTemplate}" Expander="{Binding}" ExpanderTemplate="{StaticResource CustomExpanderTemplate}" x:Name="expander" FontSize="36" Foreground="#FF00457C" ItemsSource="{Binding testItems}" ItemTemplate="{StaticResource ExpanderViewItems}" &gt; &lt;/toolkit:ExpanderView&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; </code></pre> <p>So there you have it, just need to simply fire an event when a user selects an expander item, finding it extremely tedious.</p> <p>Thanks for any suggestions!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload