public AboutPrompt() { DefaultStyleKey = typeof(AboutPrompt); var okButton = new RoundButton(); okButton.Click += ok_Click; ActionPopUpButtons.Add(okButton); }
protected UserPrompt() { var okButton = new RoundButton(); _cancelButton = new RoundButton(); okButton.Click += OkClick; _cancelButton.Click += CancelledClick; ActionPopUpButtons.Add(okButton); ActionPopUpButtons.Add(_cancelButton); SetCancelButtonVisibility(IsCancelVisible); }
protected UserPrompt() { var okButton = new RoundButton(); _cancelButton = new RoundButton { ImageSource = new BitmapImage( new Uri( "/Coding4Fun.Phone.Controls;component/Media/icons/appbar.cancel.rest.png", UriKind.RelativeOrAbsolute)) }; okButton.Click += ok_Click; _cancelButton.Click += cancelled_Click; ActionPopUpButtons.Add(okButton); ActionPopUpButtons.Add(_cancelButton); SetCancelButtonVisibility(IsCancelVisible); }
public CardPageWrapperPopup(CardPage card) { _card = card; // Remove the standard circular button ActionPopUpButtons.RemoveAll(new Predicate <System.Windows.Controls.Button>( delegate(System.Windows.Controls.Button arg) { return(true); })); // Do any further initialization. e.g. loading some elements into the popup // This is our great hack. Without having the Platform property set, sizing isnt working // See the VisualElement.OnSizeRequest method. var pi = _card.GetType().GetProperty("Platform", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); var val = pi.GetValue(Xamarin.Forms.Application.Current.MainPage); pi.SetValue(_card, val); // Set renderer if (Xamarin.Forms.Platform.WinPhone.ViewExtensions.GetRenderer(_card) == null) { Xamarin.Forms.Platform.WinPhone.ViewExtensions.SetRenderer(_card, RendererFactory.GetRenderer(_card)); } // Layout _card.Layout(new Xamarin.Forms.Rectangle(0.0, 0.0, Application.Current.Host.Content.ActualWidth - 45, _card.RequestedHeight)); var el = (UIElement)Xamarin.Forms.Platform.WinPhone.ViewExtensions.GetRenderer(_card); this.Body = new Border { Width = Application.Current.Host.Content.ActualWidth - 45, Height = _card.RequestedHeight, Background = new SolidColorBrush(Colors.Blue), Child = el }; }