-
String formatting.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<!-- Format results in a list (using escape symbols {}) --> <dg:DataGridColumn Title="Win %" PropertyName="Percentage" Width="0.75*" StringFormat="{}{0:0.00}" /> <!-- Format bound data (using single quotes '') --> <Label Text="{Binding LocalizationResourceManager[ExpiratoryPlateau], Mode=OneWay, StringFormat='{0}[ml/s]'}" /> <!-- Concatenate strings --> <Label Grid.Row="6" Grid.Column="2" FontSize="Micro" BackgroundColor="Beige" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"> <Label.FormattedText> <FormattedString> <Span Text="{Binding LocalizationResourceManager[HighFlow]}" /> <Span Text="{Binding LocalizationResourceManager[DiscrepancyRate]}" /> </FormattedString> </Label.FormattedText> </Label>
-
Add predefined values to a collection control in XAML.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<Picker x:Name="picker" Title="Select a monkey"> <Picker.ItemsSource> <x:Array Type="{x:Type x:String}"> <x:String>Baboon</x:String> <x:String>Capuchin Monkey</x:String> <x:String>Blue Monkey</x:String> <x:String>Squirrel Monkey</x:String> <x:String>Golden Lion Tamarin</x:String> <x:String>Howler Monkey</x:String> <x:String>Japanese Macaque</x:String> </x:Array> </Picker.ItemsSource> </Picker>