Control Loses Value

A weird one.

Using the latest version of .NET MAUI and I have PageModels bound to the page's Binding context.  The pages use Community Toolkit;s 'Observable Property' to handle the INotipyPropertyChanged events 

I use the community toolkit to create a wizard with the StateContainer.  Each state has a frame on the screen and you can step backwards and forwards. On these frames I have SyncFusion TextInputLayouts.  What I am finding is that if I go back - which causes a previously visible control to be re-presented then the control is empty.    

I have added raw entry controls to the frame in question and bound them to the same property as the SyncFusion Controls and the value is displayed properly in the raw entry controls - so I am happy that the binding to the PageModel is working fine it is just the sync fusion control not displaying it. The xaml is:  


<StackLayout VerticalOptions="Fill" Spacing="10"
toolkit:StateContainer.CurrentState="{Binding CustomStateKey}">

<toolkit:StateContainer.StateViews>

<Frame Style="{StaticResource Wizard}" HasShadow="True" HeightRequest="400"
toolkit:StateView.StateKey="{x:Static budgetPlanner:Constants.PaymentWizardBasicPage}">
<Frame.Shadow>
<Shadow Brush="Black"
Offset="1,2"
Radius="1"
Opacity="0.4" />
</Frame.Shadow>
<VerticalStackLayout
VerticalOptions="Start" Margin="1" Padding="5, 20,4, 10">

<core:SfTextInputLayout Hint="{pages:Translate Description}" HeightRequest="80"
TrailingViewPosition="Outside"
LeadingViewPosition="Inside"
ErrorText="Required">

<Entry Text="{Binding Description}"
ReturnType="Next"
Background="{StaticResource SecondaryDarkText}"
x:Name="Description" />

<core:SfTextInputLayout.LeadingView>
<Label Padding="0" Margin="0" FontSize="25"
TextColor="{StaticResource Orange}"
FontFamily="MaterialFontFamily"
Text="{x:Static helpers:IconImages.Description}">
</Label>
</core:SfTextInputLayout.LeadingView>

<core:SfTextInputLayout.TrailingView>

<Label Text="&#xf2d7;" FontFamily="MaterialFontFamily" FontSize="26"
TextColor="{StaticResource Orange}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ShowHelpCommand}"
CommandParameter="create-a-new-payment" />
</Label.GestureRecognizers>
</Label>

</core:SfTextInputLayout.TrailingView>
</core:SfTextInputLayout>


<Entry Text="{Binding Description}"
WidthRequest="100" HeightRequest="50" BackgroundColor="Aqua" />

<Entry Text="{Binding Amount}"
WidthRequest="100" HeightRequest="50" BackgroundColor="Aqua" />

<core:SfTextInputLayout
ErrorLabelStyle="{StaticResource ErrorLabel}"
Hint="{pages:Translate Amount}"
LeadingViewPosition="Inside">

<core:SfTextInputLayout.Triggers>
<DataTrigger TargetType="core:SfTextInputLayout"
Binding="{Binding Amount}"
Value="0">
<Setter Property="HasError" Value="True" />
<Setter Property="ErrorText" Value="Enter an amount for the Payment" />
</DataTrigger>
</core:SfTextInputLayout.Triggers>

<core:SfTextInputLayout.LeadingView>
<Label Padding="0" Margin="0" FontSize="25"
TextColor="{StaticResource Orange}"
FontFamily="MaterialFontFamily"
Text="{x:Static helpers:IconImages.Money}">
</Label>
</core:SfTextInputLayout.LeadingView>

<inputs:SfNumericEntry
CustomFormat="c" HeightRequest="120"
ValueChangeMode="OnKeyFocus"
Value="{Binding Amount}" />

</core:SfTextInputLayout>

<Label Text="{pages:Translate PaymentOrBill}"
Style="{StaticResource OrangeLabel}" FontSize="14" FontAttributes="Bold" />

<core:SfChipGroup HorizontalOptions="StartAndExpand"
ItemsSource="{Binding CreditOrDebit}"
ChipPadding="0,8,0,0"
SelectionIndicatorColor="White"
SelectedChipTextColor="White"
SelectedChipBackground="{StaticResource Orange}"
ChoiceMode="Single" ShowIcon="False"
ChipType="Choice"
SelectedItem="{Binding CreditOrDebitSelection}"
DisplayMemberPath="Display">
<core:SfChipGroup.ChipLayout>
<FlexLayout
HorizontalOptions="CenterAndExpand"
VerticalOptions="Center"
Direction="Row"
Wrap="Wrap"
JustifyContent="Start"
AlignContent="Start"
AlignItems="Start" />
</core:SfChipGroup.ChipLayout>
</core:SfChipGroup>

</VerticalStackLayout>
</Frame>

And the attached screen show show the page with the sync fusion controls only showing the place holder text - but the Entry control show the bound data.


Attachment: Simulator_Screenshot__iPhone_15__20240716_at_10.49.10.png_9857bfab.zip

2 Replies 1 reply marked as answer

AS Ashley July 16, 2024 10:30 AM UTC

About an hour after posting this there was ac nuget update - and it seems to have fixed the issue.


Marked as answer

PR Preethi Rajakandham Syncfusion Team July 17, 2024 05:43 AM UTC

Hi Ashley,

Thank you for the update. 

We are glad that the issue is resolved. We will proceed with marking this thread as solved. Please let us know if you need further assistance. As always, we are happy to help you out. 

Regards,

Preethi R


Loader.
Up arrow icon