/// <summary> /// Perform initialization. /// </summary> public async Task <GeneralMenu> InitializeAsync() { Title = "general"; Width = await appMenu.TotalWidthAsync().ConfigureAwait(false); Height = Dim.Percent(50f); Add(generalButtonFrame.Initialize()); appMenu .LoadGeneral() .AsListView() .FillDimensions() .WithVerticalOffset(Pos.Bottom(generalButtonFrame)) .OnSelectionOf <IMenuItem>(menuItem => menuItem.HandleClickAsync()) .To(Add); return(this); }
/// <summary> /// Perform initialization. /// </summary> public async Task <JobsMenu> InitializeAsync(Pos verticalOffset) { this.Titled("jobs") .WithVerticalOffset(verticalOffset); Width = await appMenu.TotalWidthAsync().ConfigureAwait(false); Height = Dim.Fill(); Add(jobButtonsFrame.Initialize()); var jobMenuItems = await appMenu .LoadJobsAsync() .ToArrayAsync() .ConfigureAwait(false); jobMenuItems .AsListView() .FillDimensions() .WithVerticalOffset(Pos.Bottom(jobButtonsFrame)) .To(Add); return(this); }