I'm currently having problems with my label content being updated. Is there something I'm missing here to have it update on Current_Plan
property update? See below for implementation:
In my xaml code I have a Label called LabelProductionPlan
set up like the following:
<Label x:Name="LabelProductionPlan"
Content="{Binding Current_Plan.ProductionPlanName,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"/>
In my MainWindow.xaml.cs
file, the setup is as follows:
public partial class MainWindow : Window
{
private FrontEndManager FEM;
public MainWindow()
{
InitializeComponent();
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
FEM = new FrontEndManager
{
Current_Plan = new ProductionPlanModel
{
}
};
LabelProductionPlan.DataContext = FEM;
}}
The FrontEndManager
is setup with the following Fody feature to implement PropertyChanging:
[ImplementPropertyChanging]
public class FrontEndManager
{
public ProductionPlanModel Current_Plan { get; set; }
}
With the ProductionPlanModel
implemented as well with PropertyChanging
:
[ImplementPropertyChanging]
public class ProductionPlanModel
{
public string ProductionPlanName { get; set; }
}