Permalink
Browse files

Fix Horizontal Scrolling on Dashboard

Fix Override not Updating after Removal
Cleanup
  • Loading branch information...
da3dsoul committed Jun 20, 2018
1 parent 7be31eb commit a2a0b0b58ce5d2efc810aeb27304269a9ef73a63
@@ -1,10 +1,10 @@
using NLog;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using NLog;
using Shoko.Desktop.Utilities;
using Shoko.Desktop.ViewModel;
using Shoko.Desktop.ViewModel.Server;
@@ -17,32 +17,22 @@ namespace Shoko.Desktop.Forms
public partial class SelectTvDBEpisodeForm : Window
{
private static Logger logger = LogManager.GetCurrentClassLogger();
private int AnimeID = 0;
private VM_AniDB_Anime Anime = null;
private VM_AnimeEpisode_User AnimeEpisode = null;
private VM_TvDBDetails TvDetails = null;
private VM_AniDB_Anime Anime;
private VM_AnimeEpisode_User AnimeEpisode;
private VM_TvDBDetails TvDetails;

public ObservableCollectionEx<VM_TvDB_Episode> CurrentEpisodes { get; set; }


/*public static readonly DependencyProperty CurrentEpisodesProperty = DependencyProperty.Register("CurrentEpisodes",
typeof(List<TvDB_EpisodeVM>), typeof(SelectTvDBEpisodeForm), new UIPropertyMetadata(null, null));
public List<TvDB_EpisodeVM> CurrentEpisodes
{
get { return (List<TvDB_EpisodeVM>)GetValue(CurrentEpisodesProperty); }
set { SetValue(CurrentEpisodesProperty, value); }
}*/

public SelectTvDBEpisodeForm()
{
InitializeComponent();

CurrentEpisodes = new ObservableCollectionEx<VM_TvDB_Episode>();


btnClose.Click += new RoutedEventHandler(btnClose_Click);
cboSeason.SelectionChanged += new SelectionChangedEventHandler(cboSeason_SelectionChanged);
btnClose.Click += btnClose_Click;
cboSeason.SelectionChanged += cboSeason_SelectionChanged;
}


@@ -110,7 +100,6 @@ private void CommandBinding_UseThis(object sender, ExecutedRoutedEventArgs e)

public void Init(VM_AnimeEpisode_User ep, VM_AniDB_Anime anime)
{
AnimeID = anime.AnimeID;
Anime = anime;
AnimeEpisode = ep;

@@ -124,15 +113,15 @@ public void Init(VM_AnimeEpisode_User ep, VM_AniDB_Anime anime)
uids.Add(xref.TvDBID);
}

cboSeries.SelectionChanged += new SelectionChangedEventHandler(cboSeries_SelectionChanged);
cboSeries.SelectionChanged += cboSeries_SelectionChanged;

if (cboSeries.Items.Count > 0)
cboSeries.SelectedIndex = 0;
}

