Search Wiki:

NYTimes.TimesTags

Silverlight Times Tag Search object. Typical usage is to find the matching for specific tags that can then be used in the Articles search API. See this article for more information.

Properties

  • ApiKey Gets or sets the API Key
  • Filter Gets or sets the comma-delimited list to limit the results to the specified Times dictionaries : (Des), (Geo), (Org), (Per)
  • IsLoading Gets a value indicating whether the results are loading
  • Logo Gets the logo for Billboard
  • Max Gets or sets the maximum number of results to return
  • Query Gets or sets the query
  • Tags Gets the tags returned as a collection of NYTimes.Data.Tag objects.

Attached Properties

  • Service Attach this property onto a Silverlight Toolkit AutoComplete box to use the use the tag service without code behind

Example of using the Service Attached Property

TimesTagAutoComplete.png
<UserControl x:Class="DemoNYTimes.TimesTagsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"  
    xmlns:nyt="clr-namespace:NYTimes;assembly=NYTimesSilverlightKit"             
    xmlns:nytvc="clr-namespace:NYTimes.ValueConverters;assembly=NYTimesSilverlightKit"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    >
    <UserControl.Resources>
        <nyt:TimesTags x:Key="Tags"/>
        <nytvc:DictionaryWebdingConverter x:Key="DictionaryWebdingConverter"/>
        <DataTemplate x:Key="TagResultTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="16"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock VerticalAlignment="Center" FontSize="16" FontFamily="Webdings" 
                           Text="{Binding Dictionary, Converter={StaticResource DictionaryWebdingConverter}}" />
                <TextBlock Margin="4,0,0,0" VerticalAlignment="Center" FontFamily="Times New Roman" 
                           FontSize="12" Grid.Column="1" Text="{Binding Mode=OneWay, Path=Value}" 
                           TextWrapping="NoWrap"/>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <inputToolkit:AutoCompleteBox x:Name="Query" 
                    Width="300"                      
                    VerticalAlignment="Center"
                    DataContext="{StaticResource Tags}" 
                    SearchMode="None" 
                    IsTextCompletionEnabled="False" 
                    ItemsSource="{Binding Tags}"
                    ItemTemplate="{StaticResource TagResultTemplate}" 
                    ValueMemberBinding="{Binding Value}"
                    nyt:TimesTags.Service="{StaticResource Tags}"/>
    </Grid>
</UserControl>
Last edited May 4 2009 at 4:05 AM  by mscherotter, version 9
Updating...
Page view tracker