I've stepped through my code using breakpoints but I fail to see why
the UpdateCommand does not seem to be enabled when this.UpdateEnabled ==
true.
UpdateViewModel sets State = Initializing
DetectUpdateBegin is fired setting State = Checking
this.RaisePropertyChanged(() => this.State); ================= Checking
this.RaisePropertyChanged(() => this.Title); ================= Checking
for updates
this.RaisePropertyChanged(() => this.CheckingEnabled); ======= True
this.RaisePropertyChanged(() => this.IsUpToDate); ============ False
this.RaisePropertyChanged(() => this.UpdateEnabled); ========= False
DetectComplete is fired, State is still Checking so nothing is changed
worker_DoWork response is evaluated and update is found, sets State =
Available
this.RaisePropertyChanged(() => this.State); =================
Available
this.RaisePropertyChanged(() => this.Title); ================= Newer
version available
this.RaisePropertyChanged(() => this.CheckingEnabled); ======= False
this.RaisePropertyChanged(() => this.IsUpToDate); ============ False
this.RaisePropertyChanged(() => this.UpdateEnabled); ========= True
RootView shows "Update Available" and Wrench Icon, only the button
doesnt appear to be enabled (no mouseover effect) and clicking on it
does nothing.
I've compared my code to the example Setup\WixBA but don't see why this
isn't working correctly.
It seems to be something to do with the UpdateCommand not re-evaluating
the CanExecute method which is bound to a property that gets changed.
Only thing I really changed from example to mine is I am using Prism
for NotificationObject.
====
EDIT:
As I was writing this I tried something and got it to work, can anyone
tell me why the default isn't working but my changes below are working?
(Is it just because I am using Prism?)
=====
public bool UpdateEnabled
{
get
{
//return this.UpdateCommand.CanExecute(this); // Orig:
Cant click update if update found...
return this.State == UpdateState.Available;
}
}
private ICommand updateCommand;
public ICommand UpdateCommand
{
get
{
if (this.updateCommand == null)
{
this.updateCommand = new DelegateCommand(
() => ConfirmUpdateRequest(),
//() => this.State == UpdateState.Available);
// Orig: Doesnt seem to be enabled once this.State ==
UpdateState.Available
() => !this.IsUpToDate);
}
return this.updateCommand;
}
}
=====
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users