Skip to content

Commit e725a31

Browse files
committed
Added more building blocks pages
1 parent 4c44214 commit e725a31

12 files changed

+578
-9
lines changed

samples/MvvmSampleUwp/MvvmSampleUwp/Assets/docs/PuttingThingsTogether.md

Lines changed: 342 additions & 0 deletions
Large diffs are not rendered by default.

samples/MvvmSampleUwp/MvvmSampleUwp/MvvmSampleUwp.csproj

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@
144144
<Compile Include="Views\AsyncRelayCommandPage.xaml.cs">
145145
<DependentUpon>AsyncRelayCommandPage.xaml</DependentUpon>
146146
</Compile>
147+
<Compile Include="Views\BuildingTheUIPage.xaml.cs">
148+
<DependentUpon>BuildingTheUIPage.xaml</DependentUpon>
149+
</Compile>
150+
<Compile Include="Views\SettingsServicePage.xaml.cs">
151+
<DependentUpon>SettingsServicePage.xaml</DependentUpon>
152+
</Compile>
153+
<Compile Include="Views\SettingUpTheViewModelsPage.xaml.cs">
154+
<DependentUpon>SettingUpTheViewModelsPage.xaml</DependentUpon>
155+
</Compile>
156+
<Compile Include="Views\PuttingThingsTogetherPage.xaml.cs">
157+
<DependentUpon>PuttingThingsTogetherPage.xaml</DependentUpon>
158+
</Compile>
147159
<Compile Include="Views\MessengerRequestPage.xaml.cs">
148160
<DependentUpon>MessengerRequestPage.xaml</DependentUpon>
149161
</Compile>
@@ -237,6 +249,22 @@
237249
<Generator>MSBuild:Compile</Generator>
238250
<SubType>Designer</SubType>
239251
</Page>
252+
<Page Include="Views\BuildingTheUIPage.xaml">
253+
<Generator>MSBuild:Compile</Generator>
254+
<SubType>Designer</SubType>
255+
</Page>
256+
<Page Include="Views\SettingsServicePage.xaml">
257+
<Generator>MSBuild:Compile</Generator>
258+
<SubType>Designer</SubType>
259+
</Page>
260+
<Page Include="Views\SettingUpTheViewModelsPage.xaml">
261+
<Generator>MSBuild:Compile</Generator>
262+
<SubType>Designer</SubType>
263+
</Page>
264+
<Page Include="Views\PuttingThingsTogetherPage.xaml">
265+
<Generator>MSBuild:Compile</Generator>
266+
<SubType>Designer</SubType>
267+
</Page>
240268
<Page Include="Views\MessengerRequestPage.xaml">
241269
<Generator>MSBuild:Compile</Generator>
242270
<SubType>Designer</SubType>
@@ -298,7 +326,11 @@
298326
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
299327
</Content>
300328
</ItemGroup>
301-
<ItemGroup />
329+
<ItemGroup>
330+
<Content Include="Assets\docs\PuttingThingsTogether.md">
331+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
332+
</Content>
333+
</ItemGroup>
302334
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
303335
<VisualStudioVersion>14.0</VisualStudioVersion>
304336
</PropertyGroup>

samples/MvvmSampleUwp/MvvmSampleUwp/Shell.xaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
x:Name="NavigationView"
2525
IsTitleBarAutoPaddingEnabled="False"
2626
IsBackEnabled="False"
27+
IsSettingsVisible="False"
2728
ItemInvoked="NavigationView_OnItemInvoked"
2829
BackRequested="NavigationView_OnBackRequested">
2930

