
I have a wizard of several pages, all of which contain property grids which are populated by a datafactory. So, the XAML looks like this:
<ScrollViewer>
<wizard:Wizard x:Name="fctConfigSetupWizard" WindowTitleBehavior="PageTitle" WindowTitleBaseText="Configuration Wizard"
PageSequenceType="Stack"
IsWindowDialogResultUpdatingEnabled="True"
HelpButtonVisible="False"
FinishButtonEnabled="{Binding ValidConfig}">
<wizard:WizardPage x:Name="msmFSPPage" PageType="Interior"
Caption="Caption of page"
Description="Description of page"
Title="Title of Page"
HelpButtonVisible="False"
NextButtonEnabled="{Binding Path=FlexCommSysData.P25CapableSystem}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="Configuration Name" Height="23.277" VerticalAlignment="Top" />
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
MaxLines="1" Margin="-75,0,0,0" HorizontalAlignment="Stretch" Width="Auto"
Text="{Binding Path=FlexCommSysData.Name}"/>
<propgrid:PropertyGrid Name="fctSysDataPG" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
Width="Auto" Height="Auto"
IsSummaryVisible="True"
propgrid:PropertyGrid.IsAsynchronous="False"
SelectedObject="{Binding Path=FlexCommSysData}">
<propgrid:PropertyGrid.Resources>
<Style x:Key="{x:Type propgrid:PropertyGridDataAccessorItem}" TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}"
BasedOn="{StaticResource fctSysDataPgStyle}" />
</propgrid:PropertyGrid.Resources>
<propgrid:PropertyGrid.DataFactory>
<RpWin:CustomDataFactory />
</propgrid:PropertyGrid.DataFactory>
</propgrid:PropertyGrid>
</Grid>
</wizard:WizardPage>
</wizard:Wizard>
</ScrollViewer>
And then in the class "FlexcommSystemData" are all the properties, one of which is a boolean. What I want to happen is when this boolean is set true (the box is checked) a message box will pop up asking the user if they really want to click this. I've hooked this into the property, and that part works fine. The issue is if the user clicks "No" to the message box (don't want to do this) the box still shows checked even though the underlying boolean property is false... so somehow the UI is getting out of sync. If you click forward in the wizard and back again to get the page to refresh, the check box displays correctly. The property looks like this:
[Category("C-5000")]
[Description("Select whether to enforce the FCC narrowbanding mandate or not")]
[DisplayName("Enforce Narrowband")]
public bool NarrowBanding
{
get { return (model_.NarrowBanding == CfgData.TNarrowBanding.NarrowBanding) ? true : false; }
set
{
if (value)
{
model_.UserWantsNarrowbanding();
}
else
model_.NarrowBanding = CfgData.TNarrowBanding.NotNarrowBanding;
NotifyPropertyChanged("NarrowBanding");
}
}
The UserWantsNarrowBanding() method is what pops up the box and can modify the underlying value. You can see at the end, it calls NotifyPropertyChanged() which generates a PropertyChangedEvent. My question is, why is this not sufficient to update the UI? I suspect it has something to do with the fact that this is happening in the middle of the checkbox tick itself, but I'm not sure where else to hook this in at. Any ideas would be greatly apprciated. Thanks!