Jump to: navigation, search

Changes


XAML

2,947 bytes added, 12:40, 27 April 2020
== Converters ==
These are classes in our code used to convert one form of data into another (For example: string to color, bool to string, color to string…). We are using it often on Data Bindings, so we can simply ‘change’ the data that got provided by the model. Mostly, in our environment, we use the Converters for the Visibility Property, Background Property or the Source Property (converting Byte to an Image).
 
Initialization of a converter in a XAML file:
<source lang = "xml"> <converters:ItemCountLesserThanToVisibilityConverter
x:Key="ItemCountLesserThanToColConverter"
EqualOrBiggerThan="Visible"
LesserThan="Collapsed" />
<!-- This Converter example specifically counts the items that will go into a container (ListView etc..) and gets a parameter passed when it should be a certain visibility. Next example shows you how to configure your converter.-->
</source>
<br>
Using the ItemCountLesserThanToVisiblity in a visibility attribute:
<source lang = "xml"> <Visibility="{Binding Source={StaticResource RootListFilter}, Path=Count, Converter={StaticResource ItemCountLesserThanToColConverter }, ConverterParameter=13, FallbackValue=Collapsed}"/>
<!--In this case is the parameter 13, so when it gets passed the Count gets checked e.g. how many items there are and when it’s under 13 it will collapse. -->
</source>
<br>
Example of an EqualToVisConverter being used in order to set the visibility of a grid:
<source lang = "xml"> <Grid Visibility="{Binding Values [MP_SCOPECHANGE], Converter={StaticResource
EqualToVisConverter}, ConverterParameter=30}">
</Grid>
<!--The grid will be ONLY visible if the value of this MetaProperty equals the value of the converter parameter. -->
</source>
<br>
Example of a StringFormatConverter, which converts a value into a string and also accepts a parameter, in this case the GlobalDateTimeFormat, which ‘tells’ the converter how to format the string:
<source lang = "xml"> <TextBlock Grid.Row="1" Text="{Binding Values [MP_LATE_START_MATAP], Converter={StaticResource StringFormatConverter}, ConverterParameter={StaticResource GlobalDateTimeFormat} }"/>
</source>
 
=== Basic ===
* AddStringSuffixConverter
* ValueValidityToVisibilityConverter
[[Category:WinX|XAML]]
=== Advanced ===
** [[CloseDialogCommand]]
== Differences between Xamarin and UWP ==
 
As you maybe already noticed we have two different clients, one is WinX UWP and the other one Xamarin, which is used to develop clients for three different platforms namely iOS, Android and new UWP (-> it doesn’t really differentiate from the previously mentioned UWP except it’s developed in a different framework which is Xamarin in this case). The customizing stays the same in case of the syntax, but there are some differences in the naming of controls and attributes. Unfortunately, there is no decent documentation of these differences, but the Microsoft documentation and in general the internet can support you when searching e.g. for a control in Xamarin that you used in UWP.
More specific documentations about Xamarin Customizing can be found under “[[XAMARIN XAML]]”.
== Namespace changes ==