using System; using System.Collections.Generic; using System.IO; namespace Shared.SimpleControl.Phone { public static class UserSettingView { public static void InitUserSettingView () { #region FrameLayout topView = new FrameLayout () { Y = Application.GetRealHeight (36), Height = Application.GetRealHeight (90), Width = Application.GetRealWidth (640), BackgroundColor = SkinStyle.Current.MainColor, }; UserMiddle.SettingBodyView.AddChidren (topView); //Button LogoButton = new Button () { // Y = Application.GetRealHeight (10), // Width = Application.GetRealWidth (154), // Height = Application.GetRealHeight (90), // UnSelectedImagePath = MainPage.WiFiStatus, //}; //topView.AddChidren (LogoButton); //LogoButton.MouseUpEventHandler += (dd, ff) => { // EquipmentPublicClass.CheckLinkRemote (UserConfig.Instance.internetStatus, LogoButton); //}; topView.AddChidren (UserMiddle.btnLinkStatus); Button NameButton = new Button () { Width = Application.GetRealWidth (400), Height = Application.GetMinReal (90), TextID = R.MyInternationalizationString.Setting, TextColor = SkinStyle.Current.TextColor1, Gravity = Gravity.CenterHorizontal, TextAlignment = TextAlignment.Center, TextSize = 20, //FontName = "TitilliumText25L" }; topView.AddChidren (NameButton); //try { // Utlis.WriteLine ("3"); // UserMiddle.SettingBodyView.AddChidren (topView); // Utlis.WriteLine ("3"); //} catch(Exception ex) { // Utlis.WriteLine (ex.ToString ()); //} ShowBodyView (); } /// /// 当前setting页面 加载是否分享住宅角色,决定是否隐藏相应的菜单按钮 /// static bool IsOthreShare = false; /// /// 住宅列表页面 /// 切换住宅后需要判断是否需要隐藏或者显示功能菜单按钮刷新布局 /// 当前住宅自己的:显示数据接收、同步数据、定时器、alexa、子账号管理 5个功能菜单按钮 /// 子账号当前住宅不是自己的:隐藏上面5个按钮 /// public static void CheckIfRefreshView () { if(UserConfig.Instance.CurrentRegion.IsOthreShare != IsOthreShare) { ShowBodyView (); //Utlis.WriteLine ("需要刷新"); } } /// /// 加载BodyView /// public static void ShowBodyView () { if (UserMiddle.SettingView == null) return; UserMiddle.SettingView.RemoveAll (); IsOthreShare = UserConfig.Instance.CurrentRegion.IsOthreShare; FrameLayout topUserMsgView = new FrameLayout () { Y = Application.GetRealHeight (126), Height = Application.GetRealHeight (175), BackgroundColor = SkinStyle.Current.ViewColor }; UserMiddle.SettingView.AddChidren (topUserMsgView); Button btnUserIcon = new Button () { X = Application.GetRealWidth (27), Width = Application.GetRealWidth (96), Height = Application.GetRealWidth (96), Gravity = Gravity.CenterVertical, Radius = 5, BorderColor = SkinStyle.Current.Transparent, BorderWidth = 0, UnSelectedImagePath = "AccountSettings/UserIcon.png", }; topUserMsgView.AddChidren (btnUserIcon); Button btnUserName = new Button () { X = btnUserIcon.Right + Application.GetRealWidth (20), Y = Application.GetRealHeight (40), Width = Application.GetRealWidth (400), Height = Application.GetRealHeight (50), TextAlignment = TextAlignment.CenterLeft, TextColor = SkinStyle.Current.TextColor1, Text = MainPage.LoginUser.Name == "" ? Language.StringByID (R.MyInternationalizationString.Account) : MainPage.LoginUser.Name, //TextID = R.MyInternationalizationString.Account }; topUserMsgView.AddChidren (btnUserName); Button btnUserAccount = new Button () { X = btnUserName.X, Y = btnUserName.Bottom, Width = btnUserName.Width, Height = btnUserName.Height, TextAlignment = TextAlignment.CenterLeft, Text = "", TextColor = SkinStyle.Current.TextColor1 }; topUserMsgView.AddChidren (btnUserAccount); if (MainPage.LoginUser != null) { btnUserAccount.Text += MainPage.LoginUser.AccountString; } Button btnTopUserMsgRight = new Button () { X = Application.GetRealWidth (570), Width = Application.GetRealWidth (28), Height = Application.GetRealWidth (40), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Item/Right.png", SelectedImagePath = "Item/RightSelected.png", }; topUserMsgView.AddChidren (btnTopUserMsgRight); EventHandler accountEventHandler = (sender, e) => { new AccountLogin ().Show (); }; btnUserName.MouseUpEventHandler += accountEventHandler; btnUserAccount.MouseUpEventHandler += accountEventHandler; topUserMsgView.MouseUpEventHandler += accountEventHandler; btnTopUserMsgRight.MouseUpEventHandler += accountEventHandler; Button btTopNull = new Button () { BackgroundColor = SkinStyle.Current.MainColor, Height = Application.GetRealHeight (30), }; UserMiddle.SettingView.AddChidren (btTopNull); #endregion #region ---进入后台---DeviceManagementView--- if (true) {//调试账号 //if (MainPage.LoginUser.AccountType == 0) {//调试账号 FrameLayout DeviceManagementView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor }; UserMiddle.SettingView.AddChidren (DeviceManagementView); Button btnDevcieManagementIcon = new Button () { X = Application.GetRealWidth (30), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (75), Height = Application.GetRealWidth (75), UnSelectedImagePath = "AccountSettings/DeviceManagement.png", IsSelected = false }; DeviceManagementView.AddChidren (btnDevcieManagementIcon); Button btnDeviceManagementTitle = new Button () { X = btnDevcieManagementIcon.Right + Application.GetRealWidth (20), TextAlignment = TextAlignment.CenterLeft, Text = "Zones/Residences", TextColor = SkinStyle.Current.TextColor1, }; DeviceManagementView.AddChidren (btnDeviceManagementTitle); EventHandler SystemEventHandler = (sender, e) => { var hl = new GuideAddResidence (); UserMiddle.SettingPageView.AddChidren (hl); hl.ShowHomeView (); UserMiddle.SettingPageView.PageIndex = UserMiddle.SettingPageView.ChildrenCount - 1; //HomeListView hl = new HomeListView (); //UserMiddle.SettingPageView.AddChidren (hl); //hl.ShowHomeList (); //UserMiddle.SettingPageView.PageIndex = UserMiddle.SettingPageView.ChildrenCount - 1; }; DeviceManagementView.MouseUpEventHandler += SystemEventHandler; btnDevcieManagementIcon.MouseUpEventHandler += SystemEventHandler; btnDeviceManagementTitle.MouseUpEventHandler += SystemEventHandler; Button btnNull = new Button () { BackgroundColor = SkinStyle.Current.MainColor, Height = Application.GetRealHeight (5) }; UserMiddle.SettingView.AddChidren (btnNull); } #endregion #region ---备份--- FrameLayout BackupView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor }; UserMiddle.SettingView.AddChidren (BackupView); Button btnBackupIcon = new Button () { X = Application.GetRealWidth (30), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (75), Height = Application.GetRealWidth (75), UnSelectedImagePath = "AccountSettings/Backup.png" }; BackupView.AddChidren (btnBackupIcon); Button btnBackupTitle = new Button () { X = btnBackupIcon.Right + Application.GetRealWidth (20), TextAlignment = TextAlignment.CenterLeft, TextID = R.MyInternationalizationString.BackupManage, TextColor = SkinStyle.Current.TextColor1, }; BackupView.AddChidren (btnBackupTitle); EventHandler BackupEventHandler = (sender, e) => { Databackup dataBackupView = new Databackup (); UserMiddle.SettingPageView.AddChidren (dataBackupView); dataBackupView.DatabackupShow (); UserMiddle.SettingPageView.PageIndex = 1; }; BackupView.MouseUpEventHandler += BackupEventHandler; btnBackupIcon.MouseUpEventHandler += BackupEventHandler; btnBackupTitle.MouseUpEventHandler += BackupEventHandler; Button btnNull2 = new Button () { BackgroundColor = SkinStyle.Current.MainColor, Height = Application.GetRealHeight (5) }; UserMiddle.SettingView.AddChidren (btnNull2); #endregion #region ---数据接收--- //if (MainPage.LoginUser.AccountType == 2 || MainPage.LoginUser.AccountString == @"464027401@qq.com") { var DataReceptionView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor }; //UserMiddle.SettingView.AddChidren (DataReceptionView); var btnDataReceptionIcon = new Button () { X = Application.GetRealWidth (30), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (75), Height = Application.GetRealHeight (75), UnSelectedImagePath = "AccountSettings/DataShared.png" }; DataReceptionView.AddChidren (btnDataReceptionIcon); var btnDataReceptionTitle = new Button () { X = Application.GetRealWidth (125), TextAlignment = TextAlignment.CenterLeft, TextID = R.MyInternationalizationString.DataReception, TextColor = SkinStyle.Current.TextColor1, }; DataReceptionView.AddChidren (btnDataReceptionTitle); EventHandler DataReceptionEventHandler = (sender, e) => { GoData (); }; DataReceptionView.MouseUpEventHandler += DataReceptionEventHandler; btnDataReceptionIcon.MouseUpEventHandler += DataReceptionEventHandler; btnDataReceptionTitle.MouseUpEventHandler += DataReceptionEventHandler; Button btnNull3 = new Button () { BackgroundColor = SkinStyle.Current.MainColor, Height = Application.GetRealHeight (5) }; //UserMiddle.SettingView.AddChidren (btnNull3); #endregion #region ---msg--- //FrameLayout WarningMsgView = new FrameLayout () { // Width = Application.GetRealWidth (640), // Height = Application.GetRealHeight (100), // BackgroundColor = SkinStyle.Current.ViewColor //}; //UserMiddle.SettingView.AddChidren (WarningMsgView); //Button btnWarningMsgIcon = new Button () { // X = Application.GetRealWidth (30), // Gravity = Gravity.CenterVertical, // Width = Application.GetRealWidth (75), // Height = Application.GetRealHeight (75), // UnSelectedImagePath = "RemoteMsg/RemoteIcon.png", // SelectedImagePath = "RemoteMsg/RemoteIconOn.png" //}; //WarningMsgView.AddChidren (btnWarningMsgIcon); //Button btnWarningMsgTitle = new Button () { // X = btnWarningMsgIcon.Right + Application.GetRealWidth (20), // TextAlignment = TextAlignment.CenterLeft, // TextID = R.MyInternationalizationString.MessageAlert, // TextColor = SkinStyle.Current.TextColor1, //}; //WarningMsgView.AddChidren (btnWarningMsgTitle); //btnWarningMsgTitle.MouseLongEventHandler += (sd, ds) => { // //var uc = UserConfig.Instance.RometoUserInfoKeys.Find ((obj) => obj.Contains ("HiddenJson")); // //new Alert ("", uc, "close").Show (); //}; //EventHandler WarningMsgEventHandler = (sender, e) => { // var msgView = new WarningList (); // UserMiddle.SettingPageView.AddChidren (msgView); // msgView.ShowWarningListPage (); // UserMiddle.SettingPageView.PageIndex = 1; //}; //WarningMsgView.MouseUpEventHandler += WarningMsgEventHandler; //btnWarningMsgIcon.MouseUpEventHandler += WarningMsgEventHandler; //btnWarningMsgTitle.MouseUpEventHandler += WarningMsgEventHandler; //Button btnNullWarningMsg = new Button () { // Height = Application.GetRealHeight (5), // BackgroundColor = SkinStyle.Current.MainColor //}; //UserMiddle.SettingView.AddChidren (btnNullWarningMsg); #endregion #region ---同步设备--- FrameLayout SyncDeviceView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor }; Button btnSyncDeviceIcon = new Button () { X = Application.GetRealWidth (30), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (75), Height = Application.GetRealWidth (75), UnSelectedImagePath = "CrabtreeAdd/Alexa.png", }; SyncDeviceView.AddChidren (btnSyncDeviceIcon); Button btnSyncDeviceTitle = new Button () { X = Application.GetRealWidth (125), TextAlignment = TextAlignment.CenterLeft, TextID = R.MyInternationalizationString.SyncToTheCloud, //Text = "上传设备", TextColor = SkinStyle.Current.TextColor1, }; SyncDeviceView.AddChidren (btnSyncDeviceTitle); EventHandler SyncDeviceEventHandler = (sender, e) => { //没绑定忘记提示先绑定网关,禁止跳转 if (!UserConfig.Instance.CheckWhetherGatewayIdNotNull ()) { Utlis.ShowAlertOnMainThread (Language.StringByID (R.MyInternationalizationString.PleaseBindTheGatewayFirst)); return; } //ok事件 Action okAction = () => { HDLLinkUtlis.Current.OneclickUpload (); }; CommonUtlis.Current.ShowActionAlert (Language.StringByID (R.MyInternationalizationString.DoYouWantToSynchronizeToTheCloud), okAction); }; SyncDeviceView.MouseUpEventHandler += SyncDeviceEventHandler; btnSyncDeviceIcon.MouseUpEventHandler += SyncDeviceEventHandler; btnSyncDeviceTitle.MouseUpEventHandler += SyncDeviceEventHandler; Button btnNullSyncDevice = new Button () { Height = Application.GetRealHeight (5), BackgroundColor = SkinStyle.Current.MainColor }; //UserMiddle.SettingView.AddChidren (btnNullSchedule); #endregion #region ---Schedule--- FrameLayout ScheduleView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor }; Button btnScheduleIcon = new Button () { X = Application.GetRealWidth (30), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (75), Height = Application.GetRealWidth (75), UnSelectedImagePath = "CrabtreeAdd/Schedule.png", }; ScheduleView.AddChidren (btnScheduleIcon); Button btnScheduleTitle = new Button () { X = Application.GetRealWidth (125), TextAlignment = TextAlignment.CenterLeft, TextID = R.MyInternationalizationString.Schedule, TextColor = SkinStyle.Current.TextColor1, }; ScheduleView.AddChidren (btnScheduleTitle); EventHandler ScheduleEventHandler = (sender, e) => { var scheduleShowView = new UserSchedule (); UserMiddle.SettingPageView.AddChidren (scheduleShowView); scheduleShowView.ShowPage (); UserMiddle.SettingPageView.PageIndex = 1; }; ScheduleView.MouseUpEventHandler += ScheduleEventHandler; btnScheduleIcon.MouseUpEventHandler += ScheduleEventHandler; btnScheduleTitle.MouseUpEventHandler += ScheduleEventHandler; Button btnNullSchedule = new Button () { Height = Application.GetRealHeight (5), BackgroundColor = SkinStyle.Current.MainColor }; //UserMiddle.SettingView.AddChidren (btnNullSchedule); #endregion #region ---Alexa--- FrameLayout AlexaView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor }; Button btnAlexaIcon = new Button () { X = Application.GetRealWidth (30), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (75), Height = Application.GetRealWidth (75), UnSelectedImagePath = "CrabtreeAdd/Speaker.png", }; AlexaView.AddChidren (btnAlexaIcon); //智能音箱 Button btnAlexaTitle = new Button () { X = Application.GetRealWidth (125), TextAlignment = TextAlignment.CenterLeft, Text = "Smart speaker", TextColor = SkinStyle.Current.TextColor1, }; AlexaView.AddChidren (btnAlexaTitle); EventHandler AlexaEventHandler = (sender, e) => { var alexaPage = new SmartSpeakertListPage (); UserMiddle.SettingPageView.AddChidren (alexaPage); alexaPage.ShowPage (); UserMiddle.SettingPageView.PageIndex = 1; }; AlexaView.MouseUpEventHandler += AlexaEventHandler; btnAlexaIcon.MouseUpEventHandler += AlexaEventHandler; btnAlexaTitle.MouseUpEventHandler += AlexaEventHandler; Button btnNullAlexa = new Button () { Height = Application.GetRealHeight (5), BackgroundColor = SkinStyle.Current.MainColor }; //UserMiddle.SettingView.AddChidren (btnNullAlexa); #endregion #region subaccount //if (MainPage.LoginUser.AccountType == 0) { FrameLayout subaccountView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor }; Button btnSubaccountIcon = new Button () { X = Application.GetRealWidth (30), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (75), Height = Application.GetRealWidth (75), UnSelectedImagePath = "CrabtreeAdd/SubaccountIcon.png", }; subaccountView.AddChidren (btnSubaccountIcon); Button btnSubaccountTitle = new Button () { X = Application.GetRealWidth (125), TextAlignment = TextAlignment.CenterLeft, Text = "User Management", TextColor = SkinStyle.Current.TextColor1, }; subaccountView.AddChidren (btnSubaccountTitle); Button btnNullSubaccount = new Button () { Height = Application.GetRealHeight (5), BackgroundColor = SkinStyle.Current.MainColor }; //UserMiddle.SettingView.AddChidren (btnNullSubaccount); EventHandler SubaccountEventHandler = (sender, e) => { if (UserConfig.Instance.CurrentRegion.IsOthreShare) { //提示没有分享住宅的权限 new Alert ("", ErrorCode.InsufficientAuthority, "Close").Show (); return; } if (UserConfig.Instance.internetStatus == 0) { new Alert ("", "Unable to save data, please check the network.", "Close").Show (); return; } MainPage.Loading.Start ("Please wait..."); System.Threading.Tasks.Task.Run (() => { try { var revertObj = HttpServerRequest.Current.GetResidenceMemberAccount (); if (revertObj.Code == StateCode.SUCCESS) { Application.RunOnMainThread (() => { var responeObj = Newtonsoft.Json.JsonConvert.DeserializeObject> (revertObj.Data.ToString ()); SubaccountListView subView = new SubaccountListView (responeObj); UserMiddle.SettingPageView.AddChidren (subView); subView.ShowSubaccountListView (); UserMiddle.SettingPageView.PageIndex += 1; }); } else { IMessageCommon.Current.ShowErrorInfoAlter (revertObj.Code); } } catch (Exception ex) { MainPage.FailureToServer (); Utlis.WriteLine (ex.Message); } finally { Application.RunOnMainThread (() => { MainPage.Loading.Hide (); }); } }); }; subaccountView.MouseUpEventHandler += SubaccountEventHandler; btnSubaccountIcon.MouseUpEventHandler += SubaccountEventHandler; btnSubaccountTitle.MouseUpEventHandler += SubaccountEventHandler; //} #endregion if (!UserConfig.Instance.CurrentRegion.IsOthreShare) { //主账号开放该功能; UserMiddle.SettingView.AddChidren (DataReceptionView); UserMiddle.SettingView.AddChidren (btnNull3); UserMiddle.SettingView.AddChidren (SyncDeviceView); UserMiddle.SettingView.AddChidren (btnNullSyncDevice); UserMiddle.SettingView.AddChidren (ScheduleView); UserMiddle.SettingView.AddChidren (btnNullSchedule); UserMiddle.SettingView.AddChidren (AlexaView); UserMiddle.SettingView.AddChidren (btnNullAlexa); UserMiddle.SettingView.AddChidren (subaccountView); UserMiddle.SettingView.AddChidren (btnNullSubaccount); } #region ---help--- var helpView = new FrameLayout () { Width = Application.GetRealWidth (640), Height = Application.GetRealHeight (100), BackgroundColor = SkinStyle.Current.ViewColor }; UserMiddle.SettingView.AddChidren (helpView); var btnhelpIcon = new Button () { X = Application.GetRealWidth (30), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (75), Height = Application.GetRealWidth (75), UnSelectedImagePath = "CrabtreeAdd/Help.png", SelectedImagePath = "CrabtreeAdd/HelpOn.png" }; helpView.AddChidren (btnhelpIcon); var btnhelpTitle = new Button () { X = btnhelpIcon.Right + Application.GetRealWidth (20), TextAlignment = TextAlignment.CenterLeft, TextID = R.MyInternationalizationString.Help, TextColor = SkinStyle.Current.TextColor1, }; helpView.AddChidren (btnhelpTitle); btnhelpTitle.MouseLongEventHandler += (sd, ds) => { //var uc = UserConfig.Instance.RometoUserInfoKeys.Find ((obj) => obj.Contains ("HiddenJson")); //new Alert ("", uc, "close").Show (); }; EventHandler helpEventHandler = (sender, e) => { var helpShowView = new HelpView (); UserMiddle.SettingPageView.AddChidren (helpShowView); helpShowView.ShowPage (); UserMiddle.SettingPageView.PageIndex = 1; }; helpView.MouseUpEventHandler += helpEventHandler; btnhelpIcon.MouseUpEventHandler += helpEventHandler; btnhelpTitle.MouseUpEventHandler += helpEventHandler; Button btnNullhelp = new Button () { Height = Application.GetRealHeight (5), BackgroundColor = SkinStyle.Current.MainColor }; UserMiddle.SettingView.AddChidren (btnNullhelp); #endregion Button btnNullSkin = new Button () { Height = Application.GetRealHeight (5), BackgroundColor = SkinStyle.Current.MainColor }; UserMiddle.SettingView.AddChidren (btnNullSkin); } static void GoData () { Dialog dialog = new Dialog (); FrameLayout MianBody = new FrameLayout (); dialog.AddChidren (MianBody); FrameLayout bodyView = new FrameLayout () { Width = Application.GetRealWidth (500), Height = Application.GetRealHeight (430), Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight (250), Radius = 5, BorderColor = SkinStyle.Current.Transparent, BorderWidth = 2, BackgroundColor = SkinStyle.Current.DialogColor }; MianBody.AddChidren (bodyView); Button topButton = new Button () { Height = Application.GetRealHeight (90), BackgroundColor = SkinStyle.Current.DialogTitle, TextSize = 18, TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.DialogTextColor, }; bodyView.AddChidren (topButton); Button btnIP = new Button () { Width = Application.GetRealWidth (400), Height = Application.GetRealHeight (90), X = Application.GetRealWidth (50), Y = topButton.Bottom, TextAlignment = TextAlignment.CenterLeft, Enable = false, TextColor = SkinStyle.Current.TextColor }; bodyView.AddChidren (btnIP); EditText etIP = new EditText () { Width = Application.GetRealWidth (400), Height = Application.GetRealHeight (80), X = Application.GetRealWidth (50), Y = btnIP.Bottom, TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor, Radius = 5, BorderColor = SkinStyle.Current.BorderColor, BorderWidth = 2, Enable = false }; bodyView.AddChidren (etIP); CommonPage.InitHttpListener (); topButton.TextID = R.MyInternationalizationString.DataReception; string ipAddressString = new Net.NetWiFi ().IpAddress == null ? "null" : new Net.NetWiFi ().IpAddress.ToString (); btnIP.TextID = R.MyInternationalizationString.IPAddresses; etIP.Text = ipAddressString; Button btnCloseSharing = new Button () { X = Application.GetRealWidth (50), Y = etIP.Bottom + Application.GetRealHeight (40), Width = Application.GetRealWidth (400), Height = Application.GetRealHeight (80), SelectedBackgroundColor = SkinStyle.Current.ButtonColor, BackgroundColor = SkinStyle.Current.SelectedColor, TextSize = 16, Radius = 5, BorderColor = SkinStyle.Current.Transparent, BorderWidth = 2, TextID = R.MyInternationalizationString.CloseDataSharing, TextColor = SkinStyle.Current.DialogTextColor }; bodyView.AddChidren (btnCloseSharing); btnCloseSharing.MouseDownEventHandler += (sender2, e2) => { btnCloseSharing.IsSelected = true; }; btnCloseSharing.MouseUpEventHandler += (sender2, e2) => { btnCloseSharing.IsSelected = false; CommonPage.CloseHttpListener (); Room.InitAllRoom (); dialog.Close (); }; dialog.Show (); } } }