PopulatingEventArgs.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // (c) Copyright Microsoft Corporation.
  2. // This source is subject to the Microsoft Public License (Ms-PL).
  3. // Please see http://go.microsoft.com/fwlink/?LinkID=131993] for details.
  4. // All other rights reserved.
  5. using System;
  6. using System.Windows;
  7. namespace System.Windows.Controls
  8. {
  9. /// <summary>
  10. /// Provides data for the
  11. /// <see cref="E:System.Windows.Controls.AutoCompleteBox.Populating" />
  12. /// event.
  13. /// </summary>
  14. /// <QualityBand>Stable</QualityBand>
  15. public class PopulatingEventArgs : RoutedEventArgs
  16. {
  17. /// <summary>
  18. /// Gets the text that is used to determine which items to display in
  19. /// the <see cref="T:System.Windows.Controls.AutoCompleteBox" />
  20. /// control.
  21. /// </summary>
  22. /// <value>The text that is used to determine which items to display in
  23. /// the <see cref="T:System.Windows.Controls.AutoCompleteBox" />.</value>
  24. public string Parameter { get; private set; }
  25. /// <summary>
  26. /// Gets or sets a value indicating whether the
  27. /// <see cref="E:System.Windows.Controls.AutoCompleteBox.Populating" />
  28. /// event should be canceled.
  29. /// </summary>
  30. /// <value>True to cancel the event, otherwise false. The default is
  31. /// false.</value>
  32. public bool Cancel { get; set; }
  33. /// <summary>
  34. /// Initializes a new instance of the
  35. /// <see cref="T:System.Windows.Controls.PopulatingEventArgs" />.
  36. /// </summary>
  37. /// <param name="parameter">The value of the
  38. /// <see cref="P:System.Windows.Controls.AutoCompleteBox.SearchText" />
  39. /// property, which is used to filter items for the
  40. /// <see cref="T:System.Windows.Controls.AutoCompleteBox" /> control.</param>
  41. public PopulatingEventArgs(string parameter)
  42. {
  43. Parameter = parameter;
  44. }
  45. #if !SILVERLIGHT
  46. /// <summary>
  47. /// Initializes a new instance of the
  48. /// <see cref="T:System.Windows.Controls.PopulatingEventArgs" />.
  49. /// </summary>
  50. /// <param name="parameter">The value of the
  51. /// <see cref="P:System.Windows.Controls.AutoCompleteBox.SearchText" />
  52. /// property, which is used to filter items for the
  53. /// <see cref="T:System.Windows.Controls.AutoCompleteBox" /> control.</param>
  54. /// <param name="routedEvent">The routed event identifier for this instance.</param>
  55. public PopulatingEventArgs(string parameter, RoutedEvent routedEvent)
  56. : base(routedEvent)
  57. {
  58. Parameter = parameter;
  59. }
  60. #endif
  61. }
  62. }