DotvvmChildEventCallback
Details
src/Web/ViewModels/DefaultViewModel.cs 35(+11 -24)
diff --git a/src/Web/ViewModels/DefaultViewModel.cs b/src/Web/ViewModels/DefaultViewModel.cs
index 2c06744..8c38a19 100644
--- a/src/Web/ViewModels/DefaultViewModel.cs
+++ b/src/Web/ViewModels/DefaultViewModel.cs
@@ -7,7 +7,6 @@ namespace Web.ViewModels
{
public FirstViewModel First { get; set; }
public SecondViewModel Second { get; set; }
- public ThirdViewModel Third { get; set; }
public WizardNavigationViewModel Wizard { get; set; }
public DefaultViewModel()
@@ -15,8 +14,7 @@ namespace Web.ViewModels
Wizard = new WizardNavigationViewModel(new List<string>
{
"First",
- "Second",
- "Third"
+ "Second"
}, 1);
Initialize();
@@ -28,6 +26,7 @@ namespace Web.ViewModels
if (!First.IsInitialized)
First.Initialize();
+ Wizard.NextButtonEnabled = false; // default off until user checks to continue
Wizard.ShowNavigation();
}
@@ -43,27 +42,26 @@ namespace Web.ViewModels
if (!Second.IsInitialized)
Second.Initialize();
}
-
- if (Wizard.Step == 3)
- {
- if (Third == null) // TODO resolve with IOC
- Third = new ThirdViewModel();
-
- if (!Third.IsInitialized)
- Third.Initialize();
- }
}
public void OnPreviousClick()
{
Wizard.OnPreviousClick();
}
+
+ #region Private Methods
+ private void ToggleNextButtonEnabled(bool isEnabled)
+ {
+ Wizard.NextButtonEnabled = isEnabled;
+ }
+ #endregion
}
#region First
public class FirstViewModel
{
public bool IsInitialized { get; set; }
+ public bool IsNextEnabled { get; set; }
public void Initialize()
{
@@ -76,18 +74,7 @@ namespace Web.ViewModels
public class SecondViewModel
{
public bool IsInitialized { get; set; }
-
- public void Initialize()
- {
- IsInitialized = true;
- }
- }
- #endregion
-
- #region Third
- public class ThirdViewModel
- {
- public bool IsInitialized { get; set; }
+ public bool IsNextEnabled { get; set; }
public void Initialize()
{
src/Web/Views/Default.dothtml 35(+2 -33)
diff --git a/src/Web/Views/Default.dothtml b/src/Web/Views/Default.dothtml
index af74b06..5b0173b 100644
--- a/src/Web/Views/Default.dothtml
+++ b/src/Web/Views/Default.dothtml
@@ -65,6 +65,7 @@
degree of comparison only.
</p>
</blockquote>
+ <bs:CheckBox Checked="{value: IsNextEnabled}" IsInline="true" Text="Continue" />
</bs:CardBody>
</bs:Card>
</div>
@@ -95,43 +96,11 @@
towards the ocean with me.
</p>
</blockquote>
+ <bs:CheckBox Checked="{value: IsNextEnabled}" IsInline="true" Text="Continue" />
</bs:CardBody>
</bs:Card>
</div>
</div>
- <div IncludeInPage="{value: Wizard.Step == 3}">
- <div DataContext="{value: Third}">
- <bs:Card>
- <FooterTemplate>
- <footer class="blockquote-footer">H.G. Wells: <cite title="Source Title">The War of the Worlds</cite></footer>
- </FooterTemplate>
- <bs:CardBody>
- <blockquote class="blockquote">
- <p class="mb-0">
- No one would have believed in the last years of the nineteenth century that
- this world was being watched keenly and closely by intelligences greater than
- man’s and yet as mortal as his own; that as men busied themselves about their
- various concerns they were scrutinised and studied, perhaps almost as narrowly
- as a man with a microscope might scrutinise the transient creatures that swarm
- and multiply in a drop of water. With infinite complacency men went to and fro
- over this globe about their little affairs, serene in their assurance of their
- empire over matter. It is possible that the infusoria under the microscope do
- the same. No one gave a thought to the older worlds of space as sources of
- human danger, or thought of them only to dismiss the idea of life upon them as
- impossible or improbable. It is curious to recall some of the mental habits of
- those departed days. At most terrestrial men fancied there might be other men
- upon Mars, perhaps inferior to themselves and ready to welcome a missionary
- enterprise. Yet across the gulf of space, minds that are to our minds as ours
- are to those of the beasts that perish, intellects vast and cool and
- unsympathetic, regarded this earth with envious eyes, and slowly and surely
- drew their plans against us. And early in the twentieth century came the great
- disillusionment.
- </p>
- </blockquote>
- </bs:CardBody>
- </bs:Card>
- </div>
- </div>
</div>
</div>
</div>