new_version_init
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.GUI.Services.ResourceDictionaries
|
||||
{
|
||||
public interface IImagesResourceDictionary
|
||||
{
|
||||
// LOGO
|
||||
string Logo { get; }
|
||||
|
||||
// SOURCES
|
||||
string SourcesTwitch { get; }
|
||||
|
||||
// NAVIGATION VIEW
|
||||
string NavigationViewAuthentication { get; }
|
||||
string NavigationViewHome { get; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class ImagesResourceDictionary : IImagesResourceDictionary
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
// LOGO
|
||||
public string Logo { get; private set; }
|
||||
|
||||
// SOURCES
|
||||
public string SourcesTwitch { get; private set; }
|
||||
|
||||
// NAVIGATION VIEW
|
||||
public string NavigationViewAuthentication { get; private set; }
|
||||
public string NavigationViewHome { get; private set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public ImagesResourceDictionary()
|
||||
{
|
||||
Logo = (string)Application.Current.Resources["ImageLogo"];
|
||||
|
||||
SourcesTwitch = (string)Application.Current.Resources["ImageSourcesTwitch"];
|
||||
|
||||
NavigationViewAuthentication = (string)Application.Current.Resources["ImageNavigationViewAuthentication"];
|
||||
NavigationViewHome = (string)Application.Current.Resources["ImageNavigationViewHome"];
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.GUI.Services.ResourceDictionaries
|
||||
{
|
||||
public interface IResourceDictionariesServices
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
IImagesResourceDictionary Images { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region METHODS
|
||||
|
||||
T Get<T>(string key);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class ResourceDictionariesServices : IResourceDictionariesServices
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public IImagesResourceDictionary Images { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public ResourceDictionariesServices(IImagesResourceDictionary imagesResourceDictionary)
|
||||
{
|
||||
Images = imagesResourceDictionary;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public T Get<T>(string key)
|
||||
{
|
||||
Application.Current.Resources.TryGetValue(key, out object value);
|
||||
if (value is not null && value is T cast)
|
||||
{
|
||||
return cast;
|
||||
}
|
||||
throw new KeyNotFoundException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||
<RootNamespace>VDownload.GUI.Services.ResourceDictionaries</RootNamespace>
|
||||
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
|
||||
<UseWinUI>true</UseWinUI>
|
||||
<UseRidGraph>true</UseRidGraph>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231219000" />
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user