Hello there,
I want to add button click event to a button present in the Resource Dictionary (Generic.xaml) of a custom radShape
<Style TargetType="{x:Type local:SideView}">
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Height" Value="50"/>
<Setter Property="Width" Value="100"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:SideView}">
<Grid Background="{TemplateBinding Background}">
<Rectangle Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}"
Height="{TemplateBinding Height}"
Width="{TemplateBinding Width}"/>
<Button HorizontalAlignment="Right" Height="20" Width="20" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}
,Path=ButtonVisiblity,Mode=TwoWay}"
Click="Button_Click" Margin="5" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> How can i do that???
I want to add button click event to a button present in the Resource Dictionary (Generic.xaml) of a custom radShape
<Style TargetType="{x:Type local:SideView}">
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Height" Value="50"/>
<Setter Property="Width" Value="100"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:SideView}">
<Grid Background="{TemplateBinding Background}">
<Rectangle Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}"
Height="{TemplateBinding Height}"
Width="{TemplateBinding Width}"/>
<Button HorizontalAlignment="Right" Height="20" Width="20" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}
,Path=ButtonVisiblity,Mode=TwoWay}"
Click="Button_Click" Margin="5" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> How can i do that???