1

I am setting the GridView Data Context in XAML similar to so:

<Grid x:Name="pageGrid">
        <Grid.DataContext>
            <local:ViewModel/>
        </Grid.DataContext>
</Grid>

This "ViewModel" class is a static class that is fill during:

public MainPage()
{
    this.InitializeComponent();
    FillViewModel():
}

This allows for the view model to bound on screen load which works.

However, I want to load FillViewModel after the MainPage has initially ran.

Is there a way to programatically refresh the pageGrid XAML databinding? I have to be just missing it.

aherrick
  • 19,799
  • 33
  • 112
  • 188

1 Answers1

-1

However, I want to load FillViewModel after the MainPage has initially ran.

Sounds like your looking for the MainWindow / Control "Loaded" Event.

XAML:

<Grid x:Name="Grid1" Loaded="Grid1_Loaded"/>

Code Behind:

private void Grid1_Loaded(object sender, RoutedEventArgs e)
{
    // Do Stuff
}