public NewCameraView() { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; var viewModel = new NewCameraViewModel(); this.DataContext = viewModel; if (viewModel.CloseAction == null) { viewModel.CloseAction = new Action(this.Close); } }
public MainPage() { this.InitializeComponent(); CamerasViewModel = new CamerasViewModel(); newCamera = new NewCameraViewModel(); string language = ApplicationData.Current.LocalSettings.Values["Language"] as string; if (!string.IsNullOrEmpty(language)) { this.resourceLoader = ResourceLoader.GetForCurrentView(language); } else { this.resourceLoader = ResourceLoader.GetForCurrentView("En-en"); ApplicationData.Current.LocalSettings.Values["Language"] = "En-en"; } AddNewCameraCommand = new ButtonCommand(new Action(AddCamera), () => false); RefreshCamerasCommand = new ButtonCommand(new Action(StartBackgroundTask)); }