Win A free copy of the 'Windows Presentation Foundation 4.5 Cookbook', just by commenting!
For the contest, Packt Publishing has two eBook copies of Windows Presentation Foundation 4.5 Cookbookto be given away to two lucky winners.
How you can win:
To win your copy of this book, all you need to do is come up with a comment below highlighting the reason "why you would like to win this book”.
Duration of the contest & selection of winners:
The contest is valid for 14 days (until December 3), and is open to everyone. Winners will be selected on the basis of their comment posted.
Windows Presentation Foundation 4.5 Cookbookis written by Pavel Yosifovich, the CTO of CodeValue (http://www.codevalue.net), a software development, consulting, and training company, based in Israel.
This book is written in an easy-to-read style, with a strong emphasis on real-world, practical examples. Step-by-step explanations are provided for performing important tasks. This book is the best guide for C# developer who is looking forward to increase understanding and knowledge of WPF.
Using this book, readers will learn to build complex and flexible user interfaces using XAML, perform lengthy operations asynchronously while keeping the UI responsive, get well-versed with WPF features such as data binding, layout, resources, templates, and styles and also customize a control’s template to alter appearance but preserve behavior.
In the next days I will post my review on this book. In the meantime, here’s the table of contents:
Chapter 1: Foundations
Chapter 2: Resources
Chapter 3: Layout and Panels
Chapter 4: Using Standard Controls
Chapter 5: Application and Windows
Chapter 6: Data Binding
Chapter 7: Commands and MVVM
Chapter 8: Styles, Triggers, and Control Templates
Chapter 9: Graphics and Animation
Chapter 10: Custom Elements
Chapter 11: Threading
I’m waiting for your comments!
There are numerous pages that show how to do this with PowerShell, but I found none on how to do it with plain old C#, so here it goes!
To abbreviate, I wanted to have SharePoint suggest the site collection user’s names after the first letters are filled in a search site’s search box. Here’s how I did it:
1: //get the Search Service Application (replace with your own name)
2: SearchServiceApplication searchApp = farm.Services.GetValue<SearchQueryAndSiteSettingsService>().Applications.GetValue<SearchServiceApplication>("Search Service Application") as SearchServiceApplication;
4: Ranking ranking = new Ranking(searchApp);
6: //replace EN-US with your language of choice
7: LanguageResourcePhraseList suggestions = ranking.LanguageResources["EN-US"].QuerySuggestionsAlwaysSuggestList;
9: foreach (SPUser user in rootWeb.Users)
11: suggestions.AddPhrase(user.Name, String.Empty);
14: //get the job that processes suggestions and run it
15: SPJobDefinition job = SPFarm.Local.Services.OfType<SearchService>().SelectMany(x => x.JobDefinitions).Where(x => x.Name == "Prepare query suggestions").Single();
You may do this, for example, on a feature. Of course, feel free to change users for something else, all suggestions are treated as pure text.