Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Treeview Style EventSetter dont work
    primarykey
    data
    text
    <p>Hallo i have a problem with an eventsetter.<br> My Window: </p> <pre><code>&lt;TreeView.Resources&gt; &lt;ResourceDictionary&gt; &lt;ResourceDictionary.MergedDictionaries&gt; &lt;ResourceDictionary Source="CrefoChartTreeViewItemStyle.xaml" /&gt; &lt;/ResourceDictionary.MergedDictionaries&gt; &lt;HierarchicalDataTemplate DataType="{x:Type local:Node}" ItemsSource="{Binding ChildNodes}"&gt; &lt;/HierarchicalDataTemplate&gt; &lt;/ResourceDictionary&gt; &lt;/TreeView.Resources&gt; </code></pre> <p>My CrefoChartTreeViewItemStyle.xaml </p> <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" mc:Ignorable="d" &gt; &lt;Style TargetType="TreeViewItem"&gt; &lt;Style.Resources&gt; &lt;LinearGradientBrush x:Key="ButtonBrush" EndPoint="0,1" StartPoint="0,0"&gt; &lt;GradientStop Color="White" Offset="0.25"/&gt; &lt;GradientStop Color="#FFA5DBE9" Offset="1"/&gt; &lt;/LinearGradientBrush&gt; &lt;Style x:Key="ButtonStyle" TargetType="{x:Type Button}"&gt; &lt;Setter Property="Background" Value="{DynamicResource ButtonBrush}" /&gt; &lt;EventSetter Event="Click" Handler="ButtonOnClick" /&gt; &lt;/Style&gt; &lt;/Style.Resources&gt; </code></pre> <p>I get the Error Message when i Compile: </p> <pre><code>The event 'click' can not be specified on a Target tag in a Style. Instead, use "EventSetter". </code></pre> <p>What do i do wrong?</p> <p>Is there any other way to get this button in the treeview triggerd? so i can put Code behind?</p>
    singulars
    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.
 

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