summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/ResourcesProvider.cs')
-rw-r--r--Xamarin.Forms.Platform.iOS/ResourcesProvider.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs b/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
index 3e5655c..f02655a 100644
--- a/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
+++ b/Xamarin.Forms.Platform.iOS/ResourcesProvider.cs
@@ -1,6 +1,11 @@
+#if __MOBILE__
using UIKit;
namespace Xamarin.Forms.Platform.iOS
+#else
+
+namespace Xamarin.Forms.Platform.MacOS
+#endif
{
internal class ResourcesProvider : ISystemResourcesProvider
{
@@ -8,7 +13,9 @@ namespace Xamarin.Forms.Platform.iOS
public ResourcesProvider()
{
+#if __MOBILE__
UIApplication.Notifications.ObserveContentSizeCategoryChanged((sender, args) => UpdateStyles());
+#endif
}
public IResourceDictionary GetSystemResources()
@@ -19,6 +26,7 @@ namespace Xamarin.Forms.Platform.iOS
return _dictionary;
}
+#if __MOBILE__
Style GenerateListItemDetailTextStyle()
{
var font = new UITableViewCell(UITableViewCellStyle.Subtitle, "Foobar").DetailTextLabel.Font;
@@ -44,7 +52,7 @@ namespace Xamarin.Forms.Platform.iOS
void UpdateStyles()
{
-
+
_dictionary[Device.Styles.TitleStyleKey] = GenerateStyle(UIFont.PreferredHeadline);
_dictionary[Device.Styles.SubtitleStyleKey] = GenerateStyle(UIFont.PreferredSubheadline);
_dictionary[Device.Styles.BodyStyleKey] = GenerateStyle(UIFont.PreferredBody);
@@ -53,5 +61,11 @@ namespace Xamarin.Forms.Platform.iOS
_dictionary[Device.Styles.ListItemTextStyleKey] = GenerateListItemTextStyle();
_dictionary[Device.Styles.ListItemDetailTextStyleKey] = GenerateListItemDetailTextStyle();
}
+#else
+ void UpdateStyles()
+ {
+ }
+#endif
+
}
} \ No newline at end of file