Пример #1
0
        public NewCustomerUC(searchCustomerTypeEnum displayType)
        {
            InitializeComponent();

            viewModel = new NewCustomer_ViewModel(displayType);
            DataContext = viewModel;

            viewModel.CityRequested += (s, a) =>
            {
                cityChooserWindow = new SearchCity();
                cityChooserVM = cityChooserWindow.DataContext as SearchCity_ViewModel;
                cityChooserVM.citySelected += (so, ar) =>
                {
                    viewModel.newCustomer.city = (CityRepresentation)so;
                    cityChooserWindow.Close();
                };
                cityChooserWindow.Show();
            };
        }
Пример #2
0
        private void BuildCityChooserWindow()
        {
            cityPickerWindow = new SearchCity();
            cityPicker_VM = cityPickerWindow.DataContext as SearchCity_ViewModel;

            cityPicker_VM.citySelected += (s, a) =>
            {
                viewModel.selectedCustomer.city = (CityRepresentation)s;
                cityPickerWindow.Hide();
            };
        }