<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ~~~ 今天幫忙修了一個bug, 在拖動TreeViewItem時,需要滾動TreeView向前翻頁,或向后翻頁。 ~~~ ~~~ 思路: ~~~ ~~~ 1.找到TreeView控件里的ItemsControl ~~~ ~~~ 2.找到ItemsControl里的ScrollViewer ~~~ ~~~ 3.判斷當前每個Item的高度 ~~~ ~~~ 4.通過GetCursorPos獲取屏幕絕對坐標 ~~~ ~~~ 5.通過ItemsControl的PointFromScreen把屏幕坐標轉為相對于ItemsControl的客戶坐標 ~~~ ~~~ 6.判斷當前坐標是否超出第一Item或者最后一個Item ~~~ ~~~ 7.如果超出第一個Item則向上滾動, 如果超出最后一個Item則向下滾動。 ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ [StructLayout(LayoutKind.Sequential)] public struct POINT { public int X; public int Y; public POINT(int x, int y) { this.X = x; this.Y = y; } public override string ToString() { return ("X:" + X + ", Y:" + Y); } } [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern bool GetCursorPos(out POINT pt); ~~~ ~~~ ~~~ ~~~ private void ScrollItemToView(object sender) { ItemsControl itemsControl = sender as ItemsControl; if (null == itemsControl) { return; } if (null == this.targetItemContainer) { return; } ScrollViewer scv = Utilities.FindChild<ScrollViewer>(itemsControl); if (null != scv) { ~~~ ~~~ //每個Item的Container的高度 double itemHeight = this.targetItemContainer.ActualHeight; POINT currentPosition = new POINT(); GetCursorPos(out currentPosition); Point relativePos = itemsControl.PointFromScreen(new Point(currentPosition.X, currentPosition.Y)); if (relativePos.Y >= itemsControl.ActualHeight - itemHeight) { scv.ScrollToVerticalOffset(scv.VerticalOffset + itemHeight); } else if (relativePos.Y <= itemHeight) { scv.ScrollToVerticalOffset(scv.VerticalOffset - itemHeight); } } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看