Exemple #1
0
        private void FrictionRichTextBox_Loaded(object sender, RoutedEventArgs e)
        {
            Window window = Window.GetWindow(this);

            if (window != null)
            {
                IntPtr handle = (new WindowInteropHelper(window)).Handle;
                HwndSource.FromHwnd(handle).AddHook(new HwndSourceHook(WndProc));

                _window = window;
            }

            f = new FrictionAnimation(this);

            UpdateDocumentSize();
        }
        private void FrictionScrollViewer_Loaded(object sender, RoutedEventArgs e)
        {
            _window = Window.GetWindow(this);

            if (_window == null)
            {
                return;
            }

            IntPtr windowhandle = new WindowInteropHelper(_window).Handle;

            if (windowhandle == IntPtr.Zero)
            {
                return;
            }

            HwndSource hwndSource = HwndSource.FromHwnd(windowhandle);

            hwndSource.AddHook(new HwndSourceHook(WndProc));

            f = new FrictionAnimation(this);
            f.VerticalSnapToValue = VerticalSnapToValue;
        }
        public FrictionTextBox()
        {
            Loaded += FrictionTextBox_Loaded;

            f = new FrictionAnimation(this);
        }