problem with activating radio button when running not on launcher
Posted: 29 Jul 2024, 11:23
i am trying to run the following code on SDL (it works on noesis launcher).
in noesis launcher the functionality works but on SDL not - i do not get any responce to press on the button.
i already run sucessfully some staff on sdl with event triggers etc but this is the first time i try to something like this with DataTriggers.
maybe i am missing some component registration?
thanks in advance
in noesis launcher the functionality works but on SDL not - i do not get any responce to press on the button.
Code: Select all
<UserControl x:Class="SelectOrientationScreen.cSelectOrientationView"
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:local="clr-namespace:SelectOrientationScreen"
xmlns:b="http://schemas.microsoft.com/expression/2010/interactivity">
<UserControl.Resources>
<Style x:Key="CustomRadioButtonStyle1" TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Canvas>
<Image x:Name="RadioButtonImage" />
<TextBlock x:Name="RadioButtonText" Text="{Binding RadioButton1Text}" Width="215" Height="64" FontWeight="Normal" FontSize="50" Margin="97,12,0,0"/>
</Canvas>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="True">
<Setter TargetName="RadioButtonImage" Property="Source" Value="radio_button_on.png"/>
<Setter TargetName="RadioButtonText" Property="FontWeight" Value="Bold"/>
<Setter TargetName="RadioButtonText" Property="Foreground" Value="White"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource Self}}" Value="False">
<Setter TargetName="RadioButtonImage" Property="Source" Value="radio_button_off.png"/>
<Setter TargetName="RadioButtonText" Property="FontWeight" Value="Normal"/>
<Setter TargetName="RadioButtonText" Property="Foreground" Value="#777AE0"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Canvas>
<RadioButton x:Name="RadioButton1" IsChecked="{Binding IsRadioButton1On, Mode=TwoWay }" Style = "{StaticResource CustomRadioButtonStyle1}" Margin="152,420" Content="Checkbox 1"/>
</Canvas>
</UserControl>
maybe i am missing some component registration?
thanks in advance