private void btnUpload_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            Nullable <bool> result             = dlg.ShowDialog();

            if (result == true)
            {
                string    filename = dlg.FileName;
                string    content  = File.ReadAllText(filename);
                ShareFile share    = new ShareFile(this.ToByte(content), filename, int.Parse(txtSharesTotal.Text), int.Parse(txtRequired.Text), int.Parse(txtReturn.Text));
                Controller.getController().service.UploadFile(share, Controller.getController().user, Controller.getController().getIPAddress());
            }
        }
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            string username = this.txtUsername.Text;
            string password = this.pwdPassword.Password;

            Controller.getController().user = Controller.getController().service.Login(Controller.getController().getIPAddress(), username, password);
            if (Controller.getController().user != null)
            {
                winFiles wf = new winFiles();
                wf.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Error Loggin in");
            }
        }
 public MainWindow()
 {
     InitializeComponent();
     txtUsername.Text = Controller.getController().getIPAddress();
 }