private CheckBox _addSearchAttributeSub(Grid searchGrid, string attribute, int row, int column) { CheckBox box = new CheckBox(); box.Margin = new Thickness(3); box.SetValue(TextBlock.ForegroundProperty, Application.Current.Resources["TextForeground"] as Brush); TextBlock block = new TextBlock { Text = attribute }; block.SetValue(TextBlock.ForegroundProperty, Application.Current.Resources["TextForeground"] as Brush); box.MouseEnter += delegate { block.Foreground = Application.Current.Resources["MouseOverTextBrush"] as Brush; block.Cursor = Cursors.Hand; block.TextDecorations = TextDecorations.Underline; }; box.MouseLeave += delegate { block.Foreground = Application.Current.Resources["TextForeground"] as Brush; block.Cursor = Cursors.Arrow; block.TextDecorations = null; }; box.Content = block; while (searchGrid.RowDefinitions.Count <= row) { searchGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(-1, GridUnitType.Auto) }); } WpfUtilities.SetGridPosition(box, row, column); _itemsSearchSettings.Link(box, attribute); searchGrid.Children.Add(box); return(box); }
private CheckBox _addSearchAttributeSub(Grid searchGrid, string attribute, int row, int column) { CheckBox box = new CheckBox(); box.Margin = new Thickness(3); TextBlock block = new TextBlock { Text = attribute }; box.MouseEnter += delegate { block.Foreground = new SolidColorBrush(Color.FromArgb(255, 5, 119, 193)); block.Cursor = Cursors.Hand; block.TextDecorations = TextDecorations.Underline; }; box.MouseLeave += delegate { block.Foreground = Brushes.Black; block.Cursor = Cursors.Arrow; block.TextDecorations = null; }; box.Content = block; while (searchGrid.RowDefinitions.Count <= row) { searchGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(-1, GridUnitType.Auto) }); } WpfUtilities.SetGridPosition(box, row, column); _itemsSearchSettings.Link(box, attribute); searchGrid.Children.Add(box); return(box); }