Skip to content

Commit

Permalink
Show code while animating fact tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael L Perry committed Jun 6, 2011
1 parent ed3eea0 commit fc0592b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
1 change: 1 addition & 0 deletions ThoughtCloud.Presentation/ThoughtCloud.Presentation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<Compile Include="Navigation\NavigationController.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\FactsViewModel.cs" />
<Compile Include="ViewModels\IPresentationViewModel.cs" />
<Compile Include="Views\ArchitectureView.xaml.cs">
<DependentUpon>ArchitectureView.xaml</DependentUpon>
</Compile>
Expand Down
33 changes: 24 additions & 9 deletions ThoughtCloud.Presentation/ViewModels/FactsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
using System.Windows.Input;
using UpdateControls.Fields;
using UpdateControls.XAML;
using System;
using UpdateControls.Fields;

namespace ThoughtCloud_Presentation.ViewModels
{
public interface IPresentationViewModel
{
bool Backward();
bool Forward();
}
public class FactsViewModel : IPresentationViewModel
{
public enum StateId
Expand Down Expand Up @@ -60,6 +52,29 @@ public string Code
{
get
{
switch (_state.Value)
{
case StateId.NewIdentityMike:
return "Identity mike = Community.AddFact(\nnew Identity(\"mike\"));";
case StateId.NewIdentityRussell:
return "Identity russell = Community.AddFact(\nnew Identity(\"russell\"));";
case StateId.NewCloud1:
return "Cloud cloud1 = Community.AddFact(new Cloud());";
case StateId.NewCloud2:
return "Cloud cloud2 = Community.AddFact(new Cloud());";
case StateId.NewThought3:
return "Thought thought3 = Community.AddFact(\nnew Thought(cloud1));";
case StateId.NewThought3Text:
return "thought3.Text = \"Star Wars\";";
case StateId.NewThought4:
return "Thought thought4 = Community.AddFact(\nnew Thought(cloud1));";
case StateId.NewThought4Text:
return "thought4.Text = \"Characters\";";
case StateId.NewLink:
return "Community.AddFact(new Link(\nnew List<Thought> { thought3, thought4 }));";
case StateId.NewShare:
return "Community.AddFact(new Share(russell, cloud1));";
}
return string.Empty;
}
}
Expand Down
10 changes: 10 additions & 0 deletions ThoughtCloud.Presentation/ViewModels/IPresentationViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace ThoughtCloud_Presentation.ViewModels
{
public interface IPresentationViewModel
{
bool Backward();
bool Forward();
}
}
2 changes: 1 addition & 1 deletion ThoughtCloud.Presentation/Views/FactsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>

<Canvas x:Name="LayoutRoot" d:DataContext="{d:DesignData /SampleData/FactsViewModelSampleData.xaml}" Background="#05000000" Height="600" Width="800">
<Canvas x:Name="LayoutRoot" d:DataContext="{d:DesignData /SampleData/FactsViewModelSampleData.xaml}" Height="600" Width="800">
<i:Interaction.Behaviors>
<Itzben:BindVisualStateBehavior StateName="{Binding State}"/>
</i:Interaction.Behaviors>
Expand Down

0 comments on commit fc0592b

Please sign in to comment.