private void HideButtonByTag(int buttonTag) { // TODO: gdTop should be replaced on this var z = UIFunctions.FindControl <WrapPanel>(this.gdTop); Button element = UIFunctions.FindControlByTag <Button>(z, buttonTag.ToString()); if (element != null) { element.Visibility = Visibility.Collapsed; } }