/// <summary> /// Creates and adds a typical SearchView tile to the view. /// </summary> /// <param name="mainText">Title text for tile.</param> /// <param name="upperText">Top text of tile.</param> /// <param name="parenthNum">A number to be put below the main text in parenthesis.</param> /// <param name="notes">Smaller text between Title and Parenthesis number</param> /// <param name="target">Target method to perform on click.</param> internal static void AddChild(string mainText, string upperText, int parenthNum, string notes = "", ListButtons.target target = null) { ListButtons b = createButton().Child as ListButtons; b.Text = mainText; b.ID = parenthNum; b.Time = upperText; if (notes.Equals("")) b.MidText.Visibility = Visibility.Collapsed; else b.MidText.Text = notes; b.OnClick = target; Constants.mainWindow.SearchView.MainContent.Children.Add(b.Parent as UIElement); }
/// <summary> /// Creates a border whose child is a ListButton. /// </summary> /// <returns>ListButton with basic layout.</returns> internal static Border createButton() { ListButtons b = new ListButtons(); b.Width = b.Height = Double.NaN; Border bo = new Border(); bo.BorderBrush = new SolidColorBrush(Colors.Gray); bo.BorderThickness = new Thickness(1); bo.Child = b; bo.Width = 200; return bo; }