public static bool RefreshIfHasView(this CollectionViewSource @this) { if (@this == null || @this.View == null) { return(false); } @this.RefreshView(); return(true); }
public static bool TryRefreshIfHasView(this CollectionViewSource @this) { if (@this == null || @this.View == null) { return(false); } try { @this.RefreshView(); return(true); } catch (InvalidOperationException) { return(false); } catch (ArgumentException) { return(false); } }