Skip to main content

ferroui_controls/auto_complete_box/
populated_event_args.rs

1// (c) Copyright Microsoft Corporation.
2// This source is subject to the Microsoft Public License (Ms-PL).
3// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details.
4// All other rights reserved.
5//
6// Ported from the Silverlight Toolkit sources as adapted by the upstream
7// project; the license text is in the `NOTICE.md` of this crate.
8
9use crate::ItemsSource;
10
11/// Provides data for the `Populated` event of the
12/// [`AutoCompleteBox`](super::AutoCompleteBox).
13#[derive(Clone, PartialEq)]
14pub struct PopulatedEventArgs {
15    data: ItemsSource,
16}
17
18impl PopulatedEventArgs {
19    /// Initializes a new instance of the [`PopulatedEventArgs`].
20    ///
21    /// `data` is the list of possible matches added to the drop-down
22    /// portion of the control.
23    pub fn new(data: ItemsSource) -> Self {
24        Self { data }
25    }
26
27    /// Gets the list of possible matches added to the drop-down portion of
28    /// the control.
29    pub fn data(&self) -> &ItemsSource {
30        &self.data
31    }
32}