Browse Source

updated WinFX samples for the WinFX CTP May 2006

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1452 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mathias Simmack 20 years ago
parent
commit
dd9c81719b
  1. 2
      data/templates/file/CSharp/CSharp.WPFFlowDocument.xft
  2. 10
      data/templates/file/CSharp/CSharp.WPFPage.xft
  3. 26
      data/templates/file/CSharp/CSharp.WPFPageFunction.xft
  4. 4
      data/templates/file/CSharp/CSharp.WPFResourceDictionary.xft
  5. 26
      data/templates/file/CSharp/CSharp.WPFUserControl.xft
  6. 18
      data/templates/file/CSharp/CSharp.WPFWindow.xft
  7. 56
      data/templates/project/CSharp/WPFApplication.xpt
  8. 88
      data/templates/project/CSharp/WPFNavigationApplication.xpt

2
data/templates/file/CSharp/CSharp.WPFFlowDocument.xft

@ -21,7 +21,7 @@
${Path} -> Full path of the file ${Path} -> Full path of the file
--> -->
<Files> <Files>
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<FlowDocument xmlns="http://schemas.microsoft.com/winfx/avalon/2005" <File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
ColumnWidth="400" FontSize="14" FontFamily="Georgia" ColumnWidth="400" FontSize="14" FontFamily="Georgia"
> >
<Paragraph> <Paragraph>

10
data/templates/file/CSharp/CSharp.WPFPage.xft

@ -22,8 +22,8 @@
--> -->
<Files> <Files>
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<Page x:Class="${StandardNamespace}.${FileNameWithoutExtension}" <File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<Page x:Class="${StandardNamespace}.${FileNameWithoutExtension}"
xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${FileNameWithoutExtension}" Title="${FileNameWithoutExtension}"
> >
<Grid> <Grid>
@ -31,18 +31,22 @@
</Grid> </Grid>
</Page>]]></File> </Page>]]></File>
<File name="${FullName}.cs" language="C#" dependentUpon="${FileName}" subType="Code"><![CDATA[using System; <File name="${FullName}.cs" language="C#" dependentUpon="${FileName}" subType="Code"><![CDATA[using System;
using System.Collections.Generic;
using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ${StandardNamespace} namespace ${StandardNamespace}
{ {
/// <summary> /// <summary>
/// Interaction logic for ${FileName} /// Interaction logic for ${FullName}
/// </summary> /// </summary>
public partial class ${FileNameWithoutExtension} : Page public partial class ${FileNameWithoutExtension} : Page

26
data/templates/file/CSharp/CSharp.WPFPageFunction.xft

@ -21,25 +21,31 @@
${Path} -> Full path of the file ${Path} -> Full path of the file
--> -->
<Files> <Files>
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<PageFunction x:Class="${StandardNamespace}.${FileNameWithoutExtension}" x:TypeArguments="String" <File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<PageFunction
xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${FileNameWithoutExtension}" xmlns:sys="clr-namespace:System;assembly=mscorlib"
> x:Class="${StandardNamespace}.${FileNameWithoutExtension}"
<Grid> x:TypeArguments="sys:String"
Title="${FileNameWithoutExtension}">
</Grid> <Grid>
</Grid>
</PageFunction>]]></File> </PageFunction>]]></File>
<File name="${FullName}.cs" language="C#" dependentUpon="${FileName}" subType="Code"> <File name="${FullName}.cs" language="C#" dependentUpon="${FileName}" subType="Code"><![CDATA[using System;
<![CDATA[using System; using System.Collections.Generic;
using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ${StandardNamespace} namespace ${StandardNamespace}
{ {
/// <summary> /// <summary>

4
data/templates/file/CSharp/CSharp.WPFResourceDictionary.xft

@ -21,8 +21,8 @@
${Path} -> Full path of the file ${Path} -> Full path of the file
--> -->
<Files> <Files>
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/avalon/2005" <File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> >
</ResourceDictionary>]]></File> </ResourceDictionary>]]></File>

26
data/templates/file/CSharp/CSharp.WPFUserControl.xft

@ -7,9 +7,9 @@
category = "C#" category = "C#"
subcategory = "WinFX" subcategory = "WinFX"
defaultname = "UserControl${Number}.xaml" defaultname = "UserControl${Number}.xaml"
language = "XML"/> language = "C#"/>
<Description>A WinFX User Control</Description> <Description>A WinFX Custom Control</Description>
<!-- <!--
Special new file templates: Special new file templates:
@ -21,22 +21,23 @@
${Path} -> Full path of the file ${Path} -> Full path of the file
--> -->
<Files> <Files>
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<UserControl x:Class="${StandardNamespace}.${FileNameWithoutExtension}" <File name="${FullName}" language="C#"><![CDATA[<UserControl x:Class="${StandardNamespace}.${FileNameWithoutExtension}"
xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
> <Grid>
<UserControl.FixedTemplate>
<Grid>
</Grid> </Grid>
</UserControl.FixedTemplate>
</UserControl>]]></File> </UserControl>]]></File>
<File name="${FullName}.cs" language="C#" dependentUpon="${FileName}" subType="Code"><![CDATA[using System; <File name="${FullName}.cs" language="C#" dependentUpon="${FileName}" subType="Code"><![CDATA[using System;
using System.Collections.Generic;
using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
@ -53,11 +54,6 @@ namespace ${StandardNamespace}
InitializeComponent(); InitializeComponent();
} }
// To use this handler put Loaded="UserControlLoaded" in root element of .xaml file.
// private void UserControlLoaded(object sender, RoutedEventArgs e) {}
// Sample event handler:
// private void ButtonClick(object sender, RoutedEventArgs e) {}
} }
}]]></File> }]]></File>
</Files> </Files>

