Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to refresh content inside stack layout, created from backend code in xamarin cs file???

$
0
0

foreach (var item in TransactionList)
{
var trans = new Transaction();

            var innerLayout = new StackLayout();

            var innerFrame = new Frame()
            {
                BackgroundColor = Color.FromHex("#DDE0E7"), Margin = new Thickness(0, 0, 0, 0), Padding = new Thickness(10, 8, 10, 8)
            };
            var typeLabel = new Label
            {
                Text = item.designation, TextColor = Color.FromHex("#054A90"), FontAttributes = FontAttributes.Bold
            };
            var dateLabel = new Label
            {
                Text = item.date.ToString("MM/dd/yyyy"), TextColor = Color.FromHex("#737E87"), FontAttributes = FontAttributes.Bold
            };
            var amountLabel = new Label
            {
                Text = item.amount, TextColor = Color.FromHex("#00BBEE"), FontAttributes = FontAttributes.Bold
            };
            var statusLabel = new Label
            {
                Text = item.status, TextColor = Color.FromHex("#6dac54"), FontAttributes = FontAttributes.Bold
            };

            var transacionImage = new ImageButton { Source = "ic_action_import_contacts.png", BackgroundColor = Color.FromHex("#DDE0E7") };

            var grid = new Grid { ColumnSpacing = 20 };

            grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
            grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });

            grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(36) });
            grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });                

            grid.Children.Add(transacionImage, 0, 0);               

            grid.Children.Add(typeLabel, 1, 0);
            grid.Children.Add(dateLabel, 2, 0);
            grid.Children.Add(amountLabel, 1, 1);
            grid.Children.Add(statusLabel, 2, 1);

            Grid.SetRowSpan(transacionImage, 2);                
            innerFrame.Content = grid;
            CustomizedStackLayout.Children.Add(innerFrame);

            // Pop up window
            var gestureRecognizer = new TapGestureRecognizer()
            {
                CommandParameter = item
            };

            gestureRecognizer.Tapped += (s, e) =>
            {
                popupImageView.IsVisible = true;
                CustomizedFrames.Opacity = 0.5;

            };
            innerFrame.GestureRecognizers.Add(gestureRecognizer);
        }

From this list if we have deleted a frame. Now how can we show updated content ??? or refresh the page without navigation??


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>