Advertisement
Ludwiq

Untitled

Jun 10th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1.     public partial class WebViewSelectorGenerator : ContentPage
  2.     {
  3.  
  4.         public List<SlotsButtons> slots;
  5.  
  6.         private SlotsButtons _selectedItem;
  7.  
  8.         public SlotsButtons SelectedItem
  9.         {
  10.             get
  11.             {
  12.  
  13.                 return _selectedItem;
  14.  
  15.             }
  16.             set
  17.             {
  18.                 _selectedItem = value;
  19.  
  20.                 if (_selectedItem == null)
  21.                     return;
  22.  
  23.                 // now here you have an instance of SlotsButtons
  24.                 // you can do :
  25.                 var id = _selectedItem.ID;
  26.                 // store your id in a page variable for example and later on do the logic
  27.             }
  28.         }
  29.  
  30.     public WebViewSelectorGenerator()
  31.     {
  32.         [...]
  33.  
  34.         slots = new List<SlotsButtons>();
  35.         slots.Add(new SlotsButtons { Text = "1" });
  36.         slots.Add(new SlotsButtons { Text = "2" });
  37.  
  38.         BindingContext = this;
  39.     }
  40. [...]
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement