Click here to Skip to main content

Silverlight / WPF

 
QuestionGrid Pinmemberehsan ebne ali28-Nov-12 1:01 
QuestionSet Backgroundcolor when CheckBox in TreeView is checked PinmemberMember 963452828-Nov-12 0:43 
QuestionWPF Grid Splitter Problem PinmemberKevin Marois27-Nov-12 17:27 
QuestionWPF Dispatch.Invoke/BeginInvoke deadlock? [modified] Pinmemberdevvvy26-Nov-12 20:30 
Answer[SOLN FOUND] - it is NOT that Dispatcher.Invoke buggy! [modified] Pinmemberdevvvy29-Nov-12 15:15 
GeneralRe: [SOLN FOUND] - it is NOT that Dispatcher.Invoke buggy! PinmemberPaulo Zemek23-Jan-13 7:41 
QuestionChange [EnableClientAccess(RequiresSecureEndpoint = true)] based on config PinmemberUCLAdam20-Nov-12 23:34 
QuestionCommand Binding PinmemberAndy_L_J19-Nov-12 11:51 
I have the following set-up:
 
1. ViewModel:
...
public ICommand LoadSomeViewCommand;
 
public SomeViewModel(IRegionManager regionManager, IUnityContainer container)
{  
 
  this._regionManager = regioinManager;
  this._container = container;
 
  LoadCommand = new RelayCommand(new Action<object>(LoadSomeViewExecute), new Predicate<object>(CanLoadExecute));
 
}
...
private void LoadSomeViewExecute(object obj)
{
  IRegion mainRegion = _regionManager.Regions[RegionNames.MainRegion];
  foreach (var v in mainRegion.Views)
  {
    mainRegion.Remove(v);
  }
  _regionManager.RegisterViewWithRegion(RegionNames.MainRegion, typeof(SomeNewView));
 
}
 
private bool CanLoadExecute(object obj)
{
  return true;
}
in the View.cs:
public SomeView(IRegionManager regionManager, IUnityContainer container)
{
  InitializeComponent();
  this.DataContext = new SomeViewModel(regionManager, container);
}
 
public SomeViewModel ViewModel
{
  get { return (SomeViewModel)this.DataContext; }
}
 
and in xaml:
...
<StackPanel grid.Row="2">
  <Button Content="Load"
          Command="{Binding LoadCommand}"/>
  ...
</StackPanel>
 
When I click the button to load another component, the LoadCommand has been set in the constructor but never seems to be called on the button click.
I have been converting a VB project to C# to try and learn the language and maybe I have missed something in the translation.
 
I have other containers injecting into the shell that don't use Command calls that are working fine.
I don't speak Idiot - please talk slowly and clearly
 
"I have sexdaily. I mean dyslexia. Fcuk!"
 
Driven to the arms of Heineken by the wife

AnswerRe: Command Binding PinmemberSledgeHammer0119-Nov-12 12:14 
GeneralRe: Command Binding PinmemberAndy_L_J19-Nov-12 12:36 
GeneralRe: Command Binding PinmemberMycroft Holmes19-Nov-12 12:51 
GeneralRe: Command Binding PinmemberAndy_L_J19-Nov-12 13:14 
GeneralRe: Command Binding PinmemberMycroft Holmes19-Nov-12 14:22 
GeneralRe: Command Binding PinmemberSledgeHammer0119-Nov-12 13:14 
GeneralRe: Command Binding PinmemberMycroft Holmes19-Nov-12 14:26 
GeneralRe: Command Binding PinmentorWayne Gaylard20-Nov-12 4:29 
GeneralRe: Command Binding PinmemberSledgeHammer0120-Nov-12 7:42 
AnswerRe: Command Binding PinprotectorPete O'Hanlon22-Nov-12 23:41 
GeneralRe: Command Binding PinmemberAndy_L_J23-Nov-12 2:48 
QuestionWPF Components For WinForm Pinmemberalirezamansoori13-Nov-12 6:26 
AnswerRe: WPF Components For WinForm PinprotectorPete O'Hanlon13-Nov-12 8:56 
AnswerRe: WPF Components For WinForm PinmvpAbhinav S13-Nov-12 22:17 
GeneralRe: WPF Components For WinForm Pinmemberalirezamansoori14-Nov-12 21:40 
QuestionCan anyone suggest any good books or tutorials on WPF-MVVM please? PinmemberVijay Kanda11-Nov-12 20:22 
AnswerRe: Can anyone suggest any good books or tutorials on WPF-MVVM please? PinmemberRags151213-Nov-12 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150129.1 | Last Updated 27 Jan 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid