Have a WPF UserControl with a DockPanel containing a DevExpress GridControl and, following and outside of the GridControl, a TextBox:
<UserControl x:Class="HellerOven.Setup.SetupGUI.WatlowView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:resx="clr-namespace:HellerOven.Languages"
xmlns:local="clr-namespace:HellerOven.Setup.SetupGUI"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<DockPanel>
<dxg:GridControl x:Name="WatlowSensorsGrid" EnableSmartColumnsGeneration="True" DockPanel.Dock="Top" ItemsSource="{Binding}" FontSize="14" FontWeight="Medium" Height="600" Margin="0,20,0,0">
...
</dxg:GridControl>
<TextBox Text="Alarm activation delay [seconds]" IsReadOnly="True" FontSize="14" Foreground="RoyalBlue" FontWeight="Medium" BorderThickness="0" Height="30"/>
<TextBox Text="30" Name="alarmActivationDelay" FontSize="14" Foreground="RoyalBlue" FontWeight="Medium" BorderThickness="1" Width="100" Height="30"/>
<Button Height="35" Width="200" Click="Add_Button_Click" HorizontalAlignment="Center" DockPanel.Dock="Bottom" Margin="0,50,0,0">
<StackPanel Orientation="Horizontal">
<Image Source="{dx:DXImage Image=Add_32x32.png}" Stretch="Uniform"/>
<TextBlock Text="Add Watlow Sensor" VerticalAlignment="Center" Margin="5 0 0 0" FontSize="14"/>
</StackPanel>
</Button>
</DockPanel>
In the C# constructor for the UserControl, I specify separate DataContext for the GridControl and for the TextBox:
public WatlowView()
{
InitializeComponent();
WatlowSensorsGrid.DataContext = OvenCollections.Instance.SetupWizard.WatlowSensors;
alarmActivationDelay.DataContext = OvenCollections.Instance.SetupWizard.alarmActivationDelay;
}
During program execution, the GridControl and its members are updated in its assigned DataContext, but the simple integer "alarmActivationDelay" is not updated in its assigned DataContext. What am I misunderstanding regarding DataContext? Thanks.