@@ -105,19 +106,23 @@
105106
</muxc:NavigationViewItem.MenuItems>
106107
</muxc:NavigationViewItem>
107108
<muxc:NavigationViewItem
109+
x:Name="RedditBrowserOverviewItem"
108110
Content="Putting Things Together"
109111
Icon="Contact"
110-
ToolTipService.ToolTip="Examples of how to put multiple pieces together for building an app."
111-
Tag="SamplePage2"
112-
IsExpanded="True">
112+
ToolTipService.ToolTip="Examples of how to put multiple pieces together for building an app.">
113113
<muxc:NavigationViewItem.MenuItems>
114-
<muxc:NavigationViewItem Content="Creating a ViewModel" Icon="Mail" ToolTipService.ToolTip="Mail" Tag="SamplePage3"/>
115-
<muxc:NavigationViewItem Content="Creating a Service" Icon="Calendar" ToolTipService.ToolTip="Calendar" Tag="SamplePage4">
114+
<muxc:NavigationViewItem
115+
x:Name="ViewModelsSetupItem"
116+
Content="Setting up the ViewModels" Icon="Mail" ToolTipService.ToolTip="Mail"/>
117+
<muxc:NavigationViewItem Content="Creating a Service" Icon="Calendar" ToolTipService.ToolTip="Calendar">
116118
<muxc:NavigationViewItem.MenuItems>
117-
<muxc:NavigationViewItem Content="App Settings" Icon="Mail" ToolTipService.ToolTip="Mail" Tag="SamplePage3"/>
118-
<muxc:NavigationViewItem Content="Navigation" Icon="Calendar" ToolTipService.ToolTip="Calendar" Tag="SamplePage4"/>
119+
<muxc:NavigationViewItem x:Name="SettingsServiceItem" Content="Settings service" Icon="Mail" ToolTipService.ToolTip="Mail" />
120+
<muxc:NavigationViewItem Content="Navigation" Icon="Calendar" ToolTipService.ToolTip="Calendar"/>
119121
</muxc:NavigationViewItem.MenuItems>
120122
</muxc:NavigationViewItem>
123+
<muxc:NavigationViewItem
124+
x:Name="BuildingTheUIItem"
125+
Content="Building the UI" Icon="Mail" ToolTipService.ToolTip="Mail"/>
121126
<muxc:NavigationViewItem x:Name="FinalResultItem" Content="The final result!" Icon="Mail" ToolTipService.ToolTip="Mail"/>
122127
</muxc:NavigationViewItem.MenuItems>
123128
</muxc:NavigationViewItem>

samples/MvvmSampleUwp/MvvmSampleUwp/Shell.xaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ public Shell()
3636
new SampleEntry(SendMessagesItem, typeof(MessengerSendPage), "[IMessenger] Send messages", "messenger messaging message receiver recipient send"),
3737
new SampleEntry(RequestMessagesItem, typeof(MessengerRequestPage), "[IMessenger] Request messages", "messenger messaging message receiver recipient request reply"),
3838
new SampleEntry(InversionOfControlItem, typeof(IocPage), "Ioc (Inversion of control)", "ioc inversion control dependency injection service locator"),
39-
new SampleEntry(FinalResultItem, typeof(RedditBrowserPage), "Reddit browser")
39+
new SampleEntry(RedditBrowserOverviewItem, typeof(PuttingThingsTogetherPage), "Putting things together"),
40+
new SampleEntry(ViewModelsSetupItem, typeof(SettingUpTheViewModelsPage), "Setting up the ViewModels"),
41+
new SampleEntry(SettingsServiceItem, typeof(SettingsServicePage), "Settings service"),
42+
new SampleEntry(BuildingTheUIItem, typeof(BuildingTheUIPage), "Building the UI"),
43+
new SampleEntry(FinalResultItem, typeof(RedditBrowserPage), "Reddit browser")
4044
};
4145

