samedi 13 janvier 2018

WPF Checkbox IsChecked binding on multiple viewmodel crashes

I'm pretty new at WPF and I got stuck. I’m trying to bind the IsChecked Property to a Property of a “Sub” – View Model: Model construction:

       internal VmMainMaster(NicCollector nicCollector)
    {
        _nicCollector = nicCollector;
        VmAdapterList = new VmNetworkAdapterList(nicCollector);
        VmNicData = new VmNicData(nicCollector.NetworkAdapter[0]);
    }

Property in VmNicData:

        public bool IpEnabled => NicData?.IpEnabled ?? false;

(PropertyChanged is Invoked somewhere else)

XAML Code:

       <CheckBox x:Name="CbIpEnabled"
        Grid.Row="0" Grid.Column="3"  VerticalAlignment="Center"
        IsEnabled="False"
        IsChecked="{Binding VmNicData.IpEnabled}"      />

Starting Debug Mod leads to: App is halted, but there is no displayable code cause all threads run external code The diagnostic tool is showing an undeclared exception having no sorcecode

Binding an property from master viewmodel works fine for VS2017 (but isn't usefull for me) Maybe you've got a hint for me? :) Any help wouldbe appriciated! TIA




Aucun commentaire:

Enregistrer un commentaire