-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
551 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
LauncherDM/Services/Interfaces/ILibraryUserControlService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace LauncherDM.Services.Interfaces | ||
{ | ||
interface ILibraryUserControlService | ||
{ | ||
string GetAllItems(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using LauncherDM.Services.Interfaces; | ||
using ServerTCP; | ||
|
||
namespace LauncherDM.Services | ||
{ | ||
class LibraryUserControlService : ILibraryUserControlService | ||
{ | ||
private IServerRequestService _serverRequest; | ||
|
||
public LibraryUserControlService(ServerRequestService serverRequest) | ||
{ | ||
_serverRequest = serverRequest; | ||
} | ||
|
||
public string GetAllItems() | ||
{ | ||
var requestMessageServer = _serverRequest.SendMessageRequest(MessageHeader.MessageType.AllGamesOrPrograms, true); | ||
return requestMessageServer.Message.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
|
||
<Style x:Key="ProgressBarStyle" TargetType="ProgressBar"> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="ProgressBar"> | ||
<Border BorderBrush="#D9DCE1" BorderThickness="0" Background="#FF0C0B0B" CornerRadius="0" Padding="0"> | ||
<Grid x:Name="PART_Track"> | ||
<Rectangle x:Name="PART_Indicator" HorizontalAlignment="Left" Fill="#FF2BA9FF" /> | ||
</Grid> | ||
</Border> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using LauncherDM.Infastructure.Commands; | ||
using LauncherDM.Infastructure.Commands.Base; | ||
|
||
namespace LauncherDM.ViewModels | ||
{ | ||
class LibrarySelectItemViewModel : ViewModel.Base.ViewModel | ||
{ | ||
private string _nameItem; | ||
|
||
public string NameItem | ||
{ | ||
get => _nameItem; | ||
set => Set(ref _nameItem, value); | ||
} | ||
|
||
|
||
#region ImageItemPath | ||
|
||
private string _imageItemPath; | ||
|
||
public string ImageItemPath | ||
{ | ||
get => _imageItemPath; | ||
set => Set(ref _imageItemPath, value); | ||
} | ||
|
||
#endregion | ||
|
||
#region Command | ||
|
||
public Command ClickItemCommand { get; } | ||
|
||
#endregion | ||
|
||
public LibrarySelectItemViewModel(string nameItem, string imageItemPath, LambdaCommand lambdaCommand = null) | ||
{ | ||
NameItem = nameItem; | ||
ImageItemPath = imageItemPath; | ||
ClickItemCommand = lambdaCommand; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using LauncherDM.Infastructure.Commands; | ||
using LauncherDM.Services; | ||
using System.Collections.ObjectModel; | ||
using System.Windows.Forms.VisualStyles; | ||
using LauncherDM.Services.Interfaces; | ||
|
||
namespace LauncherDM.ViewModels | ||
{ | ||
class LibraryUserControlViewModel : ViewModel.Base.ViewModel | ||
{ | ||
#region Service | ||
|
||
private readonly IResourcesHelperService _resourcesHelper; | ||
|
||
private readonly ILibraryUserControlService _libraryUserService; | ||
|
||
#endregion | ||
|
||
#region Bindings | ||
|
||
public string ItemTitle => _resourcesHelper.LocalizationGet("Programs"); | ||
|
||
|
||
#region ItemListView | ||
|
||
private ObservableCollection<LibrarySelectItemViewModel> _itemListView; | ||
|
||
public ObservableCollection<LibrarySelectItemViewModel> ItemListView | ||
{ | ||
get => _itemListView; | ||
set => Set(ref _itemListView, value); | ||
} | ||
|
||
#endregion | ||
|
||
#endregion | ||
|
||
|
||
|
||
public LibraryUserControlViewModel(ResourcesHelperService resourcesHelper, ServerRequestService serverRequest) | ||
{ | ||
_resourcesHelper = resourcesHelper; | ||
_libraryUserService = new LibraryUserControlService(serverRequest); | ||
ItemListView = new ObservableCollection<LibrarySelectItemViewModel>(); | ||
LoadItems(); | ||
} | ||
|
||
private void LoadItems() | ||
{ | ||
var a = StoreUserControlViewModel.progArray; | ||
var b = StoreUserControlViewModel.gamesArray; | ||
|
||
var g = _libraryUserService.GetAllItems(); | ||
ItemListView.Add(new LibrarySelectItemViewModel("sdads", "https://get.wallhere.com/photo/anime-anime-girls-2235748.jpg", new LambdaCommand(o => | ||
{ | ||
//ImageItem = image; | ||
}, o => true))); | ||
ItemListView.Add(new LibrarySelectItemViewModel("sdads", "https://get.wallhere.com/photo/anime-anime-girls-2235748.jpg")); | ||
ItemListView.Add(new LibrarySelectItemViewModel("sdads", "https://get.wallhere.com/photo/anime-anime-girls-2235748.jpg")); | ||
ItemListView.Add(new LibrarySelectItemViewModel("sdads", "https://get.wallhere.com/photo/anime-anime-girls-2235748.jpg")); | ||
ItemListView.Add(new LibrarySelectItemViewModel("sdads", "https://get.wallhere.com/photo/anime-anime-girls-2235748.jpg")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ public string ImageItemPath | |
|
||
#endregion | ||
|
||
|
||
#endregion | ||
|
||
#region Command | ||
|
Oops, something went wrong.