public static StackPanel GetHeaderInsertFilter(StackPanel stk, int row, int Column, Grid parent) { stk.Background = UtilWPF.Vocour_header; UtilWPF.SetGridPosition(stk, row, Column, parent); return(stk); }
public static Button Quest_Edit(Button reference, int row, int Column, Grid parent, IQuest quest, QuestWpfItem wpf_item, StackPanel item_line) { var btn = Get(reference, row, Column, parent, UtilWPF.GetIconButton("save_black")); btn.Click += async(source, e) => { btn.Content = UtilWPF.GetIconButton("save"); await System.Threading.Tasks.Task.Delay(2000); btn.Content = UtilWPF.GetIconButton("save_black"); if (quest is VocVM) { QuestWpfUtil.EditClick(quest as VocVM, wpf_item as VocWpfItem, item_line); } else if (quest is PronVM) { QuestWpfUtil.EditClick(quest as PronVM, wpf_item as PronWpfItem, item_line); } else if (quest is SpellVM) { QuestWpfUtil.EditClick(quest as SpellVM, wpf_item as SpellWpfItem, item_line); } }; return(btn); }
public static StackPanel Get(StackPanel reference, int row, int Column, Grid parent) { reference.Orientation = Orientation.Horizontal; UtilWPF.SetGridPosition(reference, row, Column, parent); return(reference); }
public static TextBox Get(TextBox reference, int row, int Column, Grid parent, string content) { var txt = Get(reference, content); UtilWPF.SetGridPosition(txt, row, Column, parent); return(txt); }
public static ButtonActive Is_active(ButtonActive reference, int row, int Column, Grid parent, bool isActive) { UtilWPF.SetGridPosition(reference, row, Column, parent); CreateBtnActive(reference, isActive); return(reference); }
public static Grid Get(int row, int Column, Grid parent, List <int> ColumnSizes, int rowQuantity) { var grid = Get(ColumnSizes, rowQuantity); UtilWPF.SetGridPosition(grid, row, Column, parent); return(grid); }
public static Grid GetRow(Grid reference, int row, int Column, Grid parent, List <int> ColumnSizes) { SetColumns(reference, ColumnSizes); UtilWPF.SetGridPosition(reference, row, Column, parent); reference.RowDefinitions.Add(new RowDefinition()); return(reference); }
public static Button Definition(Button reference, int row, int Column, Grid parent, string def, TextBox txt_def) { var btn = Get(reference, row, Column, parent, UtilWPF.GetIconButton("definition")); CreateBtnLineBehavior(def, txt_def, btn); return(btn); }
public static CheckBox Get(CheckBox reference, int row, int Column, Grid parent, string content, bool isChecked) { var cb = Get(reference, content, isChecked); UtilWPF.SetGridPosition(cb, row, Column, parent); return(cb); }
public static Button Get(Button reference, int row, int Column, Grid parent, object content) { var btn = Get(reference, content); UtilWPF.SetGridPosition(btn, row, Column, parent); return(btn); }
public static Label Get(Label reference, int row, int Column, Grid parent, string content) { var lbl = Get(reference, content); UtilWPF.SetGridPosition(reference, row, Column, parent); return(reference); }
public static ComboBox Get(ComboBox reference, int row, int Column, Grid parent) { var cb = Get(reference); UtilWPF.SetGridPosition(cb, row, Column, parent); return(cb); }
public static TextBox PtBr(TextBox reference, string ptBr, StackPanel parent) { var txt = Get(reference, ptBr, parent); txt.Visibility = Visibility.Collapsed; txt.Background = UtilWPF.GetBrushFromHTMLColor("#edfaeb"); txt.ToolTip = "PtBr"; return(txt); }
public static TextBox Bulk_Insert(TextBox reference, Grid parent) { reference.Text = "// format: words;answer"; reference.TextWrapping = TextWrapping.Wrap; reference.AcceptsReturn = true; UtilWPF.SetGridPosition(reference, 0, 0, parent); Grid.SetRowSpan(reference, 3); return(reference); }
public static Button PtBr(Button reference, int row, int Column, Grid parent, string ptBr, TextBox txt_ptBr) { var content = ptBr.IsEmpty() ? UtilWPF.GetIconButton("br_gray") : UtilWPF.GetIconButton("br"); var btn = Get(reference, row, Column, parent, content); CreateBtnLineBehavior(ptBr, txt_ptBr, btn); return(btn); }
public static Button Remove(Button reference, int row, int Column, Grid parent, StackPanel item_line) { var btn = Get(reference, row, Column, parent, UtilWPF.GetIconButton("remove_v2")); btn.Height = 28; btn.Width = 28; btn.Click += (source, e) => item_line.Children.Clear(); return(btn); }
public static StackPanel GetListItems(int row, int Column, Grid parent) { var stk = new StackPanel(); //stk.Background = UtilWPF.Vocour_row_off; var viewer = new ScrollViewer(); viewer.Content = stk; UtilWPF.SetGridPosition(viewer, row, Column, parent); return(stk); }
public static Grid Bulk_Insert(Grid reference, Grid parent) { SetColumns(reference, new List <int>() { 9, 1 }); reference.RowDefinitions.Add(new RowDefinition()); reference.RowDefinitions.Add(new RowDefinition()); reference.RowDefinitions.Add(new RowDefinition()); reference.Margin = new Thickness(2, 0, 2, 0); UtilWPF.SetGridPosition(reference, 0, 0, parent); reference.Visibility = Visibility.Collapsed; reference.Background = UtilWPF.Vocour_header; return(reference); }
public static Button Bulk_back(Grid parent, IQuestWpfHeader header) { var btn = new Button(); btn.Content = "Back"; btn.VerticalAlignment = VerticalAlignment.Center; btn.Margin = new Thickness(1, 0, 1, 0); btn.Height = 28; btn.Click += (source, e) => { header.Grid_bulk_insert.Visibility = Visibility.Collapsed; header.Stk_insert.Visibility = Visibility.Visible; }; UtilWPF.SetGridPosition(btn, 2, 1, parent); return(btn); }
private static void CreateBtnActive(ButtonActive reference, bool isActive) { reference.Content = isActive ? UtilWPF.GetIconButton("switch_on") : UtilWPF.GetIconButton("switch_off"); reference.VerticalAlignment = VerticalAlignment.Center; reference.Margin = new Thickness(1, 0, 1, 0); reference.Background = Brushes.Transparent; reference.BorderBrush = Brushes.Transparent; reference.Width = 32; reference.Height = 32; reference.IsActived = isActive; reference.Click += (source, e) => { reference.IsActived = !reference.IsActived; reference.Content = reference.IsActived ? UtilWPF.GetIconButton("switch_on") : UtilWPF.GetIconButton("switch_off");; }; }
public static Label AvgScore(Label reference, int row, int Column, Grid parent, IQuest quest, int duration, bool useColours = true) { var isWeek = duration <= 7; var isMonth = duration <= 30; var avg = isWeek ? quest.Avg_week : (isMonth ? quest.Avg_month : quest.Avg_all); var content = avg + "% " + (isWeek ? "(w)" : isMonth ? "(m)" : ""); var lbl = Get(reference, row, Column, parent, content); if (useColours) { lbl.Foreground = UtilWPF.GetAvgColor(avg); } lbl.ToolTip = isWeek ? "week" : isMonth ? "month" : "all"; return(lbl); }
public static Button Show_bulk_insert(int row, int Column, Grid parent, IQuestWpfHeader header) { var btn = new Button(); btn.Content = UtilWPF.GetIconButton("bulk_insert_2"); btn.VerticalAlignment = VerticalAlignment.Center; //btn.Margin = new Thickness(1, 0, 1, 0); btn.Width = 32; btn.Height = 32; btn.Background = Brushes.Transparent; btn.BorderBrush = Brushes.Transparent; btn.Click += (source, e) => { header.Grid_bulk_insert.Visibility = Visibility.Visible; header.Stk_insert.Visibility = Visibility.Collapsed; }; UtilWPF.SetGridPosition(btn, row, Column, parent); return(btn); }
public static StackPanel GetItemLine(StackPanel parent, bool isGridUpdate) { var stack = new StackPanel(); stack.Margin = new Thickness(0, 2, 2, 2); stack.Background = UtilWPF.GetVocourLine(false, isGridUpdate); stack.MouseEnter += new MouseEventHandler((source, e) => stack.Background = UtilWPF.GetVocourLine(true, isGridUpdate)); stack.MouseLeave += new MouseEventHandler((source, e) => stack.Background = UtilWPF.GetVocourLine(false, isGridUpdate)); if (isGridUpdate) { parent.Children.Insert(0, stack); } else { parent.Children.Add(stack); } return(stack); }