Пример #1
0
 public static bool RefreshIfHasView(this CollectionViewSource @this)
 {
     if (@this == null || @this.View == null)
     {
         return(false);
     }
     @this.RefreshView();
     return(true);
 }
Пример #2
0
        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);
            }
        }