Guest User

Untitled

a guest
Nov 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. public class AutoSuggestTextBox: TextBox
  2. {
  3. protected override AutomationPeer OnCreateAutomationPeer()
  4. {
  5. return new AutoSuggestTextBoxAutomationPeer(this);
  6. }
  7.  
  8. public ListBox SuggestionListBox;
  9. }
  10.  
  11. internal class AutoSuggestTextBoxAutomationPeer : TextBoxAutomationPeer
  12. {
  13. public AutoSuggestTextBoxAutomationPeer(AutoSuggestTextBox owner) : base(owner)
  14. {
  15.  
  16. }
  17.  
  18. protected override List<AutomationPeer> GetControlledPeersCore()
  19. {
  20. List<AutomationPeer> controlledPeers = new List<AutomationPeer>();
  21.  
  22. AutoSuggestTextBox owner = Owner as AutoSuggestTextBox;
  23.  
  24. controlledPeers.Add(UIElementAutomationPeer.CreatePeerForElement(owner.SuggestionListBox));
  25.  
  26. return controlledPeers;
  27. }
  28. }
Add Comment
Please, Sign In to add comment