1 Flashcards

1
Q

Scop: seteaza Grid DataContext

Se da:

MainViewModel

Se cere:

Seteaza Grid DataContext direct in XAML

A

Pasi:

  1. Creeaza Window.Resources

se instantiaza MainViewModel x:Key=”_viewModel”

  1. In Grid seteaza DataContext=”{StaticResource _viewModel}”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Access Resources xaml from code behind

Se da:

in XAML, Window.Resources este instantiat MainWindowViewModel cu x:Key=”_viewModel”

Se cere:

In code behind, cum se obtine o referinta la _viewModel

A

(MainWindowViewModel)this.Resources[“_viewModel”];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Se da:

event Loaded=”Window_Loaded” …

private async void Window_Loaded

Se cere:

Cum se foloseste Dispatcher.BeginInvoke

A

await Dispatcher.BeginInvoke (new Action( () => { _viewModel.LoadStateCodes;}),

DispatcherPriority.Background);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly