protected override void OnAttached() { adorner = new WaterMarkAdorner(this.AssociatedObject, this.Text, this.FontSize, this.FontFamily, this.Margin, this.Foreground); this.AssociatedObject.Loaded += this.OnLoaded; this.AssociatedObject.GotFocus += this.OnFocus; this.AssociatedObject.LostFocus += this.OnLostFocus; }
private void text_filter_TextChanged(object sender, TextChangedEventArgs e) { WaterMarkAdorner.SetIsWaterMarkHost(text_Filter, text_Filter.Text.Length == 0); var filterText = text_Filter.Text; var filter = string.IsNullOrWhiteSpace(filterText) ? null : new Predicate <object>(x => { var row = x as DataBoxRow; foreach (var item in row.Row.ItemArray) { if (item != null && item.ToString().Contains(filterText)) { return(true); } } return(false); }); if (!IsShowPager) { dg_Host.Items.Filter = filter; } else { rows.Filter = filter; ResetPager(); } SetCheckedAllState(); }
protected override void OnAttached() { _adorner = new WaterMarkAdorner(AssociatedObject, Text, FontSize, FontFamily, Foreground); AssociatedObject.Loaded += OnLoaded; AssociatedObject.GotFocus += OnFocus; AssociatedObject.LostFocus += OnLostFocus; AssociatedObject.KeyUp += OnKeyUp; AssociatedObject.SelectionChanged += OnSelectionChanged; }
internal void CheckWaterMark() { WaterMarkAdorner.SetIsWaterMarkHost(tb_Host, this.IsVisible && this.IsEnabled && this.IsKeyboardFocusWithin && tb_Host.Text.Length == 0); }