Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Commit 5cc2d88

Browse files
Add project files.
1 parent bbe8b95 commit 5cc2d88

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1954
-0
lines changed

TabViewTear.sln

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28010.2048
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TabViewTear", "TabViewTear\TabViewTear.csproj", "{BAE65131-3FC5-4042-A0F6-958783E3B7CC}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM = Debug|ARM
11+
Debug|x64 = Debug|x64
12+
Debug|x86 = Debug|x86
13+
Release|ARM = Release|ARM
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|ARM.ActiveCfg = Debug|ARM
19+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|ARM.Build.0 = Debug|ARM
20+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|ARM.Deploy.0 = Debug|ARM
21+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|x64.ActiveCfg = Debug|x64
22+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|x64.Build.0 = Debug|x64
23+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|x64.Deploy.0 = Debug|x64
24+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|x86.ActiveCfg = Debug|x86
25+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|x86.Build.0 = Debug|x86
26+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Debug|x86.Deploy.0 = Debug|x86
27+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|ARM.ActiveCfg = Release|ARM
28+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|ARM.Build.0 = Release|ARM
29+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|ARM.Deploy.0 = Release|ARM
30+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|x64.ActiveCfg = Release|x64
31+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|x64.Build.0 = Release|x64
32+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|x64.Deploy.0 = Release|x64
33+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|x86.ActiveCfg = Release|x86
34+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|x86.Build.0 = Release|x86
35+
{BAE65131-3FC5-4042-A0F6-958783E3B7CC}.Release|x86.Deploy.0 = Release|x86
36+
EndGlobalSection
37+
GlobalSection(SolutionProperties) = preSolution
38+
HideSolutionNode = FALSE
39+
EndGlobalSection
40+
GlobalSection(ExtensibilityGlobals) = postSolution
41+
SolutionGuid = {1C4966DE-414D-4127-942E-7FCF59DDBDC5}
42+
EndGlobalSection
43+
EndGlobal

TabViewTear/.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
end_of_line = crlf
6+
7+
[*.{cs,xaml}]
8+
indent_style = space
9+
indent_size = 4
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
4+
namespace TabViewTear.Activation
5+
{
6+
// For more information on application activation see https://github.com/Microsoft/WindowsTemplateStudio/blob/master/docs/activation.md
7+
internal abstract class ActivationHandler
8+
{
9+
public abstract bool CanHandle(object args);
10+
11+
public abstract Task HandleAsync(object args);
12+
}
13+
14+
internal abstract class ActivationHandler<T> : ActivationHandler
15+
where T : class
16+
{
17+
protected abstract Task HandleInternalAsync(T args);
18+
19+
public override async Task HandleAsync(object args)
20+
{
21+
await HandleInternalAsync(args as T);
22+
}
23+
24+
public override bool CanHandle(object args)
25+
{
26+
return args is T && CanHandleInternal(args as T);
27+
}
28+
29+
protected virtual bool CanHandleInternal(T args)
30+
{
31+
return true;
32+
}
33+
}
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
4+
using TabViewTear.Services;
5+
6+
using Windows.ApplicationModel.Activation;
7+
8+
namespace TabViewTear.Activation
9+
{
10+
internal class DefaultLaunchActivationHandler : ActivationHandler<LaunchActivatedEventArgs>
11+
{
12+
private readonly Type _navElement;
13+
14+
public DefaultLaunchActivationHandler(Type navElement)
15+
{
16+
_navElement = navElement;
17+
}
18+
19+
protected override async Task HandleInternalAsync(LaunchActivatedEventArgs args)
20+
{
21+
// When the navigation stack isn't restored, navigate to the first page and configure
22+
// the new page by passing required information in the navigation parameter
23+
NavigationService.Navigate(_navElement, args.Arguments);
24+
25+
await Task.CompletedTask;
26+
}
27+
28+
protected override bool CanHandleInternal(LaunchActivatedEventArgs args)
29+
{
30+
// None of the ActivationHandlers has handled the app activation
31+
return NavigationService.Frame.Content == null;
32+
}
33+
}
34+
}

TabViewTear/App.xaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Application
2+
x:Class="TabViewTear.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
>
6+
7+
<Application.Resources>
8+
<ResourceDictionary>
9+
<ResourceDictionary.MergedDictionaries>
10+
<ResourceDictionary Source="/Styles/_Colors.xaml"/>
11+
<ResourceDictionary Source="/Styles/_FontSizes.xaml"/>
12+
<ResourceDictionary Source="/Styles/_Thickness.xaml"/>
13+
14+
<ResourceDictionary Source="/Styles/TextBlock.xaml"/>
15+
<ResourceDictionary Source="/Styles/Page.xaml"/>
16+
</ResourceDictionary.MergedDictionaries>
17+
</ResourceDictionary>
18+
</Application.Resources>
19+
</Application>

TabViewTear/App.xaml.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
3+
using TabViewTear.Services;
4+
5+
using Windows.ApplicationModel.Activation;
6+
using Windows.UI.Xaml;
7+
8+
namespace TabViewTear
9+
{
10+
public sealed partial class App : Application
11+
{
12+
private Lazy<ActivationService> _activationService;
13+
14+
private ActivationService ActivationService
15+
{
16+
get { return _activationService.Value; }
17+
}
18+
19+
public App()
20+
{
21+
InitializeComponent();
22+
23+
// Deferred execution until used. Check https://msdn.microsoft.com/library/dd642331(v=vs.110).aspx for further info on Lazy<T> class.
24+
_activationService = new Lazy<ActivationService>(CreateActivationService);
25+
}
26+
27+
protected override async void OnLaunched(LaunchActivatedEventArgs args)
28+
{
29+
if (!args.PrelaunchActivated)
30+
{
31+
await ActivationService.ActivateAsync(args);
32+
}
33+
}
34+
35+
protected override async void OnActivated(IActivatedEventArgs args)
36+
{
37+
await ActivationService.ActivateAsync(args);
38+
}
39+
40+
private ActivationService CreateActivationService()
41+
{
42+
return new ActivationService(this, typeof(Views.MainPage));
43+
}
44+
}
45+
}
Loading
7.52 KB
Loading
Loading
1.61 KB
Loading

0 commit comments

Comments
 (0)