Wpf user control button command is not firing in viewmodel
        Posted  
        
            by mani1985
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by mani1985
        
        
        
        Published on 2010-03-27T10:26:57Z
        Indexed on 
            2010/03/27
            10:33 UTC
        
        
        Read the original article
        Hit count: 285
        
wpf-usercontrols
hi,
i have a user control in which there is a button. i wrote icommand in the viewmodel for the button to call some function. when i use this user control in some other page ,the user control button click is not working.
my xaml
Save
my view model private ICommand _insertNewNote; public ICommand InsertNewNote { get { if (_insertNewNote == null) { _insertNewNote = new RelayCommand( param => this.InsertNewExceptionNote()); } return _insertNewNote; } }
public void InsertNewExceptionNote()
 { 
     //...
 }
my problem is when i use this user control in some page like this
the user control is getting displayed in the page. but the button in the user control is not firing when i click it.
user control view model icommand is not at all initialized. please provide me a solution.
Thanks in advance.
© Stack Overflow or respective owner