private void BtnClicked(object sender, RoutedEventArgs e) { var proxy = new DemoClient(); proxy.DoSomething(); proxy.Close(); }