Let $X,Y$ be Banach spaces. I want to show that $A: \text{Dom}(A) \subseteq X \rightarrow Y$ is a closed linear operator if and only if for $x_n \in \text{Dom}(A)$ with $x_n \rightharpoonup x$ and $Ax_n \rightharpoonup y$ we have $x \in \text{Dom}(A)$ and $Ax = y$. Here "$\rightharpoonup$" denotes weak convergence.
The $\Leftarrow$ direction is straightforward because strong convergence implies weak convergence. But I couldn't come up with an argument for $\Rightarrow$ direction. Suppose $A$ is closed, which is equivalent to the fact that $x_n \rightarrow x$ and $Ax_n \rightarrow y$ implies $Ax = y$. Now assume $x_n \rightharpoonup x$ and $Ax_n \rightharpoonup y$. We need to show $x \in \text{Dom}(A)$ and $Ax = y$. How do I proceed from here?