You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
177 lines
5.6 KiB
177 lines
5.6 KiB
<Template originator = "Ivan Shumilin" created = "20/04/2009"> |
|
|
|
<!-- Template Header --> |
|
<TemplateConfiguration> |
|
<Name>Silverlight Application</Name> |
|
<Category>C#</Category> |
|
<Subcategory>Silverlight</Subcategory> |
|
<Icon>C#.Project.Form</Icon> |
|
<Description>Default Silverlight Application</Description> |
|
<SupportedTargetFrameworks>v4.0</SupportedTargetFrameworks> |
|
</TemplateConfiguration> |
|
|
|
<!-- Actions --> |
|
<Actions> |
|
<Open filename = "MainPage.xaml"/> |
|
</Actions> |
|
|
|
<Project language = "C#"> |
|
|
|
<ProjectItems> |
|
<Reference Include="System.Windows" /> |
|
<Reference Include="mscorlib" /> |
|
<Reference Include="system" /> |
|
<Reference Include="System.Core" /> |
|
<Reference Include="System.Net" /> |
|
<Reference Include="System.Xml" /> |
|
<Reference Include="System.Windows.Browser" /> |
|
</ProjectItems> |
|
|
|
<PropertyGroup> |
|
<ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> |
|
<OutputType>Library</OutputType> |
|
<AppDesignerFolder>Properties</AppDesignerFolder> |
|
<RootNamespace>${StandardNamespace}</RootNamespace> |
|
<AssemblyName>${StandardNamespace}</AssemblyName> |
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
|
<SilverlightApplication>true</SilverlightApplication> |
|
<SupportedCultures> |
|
</SupportedCultures> |
|
<XapOutputs>true</XapOutputs> |
|
<GenerateSilverlightManifest>true</GenerateSilverlightManifest> |
|
<XapFilename>${StandardNamespace}.xap</XapFilename> |
|
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate> |
|
<SilverlightAppEntry>${StandardNamespace}.App</SilverlightAppEntry> |
|
<TestPageFileName>TestPage.html</TestPageFileName> |
|
<CreateTestPage>true</CreateTestPage> |
|
<ValidateXaml>true</ValidateXaml> |
|
<UsePlatformExtensions>false</UsePlatformExtensions> |
|
<ThrowErrorsInValidation>true</ThrowErrorsInValidation> |
|
<NoStdLib>true</NoStdLib> |
|
<NoConfig>true</NoConfig> |
|
</PropertyGroup> |
|
|
|
<PropertyGroup configuration="Debug" escapeValue="false"> |
|
<DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants> |
|
</PropertyGroup> |
|
|
|
<PropertyGroup configuration="Release" escapeValue="false"> |
|
<DefineConstants>TRACE;SILVERLIGHT</DefineConstants> |
|
</PropertyGroup> |
|
|
|
<Imports clear="True"> |
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" /> |
|
</Imports> |
|
|
|
<Files> |
|
|
|
<File name="App.xaml" buildAction="ApplicationDefinition" language="XML"><![CDATA[<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
x:Class="${StandardNamespace}.App" |
|
> |
|
<Application.Resources> |
|
|
|
</Application.Resources> |
|
</Application>]]></File> |
|
|
|
<File name="App.xaml.cs" SubType="Code" DependentUpon="App.xaml"><![CDATA[using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Net; |
|
using System.Windows; |
|
using System.Windows.Controls; |
|
using System.Windows.Documents; |
|
using System.Windows.Input; |
|
using System.Windows.Media; |
|
using System.Windows.Media.Animation; |
|
using System.Windows.Shapes; |
|
|
|
namespace ${StandardNamespace} |
|
{ |
|
public partial class App : Application |
|
{ |
|
public App() |
|
{ |
|
this.Startup += this.Application_Startup; |
|
this.Exit += this.Application_Exit; |
|
this.UnhandledException += this.Application_UnhandledException; |
|
|
|
InitializeComponent(); |
|
} |
|
|
|
private void Application_Startup(object sender, StartupEventArgs e) |
|
{ |
|
this.RootVisual = new MainPage(); |
|
} |
|
|
|
private void Application_Exit(object sender, EventArgs e) |
|
{ |
|
|
|
} |
|
|
|
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) |
|
{ |
|
if (!System.Diagnostics.Debugger.IsAttached) { |
|
e.Handled = true; |
|
Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); |
|
} |
|
} |
|
|
|
private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) |
|
{ |
|
try { |
|
string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; |
|
errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); |
|
|
|
System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); |
|
} |
|
catch (Exception) { |
|
} |
|
} |
|
} |
|
}]]></File> |
|
|
|
<File name="MainPage.xaml" buildAction="Page" language="XML"><![CDATA[<UserControl x:Class="${StandardNamespace}.MainPage" |
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
Width="400" Height="300"> |
|
<Grid x:Name="LayoutRoot" Background="White"> |
|
|
|
</Grid> |
|
</UserControl>]]></File> |
|
|
|
<File name="MainPage.xaml.cs" SubType="Code" DependentUpon="MainPage.xaml"><![CDATA[using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Net; |
|
using System.Windows; |
|
using System.Windows.Controls; |
|
using System.Windows.Documents; |
|
using System.Windows.Input; |
|
using System.Windows.Media; |
|
using System.Windows.Media.Animation; |
|
using System.Windows.Shapes; |
|
|
|
namespace ${StandardNamespace} |
|
{ |
|
public partial class MainPage : UserControl |
|
{ |
|
public MainPage() |
|
{ |
|
InitializeComponent(); |
|
} |
|
} |
|
}]]></File> |
|
|
|
<File name="Properties\AppManifest.xml"><![CDATA[<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
> |
|
<Deployment.Parts> |
|
</Deployment.Parts> |
|
</Deployment>]]></File> |
|
|
|
<File name="Properties\AssemblyInfo.cs" src="DefaultAssemblyInfo.cs" /> |
|
|
|
</Files> |
|
</Project> |
|
</Template> |