mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 22:07:28 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -1,18 +1,18 @@
|
|||
|
||||
namespace TINK.Services.ThemeNS
|
||||
{
|
||||
/// <summary>
|
||||
/// Set of available app themes
|
||||
/// </summary>
|
||||
public enum ThemeSet
|
||||
{
|
||||
ShareeBike,
|
||||
Konrad,
|
||||
LastenradBayern
|
||||
}
|
||||
/// <summary>
|
||||
/// Set of available app themes
|
||||
/// </summary>
|
||||
public enum ThemeSet
|
||||
{
|
||||
ShareeBike,
|
||||
Konrad,
|
||||
LastenradBayern
|
||||
}
|
||||
|
||||
public interface ITheme
|
||||
{
|
||||
void SetActiveTheme(string themeName);
|
||||
}
|
||||
public interface ITheme
|
||||
{
|
||||
void SetActiveTheme(string themeName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,47 +4,47 @@ using Xamarin.Forms;
|
|||
|
||||
namespace TINK.Services.ThemeNS
|
||||
{
|
||||
/// <summary>
|
||||
/// Manges themeing functionalty.
|
||||
/// Objects ResourceDictionary, Themes.Konrad, ... need Xamarin.Forms framework to be initialized which might break tests.
|
||||
/// </summary>
|
||||
public class Theme : ITheme
|
||||
{
|
||||
private ICollection<ResourceDictionary> _MergedDictionaries;
|
||||
/// <summary>
|
||||
/// Manges themeing functionalty.
|
||||
/// Objects ResourceDictionary, Themes.Konrad, ... need Xamarin.Forms framework to be initialized which might break tests.
|
||||
/// </summary>
|
||||
public class Theme : ITheme
|
||||
{
|
||||
private ICollection<ResourceDictionary> _MergedDictionaries;
|
||||
|
||||
public Theme(ICollection<ResourceDictionary> mergedDictionaries)
|
||||
{
|
||||
_MergedDictionaries = mergedDictionaries ?? throw new ArgumentNullException(nameof(mergedDictionaries));
|
||||
}
|
||||
public Theme(ICollection<ResourceDictionary> mergedDictionaries)
|
||||
{
|
||||
_MergedDictionaries = mergedDictionaries ?? throw new ArgumentNullException(nameof(mergedDictionaries));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets active theme.
|
||||
/// </summary>
|
||||
/// <param name="themeName">Name of the new active theme.</param>
|
||||
public void SetActiveTheme(string themeName)
|
||||
{
|
||||
if (!Enum.TryParse(themeName, false, out ThemeSet theme))
|
||||
return;
|
||||
/// <summary>
|
||||
/// Sets active theme.
|
||||
/// </summary>
|
||||
/// <param name="themeName">Name of the new active theme.</param>
|
||||
public void SetActiveTheme(string themeName)
|
||||
{
|
||||
if (!Enum.TryParse(themeName, false, out ThemeSet theme))
|
||||
return;
|
||||
|
||||
if (_MergedDictionaries == null)
|
||||
return;
|
||||
if (_MergedDictionaries == null)
|
||||
return;
|
||||
|
||||
_MergedDictionaries.Clear();
|
||||
_MergedDictionaries.Clear();
|
||||
|
||||
switch (theme)
|
||||
{
|
||||
case ThemeSet.Konrad:
|
||||
_MergedDictionaries.Add(new Themes.Konrad());
|
||||
break;
|
||||
switch (theme)
|
||||
{
|
||||
case ThemeSet.Konrad:
|
||||
_MergedDictionaries.Add(new Themes.Konrad());
|
||||
break;
|
||||
|
||||
case ThemeSet.LastenradBayern:
|
||||
_MergedDictionaries.Add(new Themes.LastenradBayern());
|
||||
break;
|
||||
case ThemeSet.LastenradBayern:
|
||||
_MergedDictionaries.Add(new Themes.LastenradBayern());
|
||||
break;
|
||||
|
||||
default:
|
||||
_MergedDictionaries.Add(new Themes.ShareeBike());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
_MergedDictionaries.Add(new Themes.ShareeBike());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue