Microprocessor Caliburn + TransitioningContentControl

I had a problem with my CM explorer supporting the correct Active binding to the contents of the TransitioningContentControl.

In case it matters, I use Conductor<Screen>.Collection.OneActive

Steps to reproduce the problem

Create a TransitioningContentControl binding to ActiveItem wires:

<toolkit:TransitioningContentControl x:Name="ActiveItem" />

Create two buttons:

<Button x:Name="Nav1" Content="Test1"></Button>
<Button x:Name="Nav2" Content="Test2"></Button>

In the view model, connect Nav1 and Nav2 transition events to set activeitem

public void Nav1()
{
    ActiveItem = _viewModel1;
}

public void Nav2()
{
    ActiveItem = _viewModel2;
}

At first glance, this seems to work fine - however, there is a problem. Let say that the active element represents Nav1 (_viewModel1).

"Nav2" "Nav1" , ContinentalControl , Nav2 , ActiveItem _viewModel1.

, ActiveItem _viewModel1, _viewModel2.

? - ActiveItem ?

Edit:

" ", , ActiveItem ArgumentException. :

at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
(lots of junk)
Caliburn.Micro!Caliburn.Micro.View.SetContentPropertyCore(object targetLocation, object view) + 0xec bytes  
Caliburn.Micro!Caliburn.Micro.View.SetContentProperty(object targetLocation, object view) + 0x84 bytes  
Caliburn.Micro!Caliburn.Micro.View.OnModelChanged(System.Windows.DependencyObject targetLocation, System.Windows.DependencyPropertyChangedEventArgs args) + 0xda bytes  

, .

+3
1

ActivateItem , ActiveItem.

public void Nav1()
{
    ActiveItem(_viewModel1);
}

,

Martin

0
source

All Articles