private static void OnRowCountChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ByteArrayControl bac = (ByteArrayControl)d;

            bac.ResizeContent();
            bac.SetupText();
        }
        private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ByteArrayControl bac = (ByteArrayControl)d;

            bac.OpenStream(e.NewValue);
            bac.ResizeContent();
            bac.SetupText();
        }
        private static object OnOffsetCoerce(DependencyObject d, object baseValue)
        {
            ByteArrayControl bac = (ByteArrayControl)d;

            if (bac._stream == null)
            {
                return(0L);
            }

            long l = (long)baseValue;

            if (l > bac._stream.Length || l < 0)
            {
                return(bac._stream.Length);
            }

            return(l);
        }
        private static void OnOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ByteArrayControl bac = (ByteArrayControl)d;

            bac.ScrollToVerticalOffset((long)e.NewValue);
        }