-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathMainPageButtons.xaml.cs
35 lines (33 loc) · 985 Bytes
/
MainPageButtons.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Saplin.CPDT.UICore
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MainPageButtons : StackLayout
{
public MainPageButtons()
{
InitializeComponent();
Application.Current.Resources["refreshButton"] = refreshButton;
}
public void AdaptLayoytToScreenWidth(bool narrow)
{
foreach(var c in Children)
{
if (c is Button)
{
if (narrow)
{
(c as Button).Style = Application.Current.Resources["NarrowButtonStyle"] as Style;
}
else
{
(c as Button).Style = Application.Current.Resources["ButtonStyle"] as Style;
}
}
}
}
}
}