private void buttonAddIP_Click(object sender, RoutedEventArgs e) { IPRangeDialog ipRangeDialog = new IPRangeDialog { Owner = this }; buttonAddIP.CommandParameter = (ipRangeDialog.ShowDialog() == true) ? ipRangeDialog.IPAddressRange : null; }
private void buttonEditIP_Click(object sender, RoutedEventArgs e) { IPRangeDialog ipRangeDialog = new IPRangeDialog { Owner = this }; ipRangeDialog.IPAddressRange = (IPAdressesRange)listBoxIPRange.SelectedItem; buttonEditIP.CommandParameter = (ipRangeDialog.ShowDialog() == true) ? ipRangeDialog.IPAddressRange : null; }