/// <summary> /// This method executes the view. It is fired when the user presses the OK Button of the sample view. Will return /// a revit TaskDialog contaning the summary of the activities, wich will basically mean a report containing the selected /// view type, the total number of views of that view type in the project, and the total selected views of the specified view /// type, and finally, the names of the selected view types. /// </summary> private void Execute() { this.window.DialogResult = true; this.window.Close(); TaskDialog dialog = new TaskDialog("SampleWPFMVVM"); dialog.MainInstruction = "Summary of Activities"; string SelectedViewNames = ""; var SelectedViews = ObjectsToView.Where(lbh => lbh.IsSelected).Select(lbh => lbh.Name).ToList(); foreach (string sView in SelectedViews) { SelectedViewNames += sView + Environment.NewLine; } dialog.MainContent = $"There is a total of {ObjectsToView.Count} {SViewType} Views in this document. From wich the user selected {NumSelectedViews} in this UI. Their names are:\n\n{SelectedViewNames}"; dialog.ExpandedContent = "This solution were developed by Ramoon N. Bandeira"; dialog.Show(); }
/// <summary> /// This is an event that will be fired whenever the user mark a checkbox within the listbox of the view as checked /// this will update the number of selected views (displayed in the textbox of the view) to match the number of checked /// checkboxes within the listbox /// </summary> private void OnListChanged(object sender, ListChangedEventArgs e) { NumSelectedViews = ObjectsToView.Where(lbh => lbh.IsSelected).Count().ToString(); }