-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
EditorDisabledStatesGallery.xaml.cs
54 lines (45 loc) · 1.33 KB
/
EditorDisabledStatesGallery.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
using System;
using Xamarin.Forms.Xaml;
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EditorDisabledStatesGallery : ContentPage
{
public EditorDisabledStatesGallery()
{
InitializeComponent ();
Button0.Text = $"Toggle IsEnabled (Currently {Editor0.IsEnabled})";
Button1.Text = $"Toggle IsEnabled (Currently {Editor1.IsEnabled})";
Button2.Text = $"Toggle IsEnabled (Currently {Editor2.IsEnabled})";
Button3.Text = $"Toggle IsEnabled (Currently {Editor3.IsEnabled})";
}
void Button0_OnClicked(object sender, EventArgs e)
{
var button = sender as Button;
ToggleIsEnabled(Editor0, button);
}
void Button1_OnClicked(object sender, EventArgs e)
{
var button = sender as Button;
ToggleIsEnabled(Editor1, button);
}
void Button2_OnClicked(object sender, EventArgs e)
{
var button = sender as Button;
ToggleIsEnabled(Editor2, button);
}
void Button3_OnClicked(object sender, EventArgs e)
{
var button = sender as Button;
ToggleIsEnabled(Editor3, button);
}
void ToggleIsEnabled(Editor editor, Button toggleButton)
{
editor.IsEnabled = !editor.IsEnabled;
if (toggleButton != null)
{
toggleButton.Text = $"Toggle IsEnabled (Currently {editor.IsEnabled})";
}
}
}
}