in Education by
I've got the following code in my MainPage.xaml.cs public partial class MainPage : UserControl { private IsolatedStorageSettings userLogin = IsolatedStorageSettings.ApplicationSettings; private UserDataContract currentUser; private MainViewModel mainViewModel; public MainPage() { InitializeComponent(); } // If an error occurs during navigation, show an error window private void ContentFrameNavigationFailed(object sender, NavigationFailedEventArgs e) { e.Handled = true; ChildWindow errorWin = new ErrorWindow(e.Uri); errorWin.Show(); } private void Button_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Navigate(new Uri("#/Fields/Edit", UriKind.Relative)); } } Now I would like to bind my ViewModel to the MainPage.xaml, how can I do this? mainViewModel = new MainViewModel(); this.LayoutRoot.DataContext = loginViewModel; Doesn't really work JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
public MainPage() { InitializeComponent(); mainViewModel = new MainViewModel(); this.DataContext = mainViewModel ; }

Related questions

0 votes
    I have implemented a User Control in which I have bound the DataContext to itself like this... this. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I am trying to understand ViewModel and LiveData. In MainActivity, I am observing LiveData In MyTask, I am ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I am trying to understand ViewModel and LiveData. In MainActivity, I am observing LiveData In MyTask, I am ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 13, 2022 in Education by JackTerrance
0 votes
    I have a Theme attribute that I can load like this: AeroTheme is a class. How can I achieve the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I'm totally new to Xamarin, so please be patient! Somehow Xamarin adds a mysterious Margin to all my ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    Is there a way, for the FlipView control, to ONLY have it load the selected item?? The default ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 10, 2022 in Education by JackTerrance
0 votes
    Is there a way, for the FlipView control, to ONLY have it load the selected item?? The default ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
0 votes
    I have a Theme attribute that I can load like this: AeroTheme is a class. How can I achieve the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
0 votes
    I want to add a single model object that has been instantiated once in XAML, and add it to two ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I have a ListBox that scrolls images horizontally. I have the following XAML I used blend to create it. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    If I have a UserControl: Foo.Bar.MyClass, I know I can reference it in XAML by declaring: xmlns: ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I am working on WPF application.I have bound my textblock to my button. I want to set foreground ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I am working on WPF application.I have bound my textblock to my button. I want to set foreground ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    When defining the contents of a Grid, I first define all row and column definitions, then afterwards when ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    What is XAML in WPF and also explain the types of XAML?...
asked Apr 9, 2021 in Education by JackTerrance
...