<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The Silverlight Toolkit team is on top of your feedback</title>
	<atom:link href="http://www.jeff.wilcox.name/2009/02/toolkit-community/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeff.wilcox.name/2009/02/toolkit-community/</link>
	<description>Silverlight, rich client apps and web development</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:09:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: pghatak</title>
		<link>http://www.jeff.wilcox.name/2009/02/toolkit-community/comment-page-1/#comment-1260</link>
		<dc:creator>pghatak</dc:creator>
		<pubDate>Fri, 20 Feb 2009 14:31:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2009/02/toolkit-community/#comment-1260</guid>
		<description>Hello Jeff.
since you say here I can get help, and you are the developer of the Autocompletee box, I desperately need some help here. please:

I have  hooked up the Autocomplete box to the default DataGridSelectionAdapter class, that comes with the toolkit example.

However, instead of the default Airport data, I&#039;ve hooked it up to a WCF service, where I get the data. The type of data returned is a List

The problem is instead of showing me the text Person.FullName text in the string, when I change selection in the dropdown, it is showing me the Tostring() of the class type.

Here is my XAML code:
        
            
            
        


Here is my .XAML.CS code :

public partial class Page : UserControl
    {
        
        //private variables
        public Page()
        {
            InitializeComponent();
            // In this version we filter at the server, so Mode=None.
            autoComplete1.SearchMode = AutoCompleteSearchMode.None;
            //Loaded += OnLoaded;
        }
        private void autoComplete1_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (autoComplete1.Text.Length 
            {
                args.Cancel = true;
                WCFPeopleSearchServiceClient client = new WCFPeopleSearchServiceClient();
                client.DoSearchCompleted += client_DoSearchCompleted;
                client.DoSearchAsync(autoComplete1.Text);
            };
        }
        
        /// 
        /// Handle the loaded event.
        /// 
        /// The source object.
        /// The event data.
        //private void OnLoaded(object sender, RoutedEventArgs e)
        //{
        //    autoComplete1.ItemFilter = (search, item) =&gt;
        //    {
        //        Person person = item as Person;
        //        if (person != null)
        //        {
        //            // Interested in: FullName, OR Nickname
        //            string filter = search.ToUpper(CultureInfo.InvariantCulture);
        //            return (person.FullName.ToUpper(CultureInfo.InvariantCulture).Contains(filter)
        //                &#124;&#124; person.NickName.ToUpper(CultureInfo.InvariantCulture).Contains(filter));
        //        }
        //        return false;
        //    };
        //}
        private void client_DoSearchCompleted(object sender, DoSearchCompletedEventArgs e)
        {
            autoComplete1.ItemsSource = e.Result;
            autoComplete1.MinimumPrefixLength = 2;
            autoComplete1.IsTextCompletionEnabled = true;
            // No itemfilter here since we are filtering at the server.
            autoComplete1.PopulateComplete();
        }
    }



    //convertor classes
    public class EmailLinkConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string emailLink = string.Format(&quot;mailto:{0}&quot;, value);
            return emailLink;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }


I have tried many examples, but nothing seems to help. I just need the damn text selected.

And I do not want to call the WCF on the load.

Please help.

Thank you.</description>
		<content:encoded><![CDATA[<p>Hello Jeff.<br />
since you say here I can get help, and you are the developer of the Autocompletee box, I desperately need some help here. please:</p>
<p>I have  hooked up the Autocomplete box to the default DataGridSelectionAdapter class, that comes with the toolkit example.</p>
<p>However, instead of the default Airport data, I&#8217;ve hooked it up to a WCF service, where I get the data. The type of data returned is a List</p>
<p>The problem is instead of showing me the text Person.FullName text in the string, when I change selection in the dropdown, it is showing me the Tostring() of the class type.</p>
<p>Here is my XAML code:</p>
<p>Here is my .XAML.CS code :</p>
<p>public partial class Page : UserControl<br />
    {</p>
<p>        //private variables<br />
        public Page()<br />
        {<br />
            InitializeComponent();<br />
            // In this version we filter at the server, so Mode=None.<br />
            autoComplete1.SearchMode = AutoCompleteSearchMode.None;<br />
            //Loaded += OnLoaded;<br />
        }<br />
        private void autoComplete1_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)<br />
        {<br />
            if (autoComplete1.Text.Length<br />
            {<br />
                args.Cancel = true;<br />
                WCFPeopleSearchServiceClient client = new WCFPeopleSearchServiceClient();<br />
                client.DoSearchCompleted += client_DoSearchCompleted;<br />
                client.DoSearchAsync(autoComplete1.Text);<br />
            };<br />
        }</p>
<p>        ///<br />
        /// Handle the loaded event.<br />
        ///<br />
        /// The source object.<br />
        /// The event data.<br />
        //private void OnLoaded(object sender, RoutedEventArgs e)<br />
        //{<br />
        //    autoComplete1.ItemFilter = (search, item) =&gt;<br />
        //    {<br />
        //        Person person = item as Person;<br />
        //        if (person != null)<br />
        //        {<br />
        //            // Interested in: FullName, OR Nickname<br />
        //            string filter = search.ToUpper(CultureInfo.InvariantCulture);<br />
        //            return (person.FullName.ToUpper(CultureInfo.InvariantCulture).Contains(filter)<br />
        //                || person.NickName.ToUpper(CultureInfo.InvariantCulture).Contains(filter));<br />
        //        }<br />
        //        return false;<br />
        //    };<br />
        //}<br />
        private void client_DoSearchCompleted(object sender, DoSearchCompletedEventArgs e)<br />
        {<br />
            autoComplete1.ItemsSource = e.Result;<br />
            autoComplete1.MinimumPrefixLength = 2;<br />
            autoComplete1.IsTextCompletionEnabled = true;<br />
            // No itemfilter here since we are filtering at the server.<br />
            autoComplete1.PopulateComplete();<br />
        }<br />
    }</p>
<p>    //convertor classes<br />
    public class EmailLinkConverter : IValueConverter<br />
    {<br />
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)<br />
        {<br />
            string emailLink = string.Format(&#8220;mailto:{0}&#8221;, value);<br />
            return emailLink;<br />
        }</p>
<p>        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)<br />
        {<br />
            throw new NotImplementedException();<br />
        }<br />
    }</p>
<p>I have tried many examples, but nothing seems to help. I just need the damn text selected.</p>
<p>And I do not want to call the WCF on the load.</p>
<p>Please help.</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Tucker</title>
		<link>http://www.jeff.wilcox.name/2009/02/toolkit-community/comment-page-1/#comment-1244</link>
		<dc:creator>Ken Tucker</dc:creator>
		<pubDate>Fri, 13 Feb 2009 00:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2009/02/toolkit-community/#comment-1244</guid>
		<description>Thanks for including VB in the toolkit</description>
		<content:encoded><![CDATA[<p>Thanks for including VB in the toolkit</p>
]]></content:encoded>
	</item>
</channel>
</rss>

