Лялюшкин - Лабораторная работа #3

Maybe you should create some method in viewModel like:
void log(string)
{
      if (logger != null)
              .........
}