예제 #1
0
 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));
 }
예제 #2
0
        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;
        }