public static void LoadPropertiesToList(StackPanel panel, List <Property> properties, MouseButtonEventHandler handler, bool specialButtonVisible = false, string specialButtonText = "NONE", RoutedEventHandler specialButtonClick = null, IteratingAction iteratingAction = null) { foreach (Property property in properties) { AddToPropertiesList(property, panel, handler, specialButtonVisible, specialButtonText, specialButtonClick, iteratingAction); } }
public static void AddToPropertiesList(Property property, StackPanel panel, MouseButtonEventHandler handler, bool specialButtonVisible = false, string specialButtonText = "NONE", RoutedEventHandler specialButtonClick = null, IteratingAction iteratingAction = null) { if (ListIsEmpty(panel)) { panel.Children.Clear(); } View view = new View(property.ID, property.Command, new object[] { property, false }, true, true, specialButtonVisible, specialButtonText, specialButtonClick); view.Margin = new Thickness(0d, 0d, 0d, 2.5d); view.Cursor = Cursors.Hand; if (iteratingAction != null) { new IteratingAction(iteratingAction).Invoke(new object[] { view, property }); } if (handler != null) { view.MouseDown += handler; } panel.Children.Add(view); }