Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper AutofacPhoneContainer #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions samples/Caliburn.Micro.Autofac.Samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample-SL4.Web", "Sample-SL
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample-WP7", "Sample-WP7\Sample-WP7.csproj", "{A3DAE49F-FE6D-4F82-AA79-B397BC92519A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsPhoneTestApplication", "WindowsPhoneTestApplication\WindowsPhoneTestApplication.csproj", "{EA3E9ADD-3244-456F-949D-D2B09C125271}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -63,6 +65,20 @@ Global
{A3DAE49F-FE6D-4F82-AA79-B397BC92519A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{A3DAE49F-FE6D-4F82-AA79-B397BC92519A}.Release|Mixed Platforms.Deploy.0 = Release|Any CPU
{A3DAE49F-FE6D-4F82-AA79-B397BC92519A}.Release|x86.ActiveCfg = Release|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Debug|x86.ActiveCfg = Debug|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Release|Any CPU.Build.0 = Release|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Release|Any CPU.Deploy.0 = Release|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Release|Mixed Platforms.Deploy.0 = Release|Any CPU
{EA3E9ADD-3244-456F-949D-D2B09C125271}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 10 additions & 0 deletions samples/WindowsPhoneTestApplication/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Application x:Class="WindowsPhoneTestApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Framework="clr-namespace:WindowsPhoneTestApplication.Framework">

<!--Application Resources-->
<Application.Resources>
<Framework:ApplicationBootstrapper x:Key="Boot1" />
</Application.Resources>
</Application>
47 changes: 47 additions & 0 deletions samples/WindowsPhoneTestApplication/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Проект: WindowsPhoneTestApplication
// Имя файла: App.xaml.cs
// GUID файла: A257A557-D066-4B6F-8336-A2DF7272E408
// Автор: Mike Eshva
// Дата создания: 14.05.2012

using System.Diagnostics;
using System.Windows;


namespace WindowsPhoneTestApplication
{
public partial class App
{
#region Constructors

/// <summary>
/// Constructor for the Application object.
/// </summary>
public App()
{
// Global handler for uncaught exceptions.
UnhandledException += OnUnhandledException;

// Standard Silverlight initialization
InitializeComponent();
}

#endregion

// Code to execute on Unhandled Exceptions

#region Private methods

private void OnUnhandledException
(object aSender, ApplicationUnhandledExceptionEventArgs aEventArgs)
{
if (Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
Debugger.Break();
}
}

#endregion
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Проект: WindowsPhoneTestApplication
// Имя файла: ApplicationBootstrapper.cs
// GUID файла: C16FE24E-6DE4-403E-A522-A273B4478CBF
// Автор: Mike Eshva ([email protected])
// Дата создания: 14.05.2012

using Autofac;
using Caliburn.Micro;
using Caliburn.Micro.Autofac;
using WindowsPhoneTestApplication.Models;


namespace WindowsPhoneTestApplication.Framework
{
/// <summary>
///
/// </summary>
public class ApplicationBootstrapper : AutofacBootstrapper
{
#region Protected interface

protected override void ConfigureContainer(ContainerBuilder aBuilder)
{
aBuilder.RegisterType<DebugLog>().As<ILog>();
// IMPORTANT: Types you plan to store using EntireGraph<T>().InPhoneState()
// must be registered within the container.
aBuilder.RegisterType<MainModel>().AsSelf();
}



#endregion
}
}
Loading