private LayoutChoice_Set JumpBack_ButtonLayout(StackEntry stackEntry) { int toIndex = -1; for (int i = 0; i < this.layoutEntries.Count; i++) { if (this.layoutEntries[i] == stackEntry) { toIndex = i; break; } } if (toIndex >= this.backButton_layouts.Count) { Button newButton = new Button(); newButton.Clicked += Button_Clicked; this.backButtons.Add(newButton); this.backButton_layouts.Add(LayoutCache.For(new ButtonLayout(newButton))); } Button button = this.backButtons[toIndex]; button.Text = stackEntry.Name; return(this.backButton_layouts[toIndex]); }
public bool RemoveLayout() { if (this.layoutEntries.Count > 1) { StackEntry entry = this.layoutEntries.Last(); this.layoutEntries.RemoveAt(this.layoutEntries.Count - 1); foreach (OnBack_Listener listener in entry.Listeners) { listener.OnBack(entry.Layout); } this.updateSubLayout(); return(true); } return(false); }
private void button_Click(object sender, System.EventArgs e) { // find the sender's name Button button = sender as Button; if (button != null) { button = (Button)sender; // find where the sender wants to go LayoutChoice_Set sourceLayout = this.buttonLayouts_by_button[button]; StackEntry destination = this.buttonDestinations[sourceLayout].Get(); // update the view this.layoutStack.AddLayout(destination); } }
public void AddLayout(StackEntry entry) { this.layoutEntries.Add(entry); this.updateSubLayout(); }
public MenuLayoutBuilder AddLayout(ValueProvider <MenuItem> nameProvider, StackEntry entry) { entry.Layout = LayoutCache.For(entry.Layout); return(this.AddLayout(nameProvider, new ConstantValueProvider <StackEntry>(entry))); }
public MenuLayoutBuilder AddLayout(string name, StackEntry entry) { this.AddLayout(name, new ConstantValueProvider <StackEntry>(entry)); return(this); }