提交记录修改UI/App.xaml+9 −1看文件
修改UI/App.xaml.cs+23 −0看文件
| @@ -15,7 +15,15 @@ | ||
| 15 | 15 | <Style TargetType="{x:Type Control}" x:Key="fontStyling"> |
| 16 | 16 | <Setter Property="FontFamily" Value="Segoe UI, Microsoft YaHei UI" /> |
| 17 | 17 | </Style> |
| 18 | 删除: | |
| 18 | 新增: | |
| 19 | 新增: <Style TargetType="{x:Type ScrollViewer}"> | |
| 20 | 新增: <EventSetter Event="PreviewMouseWheel" Handler="ScrollViewer_PreviewMouseWheel"/> | |
| 21 | 新增: <Setter Property="PanningMode" Value="VerticalFirst"/> | |
| 22 | 新增: | |
| 23 | 新增: <!--阻止触摸拉到尽头时的弹簧效果--> | |
| 24 | 新增: <EventSetter Event="ManipulationBoundaryFeedback" Handler="ScrollViewer_ManipulationBoundaryFeedback"/> | |
| 25 | 新增: </Style> | |
| 26 | 新增: | |
| 19 | 27 | <ResourceDictionary.MergedDictionaries> |
| 20 | 28 | <ResourceDictionary Source="/Tai;component/Resources/Themes/Light.xaml"/> |
| 21 | 29 | <ResourceDictionary Source="/Tai;component/Resources/Themes/Common.xaml"/> |
| @@ -176,5 +176,28 @@ namespace UI | ||
| 176 | 176 | // 创建保活窗口 |
| 177 | 177 | keepaliveWindow = new HideWindow(); |
| 178 | 178 | } |
| 179 | 新增: | |
| 180 | 新增: private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) | |
| 181 | 新增: { | |
| 182 | 新增: try | |
| 183 | 新增: { | |
| 184 | 新增: if (System.Windows.Forms.SystemInformation.MouseWheelScrollLines == -1) | |
| 185 | 新增: { | |
| 186 | 新增: e.Handled = false; | |
| 187 | 新增: } | |
| 188 | 新增: else | |
| 189 | 新增: { | |
| 190 | 新增: System.Windows.Controls.ScrollViewer SenderScrollViewer = (System.Windows.Controls.ScrollViewer)sender; | |
| 191 | 新增: SenderScrollViewer.ScrollToVerticalOffset(SenderScrollViewer.VerticalOffset - e.Delta * 10 * System.Windows.Forms.SystemInformation.MouseWheelScrollLines / (double)120); | |
| 192 | 新增: e.Handled = true; | |
| 193 | 新增: } | |
| 194 | 新增: } | |
| 195 | 新增: catch { } | |
| 196 | 新增: } | |
| 197 | 新增: | |
| 198 | 新增: private void ScrollViewer_ManipulationBoundaryFeedback(object sender, System.Windows.Input.ManipulationBoundaryFeedbackEventArgs e) | |
| 199 | 新增: { | |
| 200 | 新增: e.Handled = true; | |
| 201 | 新增: } | |
| 179 | 202 | } |
| 180 | 203 | } |

