The bottom line is that I can not bind in xaml model created in the viewmodel . If the model is obtained from SelectedItem ListBox 'a, then all the rules. And if through new then nothing. The code itself.
viewmodel private CCard selectedCard; public CCard SelectedCard { get { return selectedCard; } set { selectedCard = value; OnPropertyChanged("SelectedCard"); } } private Commands selectedRegnumCommand; public Commands SelectedRegnumCommand { get { return selectedRegnumCommand ?? (selectedRegnumCommand = new Commands(obj => { selectedCard = getSelectedCard(SelectedRegnum.Regnum); })); } } getSelectedCard - returns a CCard object
xaml <StackPanel x:Name="SP_cardInfo" DockPanel.Dock="Right" Width="300" DataContext="{Binding SelectedCard}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="120*"/> <ColumnDefinition Width="180*"/> </Grid.ColumnDefinitions> <TextBlock Text="Номер документа:" Grid.Column="0" /> <TextBlock x:Name="Tbl_regNum" Text="{Binding SelectedCard.Regnum, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Margin="10,0,64,0" /> </Grid> </StackPanel> CCard public string Regnum { get { return _regnum; } set { _regnum = value; OnPropertyChanged("Regnum"); } } In the model implemented INotifyPropertyChanged . Other moments work. I understand that the problem is precisely that SelectedCard is created via new . Tell me where I'm stupid