Example #1
0
        private void CityRadioButton_Click(object sender, RoutedEventArgs e)
        {
            CityRadioButton radioButton = sender as CityRadioButton;

            selectedCity = radioButton.City;

            Delete_Button.IsEnabled     = true;
            ChangeData_Button.IsEnabled = true;
        }
Example #2
0
        //creating list of data from database with radiobuttons
        private void LoadCities()
        {
            DataBase_ListBox.Items.Clear();

            List <City> cities = DBSQLite.GetInstance().FetchCities();

            foreach (var city in cities)
            {
                //using custom radiobutton
                CityRadioButton cityRadioButton = new CityRadioButton(city);
                cityRadioButton.Click += CityRadioButton_Click;
                DataBase_ListBox.Items.Add(cityRadioButton);
            }
        }