File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 1010 UseLayoutRounding =" True"
1111 WindowStartupLocation =" CenterScreen"
1212 TitleTextAlignment =" Center"
13- Title =" MemPlus - Application Logs" Height =" 300" Width =" 300" >
13+ Title =" MemPlus - Application Logs" Height =" 300" Width =" 300" Icon = " /MemPlus;component/Resources/ram.png " >
1414 <Grid >
1515 <Grid .RowDefinitions>
1616 <RowDefinition ></RowDefinition >
Original file line number Diff line number Diff line change 11using System ;
2- using System . Diagnostics ;
32using System . Linq ;
4- using System . Windows ;
53using System . Windows . Controls ;
64using System . Windows . Controls . Primitives ;
75using MemPlus . Classes ;
@@ -66,8 +64,7 @@ private void LogAddedEvent(Log log)
6664
6765 if ( _autoScroll )
6866 {
69- LsvLogs . SelectedIndex = LsvLogs . Items . Count - 1 ;
70- LsvLogs . ScrollIntoView ( LsvLogs . SelectedItem ) ;
67+ LsvLogs . ScrollIntoView ( LsvLogs . Items [ LsvLogs . Items . Count - 1 ] ) ;
7168 }
7269 } ) ;
7370 }
@@ -81,9 +78,9 @@ private void ChangeVisualStyle()
8178
8279 private void LsvLogs_OnScroll ( object sender , ScrollEventArgs e )
8380 {
84- ScrollBar sb = e . OriginalSource as ScrollBar ;
81+ if ( ! ( e . OriginalSource is ScrollBar sb ) ) return ;
8582
86- if ( sb != null && sb . Orientation == Orientation . Horizontal )
83+ if ( sb . Orientation == Orientation . Horizontal )
8784 return ;
8885 _autoScroll = Math . Abs ( sb . Value - sb . Maximum ) < 1 ;
8986 }
You can’t perform that action at this time.
0 commit comments