Пример #1
0
        private void ShowPhotoSearchView_Click(object sender, RoutedEventArgs e)
        {
            PhotoSearchView view = new PhotoSearchView();

            view.ViewModel = new PhotoSearchViewModel(view, this.settings);
            view.Owner     = this;
            //view.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            view.Show();
        }
Пример #2
0
 public PhotoSearchViewModel(PhotoSearchView view, Settings appSettings)
 {
     this.view                  = view;
     this.appSettings           = appSettings;
     this.context               = new PhotoSearchServiceContext();
     context.OnServiceCallBack += Context_OnServiceCallBack;
     this.years                 = new List <string>();
     for (int i = 1900; i < DateTime.Now.Year; i++)
     {
         this.years.Add(i.ToString());
     }
     this.YearStart     = (DateTime.Now.Year - 35).ToString();
     this.YearEnd       = (DateTime.Now.Year - 35).ToString();
     this.nationalities = new List <Nationality>();
     this.sexs          = Sex.GetSexs();
     this.view.webBrowser.NavigateToString("<!DOCTYPE html ><html><meta http-equiv='Content-Type' content='text/html;charset=UTF-8'><body style='background-color:#c6c6c6;'> </body></html>");
 }