using System; namespace Shared { public class HomePage:FrameLayout { FrameLayout homeFrameLayout = new FrameLayout () {X=0,Y=0, Height=(int)LayoutParameters.MatchParent, Width=(int)LayoutParameters.MatchParent, BackgroundImagePath="Images/Main/Logo.png"}; LinearLayout roomListFrameLayout = new LinearLayout () {Height=200, Width=200, BackgroundColor = Color.Green}; Button button = new Button (){ Text = "Hello", X = 0, Y = 0, Height = 100, Width = 100, UnSelectedImagePath="Images/Lamp/Light_SwitchOFF.png", SelectedImagePath="Images/Lamp/Light_SwitchON.png" }; public HomePage (int width,int heiht) { this.Width = width; this.Height = heiht; this.BackgroundColor = Color.Blue; } public override void IntUI () { this.AddChidren (homeFrameLayout); this.AddChidren (roomListFrameLayout); button.MouseDown+= Button_MouseDown; button.MouseUp+= Button_MouseUp; roomListFrameLayout.AddChidren(button); } void Button_MouseUp (object sender, EventArgs e) { Button button = sender as Button; button.IsSelected = true; button.TextAlignment (HorizontalAlignment.Center, VerticalAlignment.Center); } void Button_MouseDown (object sender, EventArgs e) { Button button = sender as Button; button.IsSelected = false; button.TextAlignment (HorizontalAlignment.Center, VerticalAlignment.Bottom); } } }