Jump to: navigation, search

Changes


XAML

338 bytes removed, 10:51, 25 August 2016
/* Converters */
Example:
<source lang = "xml">
<StackPanel Orientation="Horizontal"> <StackPanel.Resources> <!-- Instantiate the converter and bind the the Param0 to a SearchBox on this page --> <converters:StringFormatConverter x:Key="URIConverter" Param0="{Binding ElementName=SkypeQuery, Path=QueryText}" /> </StackPanel.Resources> <!-- Create a SearchBox that calls the typed Name via Skype on enter --> <SearchBox x:Name="SkypeQuery" Width="240" Height="40" FontSize="18" PlaceholderText="Call Skype"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="QuerySubmitted"> <Core:InvokeCommandAction Command="{Binding NavigateToURICommand}" CommandParameter="{Binding ElementName=EcoQuery, Path=QueryText, Converter={StaticResource URIConverter}, ConverterParameter=skype:\{0\}\?call }" /> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> </SearchBox> </StackPanel>
</source>
 
* [[EvalExpressionConverter]]
Example:
<source lang = "xml">
<Grid> <Grid.Resources> <!-- Instantiate the converter and bind the Context to the current DataContext, the Param0 to a UI element of this page --> <converters:EvalExpressionConverter x:Key="CodeConverter" Context="{Binding}" Param0="{Binding ElementName=ChildListView, Path=Name}" /> </Grid.Resources> <StackPanel Orientation="Horizontal"> <!-- Create a TextBox where we can enter a C# expression --> <TextBox x:Name="CodeQuery" MinWidth="240" Height="40" Margin="0,10,10,0" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="18" PlaceholderText="Expression"> </TextBox> <!-- Create a TextBlock where we display the result of the compiled expression --> <TextBlock Text="{Binding ElementName=CodeQuery, Path=Text, Converter={StaticResource CodeConverter}}" /> </StackPanel> </Grid>
</source>