public App()
        {
            var mainWindowVm = new MainWindowViewModel();

            CultureInfo ci = new CultureInfo(mainWindowVm.SelectedLocale.ToString());
            Thread.CurrentThread.CurrentCulture = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
        }
        public MainWindow()
        {
            InitializeComponent();

            ResourceFileCodeBehind.Text = (string) Application.Current.FindResource("localizedMessageCodeBehind");

            DataContext = new MainWindowViewModel();
        }
示例#3
0
 public MainWindow()
 {
     InitializeComponent();
     //IList li = new TestModel[] { };
     dg.CellEditEnding += dg_CellEditEnding;
     dg.RowEditEnding += dg_RowEditEnding;
     this.DataContext =viewModel= new MainWindowViewModel();
 }
示例#4
0
        protected void OnAppStartup(object sender, StartupEventArgs e)
        {
            WpfApplication1.MainWindowViewModel mwvm = new MainWindowViewModel();
            WpfApplication1.MainWindow mw = new WpfApplication1.MainWindow()
            {
                DataContext = mwvm,
            };

            mw.Show();

            Application.Current.MainWindow = mw;
        }
示例#5
0
 public MainWindow()
 {
     InitializeComponent();
       DataContext = new MainWindowViewModel();
 }
 void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     DataContext = new MainWindowViewModel();
 }