Mvvm light messenger strange working

74 Views Asked by At

I think that the question is something weird. But for example i have some code like

Messenger.Default.Register<BinarySelectorCommunicator>(this, (emp) => {
    if (emp.Option == ((int)Games.HighLow).ToString())
    {
        DB = null;
        DB = new HigLow();
        DB.Boxes = new ObservableCollection<BoxStruct>();
    }
});

It's working well in debug mode compiler enter in each row. but when i am adding new function something like

Messenger.Default.Register<BinarySelectorCommunicator>(this, (emp) =>
{
    if (emp.Option == ((int)Games.HighLow).ToString())
    {
        DB = null;
        DB = new HigLow();
        DB.Boxes = new ObservableCollection<BoxStruct>();
        DB.inputAssets = new ObservableCollection<string>((from x in InputData select x.Id).Take(1));
    }
});

It does not work. compiler in debug mode does not even enter into messenger. I know that the question weird. why this happen in theory? It's throw exception?

0

There are 0 best solutions below