mardi 23 janvier 2018

UI ignores the boolean from the checkbox

For some reason, even if I bind some of the properties of some components with Visual Studio's own data binding tool, the affected components fail to read the Boolean value. The only hint as to why it happened is one of the components throws Error 4 (on System.Windows.Data) when it tries to read a value from a checkbox.

Here are the affected components:

                        <xctk:IntegerUpDown x:Name="SlotSelector" Value="1" Height="22" Margin="427,42,0,0"
                                        VerticalAlignment="Top" HorizontalAlignment="Left" Width="50" Maximum="24"
                                        Minimum="1" IsUndoEnabled="False" IsManipulationEnabled="True"
                                        IsEnabled="{Binding IsChecked, ElementName=SlotSelectCheckbox, Mode=OneWay}" />

This bit of XAML throws the error when it tries to read the IsChecked value from the Checkbox SlotSelectCheckbox

                        <TextBox x:Name="LocationBackup" HorizontalAlignment="Left" Height="29" Margin="0,51,0,0"
                             TextWrapping="Wrap" VerticalAlignment="Top" Width="505"
                             Text="{Binding Source={x:Static properties1:Settings.Default},
                           Path=AutoBackupLocation}"
                             TextChanged="LocationBackup_TextChanged" IsEnabled="{Binding IsEnabled, ElementName=AutoBackupCheckbox, FallbackValue=False, Mode=OneWay, NotifyOnTargetUpdated=True, NotifyOnSourceUpdated=True, TargetNullValue=False}"  />

                        <syncfusion:ButtonAdv x:Name="BrowseButton" Content="ButtonAdv" HorizontalAlignment="Left"
                                          Height="29" Label="{x:Static properties1:Resources.BrowseString}"
                                          Margin="510,51,0,0" VerticalAlignment="Top" Width="90" SizeMode="Normal"
                                          IsMultiLine="True" IconHeight="0" IconWidth="0"
                                          Click="BrowseButton_Click"
                                          syncfusionskin:SfSkinManager.VisualStyle="Metro" IsEnabled="{Binding ElementName=AutoBackupCheckbox, Path=IsChecked}" />

                        <syncfusion:ButtonAdv x:Name="TestBackupButton" Content="{x:Static properties1:Resources.TestString}"
                                          HorizontalAlignment="Left" Height="29"
                                          Label="{x:Static properties1:Resources.TestString}"
                                          VerticalAlignment="Top" Width="103" Margin="10,0,0,0" IconHeight="0"
                                          IconWidth="0"
                                          syncfusionskin:SfSkinManager.VisualStyle="Metro"
                                          Click="TestBackupButton_Click" IsEnabled="{Binding ElementName=AutoBackupCheckbox, Path=IsChecked}" />
                    <syncfusion:ButtonAdv x:Name="RestoreBackupButton" Content="Restore Backup"
                                          HorizontalAlignment="Left" Height="29"
                                          Label="{x:Static properties1:Resources.RestoreBackupString}"
                                          Margin="118,0,0,0" VerticalAlignment="Top" Width="130" IconHeight="0"
                                          IconWidth="0"
                                          syncfusionskin:SfSkinManager.VisualStyle="Metro"
                                          Click="RestoreBackupButton_Click" IsEnabled="{Binding ElementName=AutoBackupCheckbox, Path=IsChecked}" />
                    <syncfusion:ButtonAdv x:Name="DeleteBackupButton" Content="ButtonAdv"
                                          HorizontalAlignment="Left" Height="28"
                                          Label="{x:Static properties1:Resources.DeleteBackupsString}"
                                          Margin="253,1,0,0" VerticalAlignment="Top" Width="108" IconHeight="0"
                                          IconWidth="0"
                                          Click="DeleteBackupButton_Click"
                                          syncfusionskin:SfSkinManager.VisualStyle="Metro" IsEnabled="{Binding IsChecked, ElementName=AutoBackupCheckbox, Mode=OneWay, NotifyOnSourceUpdated=True, NotifyOnValidationError=True}" />

The rest stop reading the data.




Aucun commentaire:

Enregistrer un commentaire