4246
// Set the custom title bar to act as a draggable region
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Page
2+
x:Class="MvvmSampleUwp.Views.BuildingTheUIPage"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls"
8+
xmlns:viewModels="using:MvvmSampleUwp.ViewModels"
9+
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
10+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
11+
mc:Ignorable="d"
12+
NavigationCacheMode="Enabled">
13+
<Page.DataContext>
14+
<viewModels:SamplePageViewModel x:Name="ViewModel"/>
15+
</Page.DataContext>
16+
<interactivity:Interaction.Behaviors>
17+
<core:EventTriggerBehavior EventName="Loaded">
18+
<core:InvokeCommandAction Command="{x:Bind ViewModel.LoadDocsCommand}" CommandParameter="PuttingThingsTogether"/>
19+
</core:EventTriggerBehavior>
20+
</interactivity:Interaction.Behaviors>
21+
22+
<ScrollViewer Padding="16" CanContentRenderOutsideBounds="True">
23+
<StackPanel Spacing="16">
24+
<toolkit:MarkdownTextBlock Text="{x:Bind ViewModel.GetParagraph('Building the UI'), Mode=OneWay}"/>
25+
<toolkit:MarkdownTextBlock Text="{x:Bind ViewModel.GetParagraph('Good to go! 🚀'), Mode=OneWay}"/>
26+
</StackPanel>
27+
</ScrollViewer>
28+
</Page>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Windows.UI.Xaml.Controls;
6+
7+
namespace MvvmSampleUwp.Views
8+
{
9+
/// <summary>
10+
/// An empty page that can be used on its own or navigated to within a Frame.
11+
/// </summary>
12+
public sealed partial class BuildingTheUIPage : Page
13+
{
14+
public BuildingTheUIPage()
15+
{
16+
this.InitializeComponent();
17+
}
18+
}
19+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Page
2+
x:Class="MvvmSampleUwp.Views.PuttingThingsTogetherPage"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls"
8+
xmlns:viewModels="using:MvvmSampleUwp.ViewModels"
9+
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
10+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
11+
mc:Ignorable="d"
12+
NavigationCacheMode="Enabled">
13+
<Page.DataContext>
14+
<viewModels:SamplePageViewModel x:Name="ViewModel"/>
15+
</Page.DataContext>
16+
<interactivity:Interaction.Behaviors>
17+
<core:EventTriggerBehavior EventName="Loaded">
18+
<core:InvokeCommandAction Command="{x:Bind ViewModel.LoadDocsCommand}" CommandParameter="PuttingThingsTogether"/>
19+
</core:EventTriggerBehavior>
20+
</interactivity:Interaction.Behaviors>
21+
22+
<ScrollViewer Padding="16" CanContentRenderOutsideBounds="True">
23+
<StackPanel Spacing="16">
24+
<toolkit:MarkdownTextBlock Text="{x:Bind ViewModel.GetParagraph('Putting things together'), Mode=OneWay}"/>
25+
<toolkit:MarkdownTextBlock Text="{x:Bind ViewModel.GetParagraph('What do we want to build'), Mode=OneWay}"/>
26+
</StackPanel>
27+
</ScrollViewer>
28+
</Page>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Windows.UI.Xaml.Controls;
6+
7+
namespace MvvmSampleUwp.Views
8+
{
9+
/// <summary>
10+
/// An empty page that can be used on its own or navigated to within a Frame.
11+
/// </summary>
12+
public sealed partial class PuttingThingsTogetherPage : Page
13+
{
14+
public PuttingThingsTogetherPage()
15+
{
16+
this.InitializeComponent();
17+
}
18+
}
19+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Page
2+
x:Class="MvvmSampleUwp.Views.SettingUpTheViewModelsPage"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls"
8+
xmlns:viewModels="using:MvvmSampleUwp.ViewModels"
9+
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
10+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
11+
mc:Ignorable="d"
12+
NavigationCacheMode="Enabled">
13+
<Page.DataContext>
14+
<viewModels:SamplePageViewModel x:Name="ViewModel"/>
15+
</Page.DataContext>
16+
<interactivity:Interaction.Behaviors>
17+
<core:EventTriggerBehavior EventName="Loaded">
18+
<core:InvokeCommandAction Command="{x:Bind ViewModel.LoadDocsCommand}" CommandParameter="PuttingThingsTogether"/>
19+
</core:EventTriggerBehavior>
20+
</interactivity:Interaction.Behaviors>
21+
22+
<ScrollViewer Padding="16" CanContentRenderOutsideBounds="True">
23+
<StackPanel Spacing="16">
24+
<toolkit:MarkdownTextBlock Text="{x:Bind ViewModel.GetParagraph('Setting up the viewmodels'), Mode=OneWay}"/>
25+
</StackPanel>
26+
</ScrollViewer>
27+
</Page>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Windows.UI.Xaml.Controls;
6+
7+
namespace MvvmSampleUwp.Views
8+
{
9+
/// <summary>
10+
/// An empty page that can be used on its own or navigated to within a Frame.
11+
/// </summary>
12+
public sealed partial class SettingUpTheViewModelsPage : Page
13+
{
14+
public SettingUpTheViewModelsPage()
15+
{
16+
this.InitializeComponent();
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)