mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fix issue with BaseViewModel override
When the main view doesn't use a BaseViewModel class, we create an AdaptedViewModel for the layout and document. However, we don't want to "Eval" the various properties to the original ViewModel to avoid conflicting rendering of zones. --HG-- branch : dev
This commit is contained in:
@@ -42,11 +42,15 @@ namespace Orchard.Mvc.ViewModels {
|
|||||||
public TProperty Value {
|
public TProperty Value {
|
||||||
get {
|
get {
|
||||||
if (_value == null && _builder != null) {
|
if (_value == null && _builder != null) {
|
||||||
_value = _original.Eval(_expression) as TProperty;
|
object temp;
|
||||||
if (_value == null)
|
if (_original.TryGetValue(_expression, out temp) &&
|
||||||
|
temp is TProperty) {
|
||||||
|
SetValue(temp as TProperty);
|
||||||
|
}
|
||||||
|
else {
|
||||||
SetValue(_builder());
|
SetValue(_builder());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _value;
|
return _value;
|
||||||
}
|
}
|
||||||
set { SetValue(value); }
|
set { SetValue(value); }
|
||||||
|
|||||||
Reference in New Issue
Block a user