Well I ended up figuring it out soon after posting this thanks to this thread. I ended up changing:
Command="{Binding Source={x:Reference this}, Path=BindingContext.MyCommand}}"
to
Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:MyViewModel}}, Path=MyCommand, x:DataType=viewmodel:MyViewModel}"