Let $(\mathscr{H_i})_{i\in I}$ be a collection Hilbert spaces and define $\mathscr{H} = \{h:I\rightarrow \cup_i\mathscr{H}_i:h(i)\in \mathscr{H}_i,\ \sum_{i\in I}\|h(i)\|^2<\infty\}$. Then it is easy to show that $\mathscr{H}$ is a Hilbert space. If we have uniformly bounded operators $\{A_i\}_{i\in I}$ on $\mathscr{H}_i$ we define $(Ah)(i)=\Big[(\oplus_j A_j)h\Big](i) = A_ih(i)$ so that $A$ is a bounded operator on $\mathscr{H}$. My question is now the following
Suppose $A = \oplus_{i\in I}A_i$ and $B = \oplus_{i\in I}B_i$ and that each $A_i$ and $B_i$ is irreducible (meaning that the only spaces so that the space together with its orthogonal complement is reducible under $A_i$ is $\mathscr{H_i}$ and $\{0\}$). Show that $A\simeq B$ if and only if we can find a permutation $\pi:I\rightarrow I$ such that $A_i\simeq B_{\pi(i)}$.
Here $A\simeq B$ means that we can find an isomorphism $U$ such that $UAU^{-1} = B$. Now I can prove the direction $\Leftarrow$ without too much difficulty however it is the $\Rightarrow$ direction which I have trouble with. My reasoning so far is along the following lines:
Let $\hat{\mathscr{H}}_j = \{h\in \mathscr{H}: h(i) = 0\text{ if $i\neq j$}\}$. Then it is clear that $B\hat{\mathscr{H}}_j\subseteq \mathscr{H}_j$ by the definition of $B$. Thus if $A\simeq B$ we conclude that $$UAU^{-1}\hat{\mathscr{H}}_j\subseteq \hat{\mathscr{H}}_j\Rightarrow AU^{-1}\hat{\mathscr{H}}_j\subseteq U^{-1}\hat{\mathscr{H}}_j.$$ Now if $P_i:{\mathscr{H}}\rightarrow {\mathscr{H}}$ is defined by $P_ih = h(i)$ then $P_iA = A_iP_i$ and therefore $$A_iP_iU^{-1}\hat{\mathscr{H}}_j = P_i AU^{-1}\hat{\mathscr{H}}_j\subseteq P_iU^{-1}\hat{\mathscr{H}}_j.$$ By applying a similar reasoning to $A^\ast = \oplus A_i^\ast$ one may conclude that $P_iU^{-1}\hat{\mathscr{H}}_j$ reduces $A_i$ and therefore if it is non-zero then $P_iU^{-1}\hat{\mathscr{H}}_j = \mathscr{H}_i$.
Now I want to use this to conclude that $\hat{\mathscr{H}}_i\subseteq U^{-1}\hat{\mathscr{H}}_j$ however I have trouble completing this argument. If I could show this then I could argue that $$U^{-1}BU\hat{\mathscr{H}}_i =A\hat{\mathscr{H}}_i\subseteq \hat{\mathscr{H}}_i$$
why $$BU\hat{\mathscr{H}}_i\subseteq U\hat{\mathscr{H}}_i\subseteq \hat{\mathscr{H}}_j$$ and therefore $$B_jP_jU\hat{\mathscr{H}}_i\subseteq P_jU\hat{\mathscr{H}}_i$$
so that $U\hat{\mathscr{H}}_j = \hat{\mathscr{H}}_i = \mathscr{H}_j$
and from this I could build my isomorphism. However I don't know how to get to this point.