-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathFlexDemoPage.xaml.cs
78 lines (67 loc) · 2.42 KB
/
FlexDemoPage.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using Xamarin.Forms;
using System;
using Flex.Extensions;
using Flex.Controls;
namespace Flex.Demo
{
public partial class FlexDemoPage : ContentPage
{
public FlexDemoPage()
{
InitializeComponent();
BindingContext = new FlexDemoPageViewModel();
}
void DemoButton_TouchedDown(object sender, EventArgs e)
{
ButtonStatus.Text = "Pressed";
}
void DemoButton_TouchedUp(object sender, EventArgs e)
{
ButtonStatus.Text = "Released";
}
void DemoButton_TouchedCanceled(object sender, EventArgs e)
{
ButtonStatus.Text = "Canceled";
}
void ToggleIsEnabled_Clicked(object sender, EventArgs e)
{
((FlexDemoPageViewModel)BindingContext).IsButtonEnabled = !((FlexDemoPageViewModel)BindingContext).IsButtonEnabled;
((FlexDemoPageViewModel)BindingContext).ButtonClickedCommand.ChangeCanExecute();
}
void ToggleIconOrientation_Clicked(object sender, EventArgs e)
{
switch (WideButton.IconOrientation)
{
case IconOrientation.Left:
WideButton.IconOrientation = IconOrientation.Right;
break;
case IconOrientation.Right:
WideButton.IconOrientation = IconOrientation.Top;
break;
case IconOrientation.Top:
WideButton.IconOrientation = IconOrientation.Left;
break;
}
}
public void ToggleHasShadow_Clicked(object sender, EventArgs e)
{
WideButton.HasShadow = !WideButton.HasShadow;
}
void ButtonWithoutBackground_Clicked(object sender, EventArgs e)
{
DisplayAlert("Hello from Code Behind", "The Flex Button rocks! ", "Yeah");
}
public void Handle_Toggled(object sender, ToggledEventArgs e)
{
((FlexButton)sender).Text = e.Value.ToString();
}
public void ToggleIsToggled_Clicked(object sender, EventArgs e)
{
((FlexDemoPageViewModel)BindingContext).IsToggled = !((FlexDemoPageViewModel)BindingContext).IsToggled;
}
private void ToggleIconTintEnabled(object sender, EventArgs e)
{
ColorIconButton.IconTintEnabled = !ColorIconButton.IconTintEnabled;
}
}
}