void HandleLabelClick (object sender, EventArgs e) { if (sender == ActiveLabel) { return; } HorizontalMenuLabel label = sender as HorizontalMenuLabel; if (label != null) { ActiveLabel = label; } if (OnLabelClick != null) { OnLabelClick (new object (), null); } }
public HorizontalMenu (Activity activity) : base (activity) { BackgroundColor = CustomColors.LightColorDim; mapLabel = new HorizontalMenuLabel (activity); mapLabel.Text = "Map"; mapLabel.Click += HandleLabelClick; myListLabel = new HorizontalMenuLabel (activity); myListLabel.Text = "My Places"; myListLabel.Click += HandleLabelClick; AddViews ( mapLabel, myListLabel ); ActiveLabel = mapLabel; }
public void RestoreInitalState () { if (ActiveLabel == mapLabel) { return; } ActiveLabel = mapLabel; if (OnLabelClick != null) { OnLabelClick (new object (), null); } }