protected PropertyViewModels(Component component, PropertyInfo prop) { Assert.NotNull(prop); Assert.NotNull(component); Property = prop; Component = component; DisplayName = DisplayAttribute.GetPropertyDisplayName(prop); Tooltip = new PropertyTooltipViewModel(prop); }
public static void Add(FrameworkElement element, PropertyTooltipViewModel viewModel) { Assert.NotNull(viewModel); Assert.NotNull(element); var toolTipControl = new PropertyToolTip(); toolTipControl.DataContext = viewModel; element.ToolTip = toolTipControl; if (viewModel.OnlineHelpURL == null && viewModel.Description == null) { return; } element.MouseRightButtonUp += Element_MouseRightButtonUp; }