public DVCLogIn() : base(UITableViewStyle.Grouped, null, true) { loginView = new FBLoginView (ExtendedPermissions); if (UIDevice.CurrentDevice.CheckSystemVersion (7, 0)) { loginView.Frame = new RectangleF (51, 0, 218, 46); } else { loginView.Frame = new RectangleF (40, 0, 218, 46); } loginView.FetchedUserInfo += (sender, e) => { if (Root.Count < 3) { user = e.User; pictureView.ProfileID = user.GetId (); Root.Add (new Section ("Hello " + user.GetName()) { new StringElement ("Actions Menu", () => { var dvc = new DVCActions (user); NavigationController.PushViewController (dvc, true); }) { Alignment = UITextAlignment.Center } }); } }; loginView.ShowingLoggedOutUser += (sender, e) => { pictureView.ProfileID = null; if (Root.Count >= 3) { InvokeOnMainThread (() => { var section = Root [2]; section.Remove (0); Root.Remove (section); ReloadData (); }); } }; pictureView = new FBProfilePictureView () ; if (UIDevice.CurrentDevice.CheckSystemVersion (7,0)) { pictureView.Frame = new RectangleF (50, 0, 220, 220); } else { pictureView.Frame = new RectangleF (40, 0, 220, 220); } Root = new RootElement ("Facebook Sample") { new Section () { new UIViewElement ("", loginView, true) { Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent, } }, new Section () { new UIViewElement ("", pictureView, true) { Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent, }, } }; }
public DVCActions(IFBGraphUser facebookUser) : base(UITableViewStyle.Grouped, null, true) { this.user = facebookUser; pictureView = new FBProfilePictureView() { ProfileID = user.GetId() }; if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { pictureView.Frame = new RectangleF(120, 0, 80, 80); } else { pictureView.Frame = new RectangleF(110, 0, 80, 80); } Root = new RootElement("Menu") { new Section() { new UIViewElement("", pictureView, true) { Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent, } }, new Section() { new StringElement(user.GetName()) { Alignment = UITextAlignment.Center } }, new Section("Actions") { new StringElement("Share Xamarin.com", ShareUrl) { Alignment = UITextAlignment.Center }, new StringElement("Graph API Sample - Post \"Hello\"", GraphApiPost) { Alignment = UITextAlignment.Center }, new StringElement("Graph API Sample - Delete \"Hello\"", GraphApiDeletePost) { Alignment = UITextAlignment.Center }, new StringElement("Select Some Friends", FriendPicker) { Alignment = UITextAlignment.Center }, new StringElement("Select a Place", PlacePicker) { Alignment = UITextAlignment.Center } } }; }
public DVCActions(IFBGraphUser facebookUser) : base(UITableViewStyle.Grouped, null, true) { this.user = facebookUser; pictureView = new FBProfilePictureView () { ProfileID = user.GetId() }; if (UIDevice.CurrentDevice.CheckSystemVersion (7,0)) { pictureView.Frame = new RectangleF (120, 0, 80, 80); } else { pictureView.Frame = new RectangleF (110, 0, 80, 80); } Root = new RootElement ("Menu") { new Section (){ new UIViewElement ("", pictureView, true) { Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent, } }, new Section () { new StringElement (user.GetName()) { Alignment = UITextAlignment.Center } }, new Section ("Actions") { new StringElement ("Share Xamarin.com", ShareUrl) { Alignment = UITextAlignment.Center }, new StringElement ("FQL Sample - Show 25 friends", FQLSample) { Alignment = UITextAlignment.Center }, new StringElement ("Graph API Sample - Post \"Hello\"", GraphApiPost) { Alignment = UITextAlignment.Center }, new StringElement ("Graph API Sample - Delete \"Hello\"", GraphApiDeletePost) { Alignment = UITextAlignment.Center }, new StringElement ("Select Some Friends", FriendPicker) { Alignment = UITextAlignment.Center }, new StringElement ("Select a Place", PlacePicker) { Alignment = UITextAlignment.Center } } }; }
public DVCLogIn() : base(UITableViewStyle.Grouped, null, true) { loginView = new FBLoginView(ExtendedPermissions); if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { loginView.Frame = new RectangleF(51, 0, 218, 46); } else { loginView.Frame = new RectangleF(40, 0, 218, 46); } loginView.FetchedUserInfo += (sender, e) => { if (Root.Count < 3) { user = e.User; pictureView.ProfileID = user.GetId(); Root.Add(new Section("Hello " + user.GetName()) { new StringElement("Actions Menu", () => { var dvc = new DVCActions(user); NavigationController.PushViewController(dvc, true); }) { Alignment = UITextAlignment.Center } }); } }; loginView.ShowingLoggedOutUser += (sender, e) => { pictureView.ProfileID = null; if (Root.Count >= 3) { InvokeOnMainThread(() => { var section = Root [2]; section.Remove(0); Root.Remove(section); ReloadData(); }); } }; pictureView = new FBProfilePictureView(); if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { pictureView.Frame = new RectangleF(50, 0, 220, 220); } else { pictureView.Frame = new RectangleF(40, 0, 220, 220); } Root = new RootElement("Facebook Sample") { new Section() { new UIViewElement("", loginView, true) { Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent, } }, new Section() { new UIViewElement("", pictureView, true) { Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent, }, } }; }
public User(IFBGraphUser user) { id = user.GetId(); name = user.GetName(); GetEmail(); }