public ContentCard() { InitializeComponent(); CardHeader.SetBinding(Label.TextProperty, new Binding(nameof(Header), source: this)); CardButton.SetBinding(Button.TextProperty, new Binding(nameof(ButtonName), source: this)); CardButton.SetBinding(Button.CommandProperty, new Binding(nameof(Command), source: this)); CardButton.SetBinding(IsVisibleProperty, new Binding(nameof(ButtonVisible), source: this)); }
private void DisplayImage(MWCard card) { CardButton button = new CardButton(); Binding bind = new Binding(); bind.Source = card; bind.Mode = BindingMode.OneWay; button.SetBinding(DataContextProperty, bind); button.Tapped += Button_Tapped; //cardPopup.Margin = new Thickness(100); cardPopup.VerticalOffset = (this.Frame.ActualHeight / 2) - (255); cardPopup.HorizontalOffset = (this.Frame.ActualWidth / 2) - (183); cardPopup.Child = button; cardPopup.IsOpen = true; }