|
|
|
|
@ -22,17 +22,9 @@
@@ -22,17 +22,9 @@
|
|
|
|
|
<div style="margin-left: auto"> |
|
|
|
|
<MudButton Variant="Variant.Filled" |
|
|
|
|
Color="Color.Primary" |
|
|
|
|
StartIcon="@Icons.Material.Filled.Add" |
|
|
|
|
> |
|
|
|
|
StartIcon="@Icons.Material.Filled.Add"> |
|
|
|
|
Add To Collection |
|
|
|
|
</MudButton> |
|
|
|
|
<MudButton Class="ml-3" |
|
|
|
|
Variant="Variant.Filled" |
|
|
|
|
Color="Color.Primary" |
|
|
|
|
StartIcon="@Icons.Material.Filled.Schedule" |
|
|
|
|
> |
|
|
|
|
Add To Schedule |
|
|
|
|
</MudButton> |
|
|
|
|
<MudButton Class="ml-3" |
|
|
|
|
Variant="Variant.Filled" |
|
|
|
|
Color="Color.Secondary" |
|
|
|
|
@ -87,7 +79,10 @@
@@ -87,7 +79,10 @@
|
|
|
|
|
{ |
|
|
|
|
<MediaCard Data="@card" |
|
|
|
|
Link="@($"/media/tv/shows/{card.TelevisionShowId}")" |
|
|
|
|
AddToCollectionClicked="@AddToCollection"/> |
|
|
|
|
AddToCollectionClicked="@AddToCollection" |
|
|
|
|
SelectClicked="@(e => SelectClicked(card, e))" |
|
|
|
|
IsSelected="@_selectedCards.Contains(card)" |
|
|
|
|
IsSelectMode="@_selectedCards.Any()"/> |
|
|
|
|
} |
|
|
|
|
</MudContainer> |
|
|
|
|
} |
|
|
|
|
@ -113,24 +108,24 @@
@@ -113,24 +108,24 @@
|
|
|
|
|
_selectedCards = new System.Collections.Generic.HashSet<MediaCardViewModel>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void ClearSelection() |
|
|
|
|
{ |
|
|
|
|
_selectedCards.Clear(); |
|
|
|
|
} |
|
|
|
|
private void ClearSelection() => _selectedCards.Clear(); |
|
|
|
|
|
|
|
|
|
private void SelectClicked(MovieCardViewModel movie, MouseEventArgs e) |
|
|
|
|
private void SelectClicked(MediaCardViewModel card, MouseEventArgs e) |
|
|
|
|
{ |
|
|
|
|
if (_selectedCards.Contains(movie)) |
|
|
|
|
if (_selectedCards.Contains(card)) |
|
|
|
|
{ |
|
|
|
|
_selectedCards.Remove(movie); |
|
|
|
|
_selectedCards.Remove(card); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (e.ShiftKey && _selectedLast is MovieCardViewModel selectedMovie) |
|
|
|
|
if (e.ShiftKey && _selectedLast != null) |
|
|
|
|
{ |
|
|
|
|
var sorted = _data.MovieCards.OrderBy(m => m.SortTitle).ToList(); |
|
|
|
|
int start = sorted.IndexOf(selectedMovie); |
|
|
|
|
int finish = sorted.IndexOf(movie); |
|
|
|
|
var sorted = _data.MovieCards.OrderBy(m => m.SortTitle) |
|
|
|
|
.Append<MediaCardViewModel>(_data.ShowCards.OrderBy(s => s.SortTitle)) |
|
|
|
|
.ToList(); |
|
|
|
|
|
|
|
|
|
int start = sorted.IndexOf(_selectedLast); |
|
|
|
|
int finish = sorted.IndexOf(card); |
|
|
|
|
if (start > finish) |
|
|
|
|
{ |
|
|
|
|
int temp = start; |
|
|
|
|
@ -144,8 +139,8 @@
@@ -144,8 +139,8 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_selectedLast = movie; |
|
|
|
|
_selectedCards.Add(movie); |
|
|
|
|
_selectedLast = card; |
|
|
|
|
_selectedCards.Add(card); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|