add files
This commit is contained in:
32
Pixiview/Utils/Extensions.cs
Normal file
32
Pixiview/Utils/Extensions.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Pixiview.Utils
|
||||
{
|
||||
public static class StatusBar
|
||||
{
|
||||
private const string StatusBarStyle = nameof(StatusBarStyle);
|
||||
|
||||
public static readonly BindableProperty StatusBarStyleProperty = BindableProperty.CreateAttached(
|
||||
StatusBarStyle,
|
||||
typeof(StatusBarStyles),
|
||||
typeof(Page),
|
||||
StatusBarStyles.WhiteText);
|
||||
|
||||
public static StatusBarStyles GetStatusBarStyle(VisualElement page) => (StatusBarStyles)page.GetValue(StatusBarStyleProperty);
|
||||
public static void SetStatusBarStyle(VisualElement page, StatusBarStyles value) => page.SetValue(StatusBarStyleProperty, value);
|
||||
}
|
||||
|
||||
public enum StatusBarStyles
|
||||
{
|
||||
Default,
|
||||
// Will behave as normal.
|
||||
// White text on black NavigationBar/in iOS Dark mode and
|
||||
// Black text on white NavigationBar/in iOS Light mode
|
||||
DarkText,
|
||||
// Will switch the color of content of StatusBar to black.
|
||||
WhiteText,
|
||||
// Will switch the color of content of StatusBar to white.
|
||||
Hidden
|
||||
// Will hide the StatusBar
|
||||
}
|
||||
}
|
16
Pixiview/Utils/IEnvironmentService.cs
Normal file
16
Pixiview/Utils/IEnvironmentService.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
namespace Pixiview.Utils
|
||||
{
|
||||
public interface IEnvironmentService
|
||||
{
|
||||
EnvironmentParameter GetEnvironment();
|
||||
}
|
||||
|
||||
public class EnvironmentParameter
|
||||
{
|
||||
public string IconLightFontFamily { get; set; }
|
||||
public string IconRegularFontFamily { get; set; }
|
||||
public string IconSolidFontFamily { get; set; }
|
||||
public string IconLeft { get; set; }
|
||||
}
|
||||
}
|
16
Pixiview/Utils/UIFactory.cs
Normal file
16
Pixiview/Utils/UIFactory.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Pixiview.Utils
|
||||
{
|
||||
public static class UIFactory
|
||||
{
|
||||
public static NavigationPage CreateNavigationPage(Page root)
|
||||
{
|
||||
var navigation = new NavigationPage(root);
|
||||
navigation.SetDynamicResource(NavigationPage.BarBackgroundColorProperty, App.MainColor);
|
||||
navigation.SetDynamicResource(NavigationPage.BarTextColorProperty, App.MainTextColor);
|
||||
navigation.SetDynamicResource(VisualElement.BackgroundColorProperty, App.WindowColor);
|
||||
return navigation;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user