18
data/templates/file/CSharp/CSharp.WPFWindow.xft

@ -22,22 +22,27 @@
--> -->
<Files> <Files>
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<Window x:Class="${StandardNamespace}.${FileNameWithoutExtension}" <File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<Window x:Class="${StandardNamespace}.${FileNameWithoutExtension}"
xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${StandardNamespace}" Title="${StandardNamespace}" Height="300" Width="300"
> >
<Grid> <Grid>
</Grid> </Grid>
</Window>]]></File> </Window>]]></File>
<File name="${FullName}.cs" language="C#" dependentUpon="${FileName}" subType="Code"><![CDATA[using System; <File name="${FullName}.cs" language="C#" dependentUpon="${FileName}" subType="Code"><![CDATA[using System;
using System.Collections.Generic;
using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ${StandardNamespace} namespace ${StandardNamespace}
{ {
/// <summary> /// <summary>
@ -46,17 +51,12 @@ namespace ${StandardNamespace}
public partial class ${FileNameWithoutExtension} : Window public partial class ${FileNameWithoutExtension} : Window
{ {
public ${FileNameWithoutExtension}() public ${FileNameWithoutExtension}()
{ {
InitializeComponent(); InitializeComponent();
} }
// To use Loaded event put Loaded="WindowLoaded" attribute in root element of .xaml file.
// private void WindowLoaded(object sender, RoutedEventArgs e) {}
// Sample event handler:
// private void ButtonClick(object sender, RoutedEventArgs e) {}
} }
}]]></File> }]]></File>
</Files> </Files>