private void PopulateSeasons(VM_CrossRef_AniDB_TvDBV2 xref)
{
cboSeason.SelectionChanged -= new SelectionChangedEventHandler(cboSeason_SelectionChanged);
cboSeason.SelectionChanged -= cboSeason_SelectionChanged;


cboSeason.Items.Clear();
@@ -145,7 +134,7 @@ private void PopulateSeasons(VM_CrossRef_AniDB_TvDBV2 xref)
foreach (int season in TvDetails.DictTvDBSeasons.Keys)
cboSeason.Items.Add(season);

cboSeason.SelectionChanged += new SelectionChangedEventHandler(cboSeason_SelectionChanged);
cboSeason.SelectionChanged += cboSeason_SelectionChanged;

if (cboSeason.Items.Count > 0)
cboSeason.SelectedIndex = 0;
@@ -495,6 +495,7 @@
<Compile Include="ViewModel\Metro\RecommendationTile.cs" />
<Compile Include="ViewModel\Metro\TraktShoutTile.cs" />
<Compile Include="ViewModel\VM_MoveSeriesDetails.cs" />
<Compile Include="WPFHelpers\ScrollWheelHelper.cs" />
<Compile Include="WPFHelpers\StringFormatConverter.cs" />
<Compile Include="Utilities\UnhandledExceptionManager.cs" />
<Compile Include="WPFHelpers\UriToImageConverter.cs" />
@@ -1171,7 +1171,7 @@ private void CommandBinding_RefreshSeries(object sender, ExecutedRoutedEventArgs
LoadSeries();
}

private void LoadSeries()
public void LoadSeries()
{
Cursor = Cursors.Wait;

@@ -11,6 +11,7 @@
xmlns:viewModel="clr-namespace:Shoko.Desktop.ViewModel"
xmlns:customToolTips="clr-namespace:Shoko.Desktop.UserControls.Custom_ToolTips"
xmlns:dataTemplateSelectors="clr-namespace:Shoko.Desktop.DataTemplateSelectors"
xmlns:wpfHelpers="clr-namespace:Shoko.Desktop.WPFHelpers"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">

@@ -978,7 +979,7 @@
</StackPanel>
</Border>

<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" wpfHelpers:ScrollWheelHelper.WheelScrollsHorizontally="True"
Grid.Row="{Binding Path=DashPos_WatchNextEpisode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type usercontrols:DashboardControl}}}"
Margin="2,0,2,5" Visibility="{Binding Source={x:Static viewModel:VM_UserSettings.Instance}, Path=DashWatchNextEpExpanded, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl ItemTemplateSelector="{StaticResource DashWatchNextTemplateSelector}"
@@ -1044,7 +1045,7 @@
</StackPanel>
</Border>

<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" wpfHelpers:ScrollWheelHelper.WheelScrollsHorizontally="True"
Grid.Row="{Binding Path=DashPos_SeriesMissingEpisodes, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type usercontrols:DashboardControl}}}"
Margin="2,0,2,5" Visibility="{Binding Source={x:Static viewModel:VM_UserSettings.Instance}, Path=DashSeriesMissingEpisodesExpanded, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl ItemTemplate="{StaticResource SeriesMissingEpsTemplate}"
@@ -1126,7 +1127,7 @@
</StackPanel>
</Border>

<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" wpfHelpers:ScrollWheelHelper.WheelScrollsHorizontally="True"
Grid.Row="{Binding Path=DashPos_MiniCalendar, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type usercontrols:DashboardControl}}}"
Margin="2,0,2,5" Visibility="{Binding Source={x:Static viewModel:VM_UserSettings.Instance}, Path=DashMiniCalendarExpanded, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl ItemTemplate="{StaticResource MiniCalendarTemplate}"
@@ -1193,7 +1194,7 @@
</StackPanel>
</Border>

<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" wpfHelpers:ScrollWheelHelper.WheelScrollsHorizontally="True"
Grid.Row="{Binding Path=DashPos_RecWatch, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type usercontrols:DashboardControl}}}"
Margin="2,0,2,5" Visibility="{Binding Source={x:Static viewModel:VM_UserSettings.Instance}, Path=DashRecommendationsWatchExpanded, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl ItemTemplateSelector="{StaticResource RecWatchTemplateSelector}"
@@ -1271,7 +1272,7 @@
</StackPanel>
</Border>

<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" wpfHelpers:ScrollWheelHelper.WheelScrollsHorizontally="True"
Grid.Row="{Binding Path=DashPos_RecDownload, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type usercontrols:DashboardControl}}}"
Margin="2,0,2,5" Visibility="{Binding Source={x:Static viewModel:VM_UserSettings.Instance}, Path=DashRecommendationsDownloadExpanded, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl ItemTemplateSelector="{StaticResource RecDownloadTemplateSelector}"
@@ -1346,7 +1347,7 @@
</StackPanel>
</Border>

<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" wpfHelpers:ScrollWheelHelper.WheelScrollsHorizontally="True"
Grid.Row="{Binding Path=DashPos_RecentlyWatchedEpisode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type usercontrols:DashboardControl}}}"
Margin="2,0,2,5" Visibility="{Binding Source={x:Static viewModel:VM_UserSettings.Instance}, Path=DashRecentlyWatchEpsExpanded, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl ItemTemplate="{DynamicResource RecentlyWatchedEpisodeTemplate}"
@@ -1431,7 +1432,7 @@
</StackPanel>
</Border>

<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled"
<ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" wpfHelpers:ScrollWheelHelper.WheelScrollsHorizontally="True"
Grid.Row="{Binding Path=DashPos_RecentAdditions, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type usercontrols:DashboardControl}}}"
Margin="2,0,2,5" Visibility="{Binding Source={x:Static viewModel:VM_UserSettings.Instance}, Path=DashRecentAdditionsExpanded, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl ItemTemplateSelector="{StaticResource DashRecentAdditionsTemplateSelector}"
Oops, something went wrong.

0 comments on commit a2a0b0b

Please sign in to comment.