// public event TappedEventHandler Click; public UnderLineSwitchButton() { this.InitializeComponent(); listOfButton.Add(DefualtButton); TextColor = DefualtButton.title.Foreground; UnderLineColor = DefualtButton.underline.Background; this.SelectColor = UnderLineColor; DefualtButton.Tapped += Button_Tapped; UnSelectColor = new SolidColorBrush(Colors.Black); this.Loaded += UnderLineSwitchButton_Loaded; this.defaultButton = DefualtButton; }
public void AddButton(string title) { var button = new UnderLineButton(); button.title.Text = title; button.title.Foreground = TextColor; button.underline.Background = UnderLineColor; button.Tapped += Button_Tapped; button.title.Opacity = 0.6; button.title.Foreground = UnSelectColor; button.underline.Background = null; listOfButton.Add(button); ButtonContent.Children.Add(button); ReSizeButton(); }