56
data/templates/project/CSharp/WPFApplication.xpt

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<Template originator = "Mathias Simmack" <Template originator = "Mathias Simmack"
created = "26/10/2005" created = "26/10/2005"
lastModified = "11/01/2006"> lastModified = "02/06/2006">
<!-- Template Header --> <!-- Template Header -->
<TemplateConfiguration> <TemplateConfiguration>
@ -28,17 +28,17 @@
<ProjectItems> <ProjectItems>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Printing"/>
<Reference Include="System.Runtime.Serialization"/>
<Reference Include="System.Security.Authorization"/>
<!-- Reference Include="System.ServiceModel"/ -->
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="ReachFramework" />
<Reference Include="UIAutomationProvider" /> <Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" /> <Reference Include="UIAutomationTypes" />
<Reference Include="ReachFramework" />
<Reference Include="System.Printing" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.IdentityModel" />
</ProjectItems> </ProjectItems>
<Imports> <Imports>
@ -46,16 +46,16 @@
</Imports> </Imports>
<Files> <Files>
<File name="MyApp.xaml" buildAction="ApplicationDefinition" language="XML"><![CDATA[<Application x:Class="${StandardNamespace}.MyApp" <File name="App.xaml" buildAction="ApplicationDefinition" language="XML"><![CDATA[<Application x:Class="${StandardNamespace}.App"
xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="AppStartup" StartupUri="Window1.xaml"
> >
<Application.Resources> <Application.Resources>
</Application.Resources> </Application.Resources>
</Application>]]></File> </Application>]]></File>
<File name="MyApp.xaml.cs" subType="Code" dependentUpon="MyApp.xaml"><![CDATA[using System; <File name="App.xaml.cs" subType="Code" dependentUpon="App.xaml"><![CDATA[using System;
using System.Windows; using System.Windows;
using System.Data; using System.Data;
using System.Xml; using System.Xml;
@ -64,35 +64,38 @@ using System.Configuration;
namespace ${StandardNamespace} namespace ${StandardNamespace}
{ {
/// <summary> /// <summary>
/// Interaction logic for MyApp.xaml /// Interaction logic for App.xaml
/// </summary> /// </summary>
public partial class MyApp : Application public partial class App : Application
{ {
void AppStartup(object sender, StartupEventArgs args) public App()
{ {
Window1 mainWindow = new Window1(); InitializeComponent();
mainWindow.Show();
} }
} }
}]]></File> }]]></File>
<File name="Window1.xaml" buildAction="Page" language="XML"><![CDATA[<Window x:Class="${StandardNamespace}.Window1" <File name="Window1.xaml" buildAction="Page" language="XML"><![CDATA[<Window x:Class="${StandardNamespace}.Window1"
xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Title="${StandardNamespace}" Height="300" Width="300"
> >
<Grid> <Grid>
</Grid> </Grid>
</Window>]]></File> </Window>]]></File>
<File name="Window1.xaml.cs" subType="Code" dependentUpon="Window1.xaml"><![CDATA[using System; <File name="Window1.xaml.cs" subType="Code" dependentUpon="Window1.xaml"><![CDATA[using System;
using System.Collections.Generic;
using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
@ -104,17 +107,12 @@ namespace ${StandardNamespace}
public partial class Window1 : Window public partial class Window1 : Window
{ {
public Window1() public Window1()
{ {
InitializeComponent(); InitializeComponent();
} }
// To use Loaded event put Loaded="WindowLoaded" attribute in root element of .xaml file.
// private void WindowLoaded(object sender, RoutedEventArgs e) {}
// Sample event handler:
// private void ButtonClick(object sender, RoutedEventArgs e) {}
} }
}]]></File> }]]></File>
<File name="AssemblyInfo.cs"><![CDATA[#region Using directives <File name="AssemblyInfo.cs"><![CDATA[#region Using directives
@ -131,12 +129,12 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("${ProjectName}")] [assembly: AssemblyTitle("${StandardNamespace}")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("${USER}")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("${ProjectName}")] [assembly: AssemblyProduct("${StandardNamespace}")]
[assembly: AssemblyCopyright("Copyright @ ${USER} ${DATE}")] [assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

88
data/templates/project/CSharp/WPFNavigationApplication.xpt

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<Template originator = "Mathias Simmack" <Template originator = "Mathias Simmack"
created = "26/10/2005" created = "26/10/2005"
lastModified = "11/01/2006"> lastModified = "02/06/2006">
<!-- Template Header --> <!-- Template Header -->
<TemplateConfiguration> <TemplateConfiguration>
@ -28,17 +28,17 @@
<ProjectItems> <ProjectItems>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Printing"/>
<Reference Include="System.Runtime.Serialization"/>
<Reference Include="System.Security.Authorization"/>
<!-- Reference Include="System.ServiceModel"/ -->
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="ReachFramework" />
<Reference Include="UIAutomationProvider" /> <Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" /> <Reference Include="UIAutomationTypes" />
<Reference Include="ReachFramework" />
<Reference Include="System.Printing" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.IdentityModel" />
</ProjectItems> </ProjectItems>
<Imports> <Imports>
@ -46,55 +46,73 @@
</Imports> </Imports>
<Files> <Files>
<File name="MyApp.xaml" buildAction="ApplicationDefinition" language="XML"><![CDATA[<Application xmlns="http://schemas.microsoft.com/winfx/avalon/2005" <File name="App.xaml" buildAction="ApplicationDefinition" language="XML"><![CDATA[<Application x:Class="${StandardNamespace}.App"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
x:Class="${StandardNamespace}.MyApp" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Page1.xaml"> StartupUri="Page1.xaml"
>
<Application.Resources> <Application.Resources>
</Application.Resources> </Application.Resources>
</Application>]]></File> </Application>]]></File>
<File name="MyApp.xaml.cs" subType="Code" dependentUpon="MyApp.xaml"><![CDATA[using System; <File name="App.xaml.cs" subType="Code" dependentUpon="App.xaml"><![CDATA[using System;
using System.Windows; using System.Windows;
using System.Windows.Navigation;
using System.Data; using System.Data;
using System.Xml; using System.Xml;
using System.Configuration; using System.Configuration;
namespace ${StandardNamespace} namespace ${StandardNamespace}
{ {
/// <summary> /// <summary>
/// Interaction logic for MyApp.xaml /// Interaction logic for App.xaml
/// </summary> /// </summary>
public partial class MyApp : Application public partial class App : Application
{ {
public App()
{
InitializeComponent();
}
} }
}]]></File> }]]></File>
<File name="Page1.xaml" buildAction="Page"><![CDATA[<Page xmlns="http://schemas.microsoft.com/winfx/avalon/2005" <File name="Page1.xaml" language="XML" buildAction="Page"><![CDATA[<Page x:Class="${StandardNamespace}.Page1"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
x:Class="${StandardNamespace}.Page1"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<StackPanel> Title="Page1"
>
</StackPanel> <StackPanel>
</StackPanel>
</Page>]]></File> </Page>]]></File>
<File name="Page1.xaml.cs" subType="Code" dependentUpon="Page1.xaml"><![CDATA[using System; <File name="Page1.xaml.cs" language="C#" dependentUpon="Page1.xaml" subType="Code"><![CDATA[using System;
using System.Collections.Generic;
using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.ComponentModel; using System.Windows.Shapes;
namespace ${StandardNamespace} namespace ${StandardNamespace}
{ {
public partial class Page1 : Page /// <summary>
{ /// Interaction logic for Page1.xaml
public Page1() /// </summary>
{
InitializeComponent(); public partial class Page1 : Page
} {
} public Page1()
{
InitializeComponent();
}
}
}]]></File> }]]></File>
<File name="AssemblyInfo.cs"><![CDATA[#region Using directives <File name="AssemblyInfo.cs"><![CDATA[#region Using directives
@ -110,12 +128,12 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("${ProjectName}")] [assembly: AssemblyTitle("${StandardNamespace}")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("${USER}")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("${ProjectName}")] [assembly: AssemblyProduct("${StandardNamespace}")]
[assembly: AssemblyCopyright("Copyright @ ${USER} ${DATE}")] [assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

Loading…
Cancel
Save