Skip to content

Commit

Permalink
11
Browse files Browse the repository at this point in the history
  • Loading branch information
zdy1988 committed Feb 20, 2023
1 parent 84f382b commit 42ccc5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 2 additions & 6 deletions src/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ZDY:ScrollViewerExtension.MouseWheelOrientation="Vertical"
ZDY:ScrollViewerExtension.IsInertiaEnabled="True"
SelectedItem="{Binding CurrentFolder}">
<ZDY:ListBox.ItemsPanel>
<ItemsPanelTemplate>
Expand Down Expand Up @@ -186,7 +185,6 @@
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
ZDY:ScrollViewerExtension.MouseWheelOrientation="Horizontal"
ZDY:ScrollViewerExtension.IsInertiaEnabled="True"
SelectedItem="{Binding CurrentPicture}"
SelectedIndex="{Binding CurrentPictureIndex}">
<ZDY:ListBox.ItemsPanel>
Expand Down Expand Up @@ -238,8 +236,7 @@
SelectedItem="{Binding CurrentPictureEffect}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ZDY:ScrollViewerExtension.MouseWheelOrientation="Horizontal"
ZDY:ScrollViewerExtension.IsInertiaEnabled="True">
ZDY:ScrollViewerExtension.MouseWheelOrientation="Horizontal">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" IsItemsHost="True"/>
Expand Down Expand Up @@ -465,8 +462,7 @@
<ZDY:IconButton x:Name="InfoButton" Icon="Info" ToolTip="图片信息" Click="InfoButton_Click"/>

<ZDY:IconToggleButton x:Name="PictureListViewToggleButton" Icon="SidebarTop" ToolTip="显示缩略图列表" CheckedIcon="SidebarBottom" CheckedToolTip="关闭缩略图列表"
IsChecked="{Binding IsShowPictureListView}" IsEnabled="{Binding CurrentPicture, Converter={ZDY:NullableToBoolConverter}}"
Visibility="{Binding IsPictureCountMoreThanOne, Converter={ZDY:BoolToVisibilityConverter}}"/>
IsChecked="{Binding IsShowPictureListView}" IsEnabled="{Binding CurrentPicture, Converter={ZDY:NullableToBoolConverter}}"/>
<ZDY:IconToggleButton x:Name="FolderBorthersViewToggleButton" Icon="SidebarLeft" ToolTip="查看更多" CheckedIcon="SidebarRight" CheckedToolTip="关闭侧栏"
IsChecked="{Binding IsShowFolderBorthersView}"/>
</StackPanel>
Expand Down
2 changes: 1 addition & 1 deletion src/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private async void ViewModel_CurrentPictureChanged(object sender, Picture pictur

private void ViewModel_CurrentFolderChanged(object sender, DirectoryInfo e)
{
FolderList.ScrollIntoView(e);
//FolderList.ScrollIntoView(e);
}


Expand Down
9 changes: 6 additions & 3 deletions src/PictureWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public Folder Folder
}
}

private bool isShowPictureListView = false;
public bool IsShowPictureListView
private bool? isShowPictureListView;
public bool? IsShowPictureListView
{
get => isShowPictureListView;
set => Set(() => IsShowPictureListView, ref isShowPictureListView, value);
Expand Down Expand Up @@ -216,7 +216,10 @@ public async Task OpenPictureAsync(DirectoryInfo dir, string filename = null, Li

ThreadPool.QueueUserWorkItem(_ => ApplicationDispatcher.InvokeOnUIThread(() => oldFolder?.Cleanup()));

IsShowPictureListView = Folder != null && Folder.Count > 1;
if (IsShowPictureListView == null)
{
IsShowPictureListView = Folder != null && Folder.Count > 1;
}
}
else
{
Expand Down

0 comments on commit 42ccc5a

Please sign in to comment.