Changes

Xamarin XAML

1,410 bytes added, 20 September
/* Known issues */ Added info on how to reload PDFView when document changes
'''This issue is only known on tablet devices with Android 14.'''
<br><br>
=== DataTrigger to set Footer Properties in a ListView ===
</controls:SfListViewExt>
</syntaxhighlight>
<br><br>
=== Incorrect glyphs may be shown on buttons ===
</Button>
</syntaxhighlight>
<br><br>
=== Buttons and gesture recognizers ===
In Xamarin XAML, you can use gesture recognizers on many UI elements such as a Grid to enable the latter to interact with user inputs.
<br/>
Therefore, you should always seek alternatives for Buttons.
'''If only one command is needed''', use the standard Command property on the Button, e.g.
<syntaxhighlight lang="xml">
<br/>
Or if multiple commands are needed, use Behaviors '''instead''', e.g.
<syntaxhighlight lang="xml">
</Button.Behaviors>
</Button>
</syntaxhighlight>
<br>
<br>
=== No dynamic reloading of Document Viewer ===
[[File:PDFViewerFixWiki.JPG]]
 
In a customizing that combines a single-selection list of documents with some kind of viewer (especially UBIKDocumentContentArea), it is generally the case that switching the document causes the document viewer to then appear blank. The technical reason is that the PDFViewer used in the UBIKDocumentContentArea is not reloaded once the document content is reloaded.
 
An easy fix is to apply a DataTrigger that unloads the ContentView when the document content is null, as the ContentView is forced to rerender itself when the trigger condition is no longer met.
 
<syntaxhighlight lang="xml">
<!-- Document Viewer -->
<controls:UBIKContentView
x:Name="DoucmentViewer"
BindingContext="{Binding SelectedItem, Source={x:Reference DocumentList}}"
Content="{Binding [UBIKDocumentContentArea], Source={x:Static services:TemplateService.Instance}}">
 
<controls:UBIKContentView.Triggers>
<DataTrigger TargetType="controls:UBIKContentView" Binding="{Binding SelectedItem.DocumentViewModel.DocumentContent, Source={x:Reference DocumentList}, Converter={StaticResource NullToBool}}" Value="True">
<Setter Property="Content" Value="{x:Null}" />
</DataTrigger>
</controls:UBIKContentView.Triggers>
</controls:UBIKContentView>
</syntaxhighlight>
511
edits