0

Consider the following scenario:

-You have a tabbed interface and it has four tabs.

-You put a few components and you bind them like this:

<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 IsChecked, ElementName=AutoBackupCheckbox, FallbackValue=False, TargetNullValue=False}" 

In this scenario, if the components aren't in the first tab, data binding fails.

acemod13
  • 55
  • 8
  • You are trying to bind to a "SlotSelectCheckbox". Where is this control defined and where is the IntegerUpDown defined. The binding will fail if they reside in different naming scopes. – mm8 Jan 23 '18 at 10:23
  • All of them are in the same window, on the same tab (the program uses a tabbed interface. – acemod13 Jan 23 '18 at 10:29
  • Well, please update your question to clarify this then: https://stackoverflow.com/help/mcve – mm8 Jan 23 '18 at 10:30
  • OK. I've added some extra info (along with something that I noticed just now). – acemod13 Jan 23 '18 at 10:40
  • Didn't you read the link? You need to provided a *reproducible* sample of your issue if you want anyone to be able to help you. – mm8 Jan 23 '18 at 10:42
  • Replaced the XAML with something that is easier to debug. These are the least bit of code where the bug is caused. – acemod13 Jan 23 '18 at 14:35
  • "Easier to debug"? Your issue is not reproducible. – mm8 Jan 23 '18 at 14:37
  • Can you please elaborate? I don't know what exactly do you need. The entire source code? The xaml file? Can you at least show me an example? – acemod13 Jan 23 '18 at 14:41
  • I already did...look at the link I provided. In there you will find all information you need about how to create a Minimal, Complete, and Verifiable example: https://stackoverflow.com/help/mcve – mm8 Jan 23 '18 at 15:13
  • OK. I think I figure out how the bug is triggered. I re-wrote the enite question. – acemod13 Jan 23 '18 at 16:14
  • I don't see a question. But you can't bind to an element in another tab using ElementName. – mm8 Jan 23 '18 at 16:15
  • How can I bind them, then? – acemod13 Jan 23 '18 at 16:19
  • Read up on MVVM: https://msdn.microsoft.com/en-us/library/hh848246.aspx – mm8 Jan 23 '18 at 16:21

0 Answers0