private void ExpandButton_Clicked(object sender, EventArgs e) { Full_RequestSuggestion_Layout child = new Full_RequestSuggestion_Layout(this.activityDatabase, this.allowRequestingActivitiesDirectly, this.allowMultipleSuggestionTypes, this.vertical, this.numChoicesPerSuggestion, this.engine, this.layoutStack); child.LatestParticipation = this.latestParticipation; child.RequestSuggestion += Child_RequestSuggestion; this.impl = child; this.SubLayout = impl; }
public RequestSuggestion_Layout(ActivityDatabase activityDatabase, bool allowRequestingActivitiesDirectly, bool allowMultipleSuggestionTypes, bool vertical, int numChoicesPerSuggestion, Engine engine, LayoutStack layoutStack) { this.activityDatabase = activityDatabase; this.allowRequestingActivitiesDirectly = allowRequestingActivitiesDirectly; this.allowMultipleSuggestionTypes = allowMultipleSuggestionTypes; this.vertical = vertical; this.engine = engine; this.layoutStack = layoutStack; this.numChoicesPerSuggestion = numChoicesPerSuggestion; GridLayout_Builder gridBuilder; if (vertical) { gridBuilder = new Vertical_GridLayout_Builder(); } else { gridBuilder = new Horizontal_GridLayout_Builder(); } gridBuilder.Uniform(); Full_RequestSuggestion_Layout child = new Full_RequestSuggestion_Layout(this.activityDatabase, false, false, this.vertical, numChoicesPerSuggestion, this.engine, this.layoutStack); this.impl = child; child.RequestSuggestion += Child_RequestSuggestion; gridBuilder.AddLayout(this.impl); bool expandable = allowRequestingActivitiesDirectly || allowMultipleSuggestionTypes; if (expandable) { Button expandButton = new Button(); expandButton.Clicked += ExpandButton_Clicked; gridBuilder.AddLayout(new ButtonLayout(expandButton, "Customize")); } this.SubLayout = gridBuilder.BuildAnyLayout(); }