-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
696 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...et-desktop-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/App.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" /> | ||
</startup> | ||
</configuration> |
9 changes: 9 additions & 0 deletions
9
...ktop-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/Application.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Application x:Class="Application" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:ArticleSample" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
6 changes: 6 additions & 0 deletions
6
...p-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/Application.xaml.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Class Application | ||
|
||
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException | ||
' can be handled in this file. | ||
|
||
End Class |
143 changes: 143 additions & 0 deletions
143
...-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/ArticleSample.vbproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{0B03ABFD-67E6-42D0-A556-8DD0C3CB2C2A}</ProjectGuid> | ||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids> | ||
<OutputType>WinExe</OutputType> | ||
<RootNamespace>ArticleSample</RootNamespace> | ||
<AssemblyName>ArticleSample</AssemblyName> | ||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion> | ||
<MyType>Custom</MyType> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<DefineDebug>true</DefineDebug> | ||
<DefineTrace>true</DefineTrace> | ||
<IncrementalBuild>true</IncrementalBuild> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DocumentationFile>ArticleSample.xml</DocumentationFile> | ||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<DebugSymbols>false</DebugSymbols> | ||
<DefineDebug>false</DefineDebug> | ||
<DefineTrace>true</DefineTrace> | ||
<IncrementalBuild>false</IncrementalBuild> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DocumentationFile>ArticleSample.xml</DocumentationFile> | ||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<OptionExplicit>On</OptionExplicit> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<OptionCompare>Binary</OptionCompare> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<OptionStrict>Off</OptionStrict> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<OptionInfer>On</OptionInfer> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Xaml"> | ||
<RequiredTargetFramework>4.0</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="WindowsBase" /> | ||
<Reference Include="PresentationCore" /> | ||
<Reference Include="PresentationFramework" /> | ||
<Reference Include="System.Net.Http" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ApplicationDefinition Include="Application.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
<SubType>Designer</SubType> | ||
</ApplicationDefinition> | ||
<Page Include="EmployeeView.xaml"> | ||
<SubType>Designer</SubType> | ||
<Generator>MSBuild:Compile</Generator> | ||
</Page> | ||
<Page Include="MainWindow.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
<Compile Include="Application.xaml.vb"> | ||
<DependentUpon>Application.xaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<Compile Include="Employee.vb" /> | ||
<Compile Include="EmployeeView.xaml.vb"> | ||
<DependentUpon>EmployeeView.xaml</DependentUpon> | ||
</Compile> | ||
<Compile Include="MainWindow.xaml.vb"> | ||
<DependentUpon>MainWindow.xaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Import Include="System.Threading.Tasks" /> | ||
<Import Include="System.Linq" /> | ||
<Import Include="System.Xml.Linq" /> | ||
<Import Include="Microsoft.VisualBasic" /> | ||
<Import Include="System" /> | ||
<Import Include="System.Collections" /> | ||
<Import Include="System.Collections.Generic" /> | ||
<Import Include="System.Diagnostics" /> | ||
<Import Include="System.Windows" /> | ||
<Import Include="System.Windows.Controls" /> | ||
<Import Include="System.Windows.Data" /> | ||
<Import Include="System.Windows.Documents" /> | ||
<Import Include="System.Windows.Input" /> | ||
<Import Include="System.Windows.Shapes" /> | ||
<Import Include="System.Windows.Media" /> | ||
<Import Include="System.Windows.Media.Imaging" /> | ||
<Import Include="System.Windows.Navigation" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="My Project\AssemblyInfo.vb"> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<Compile Include="My Project\MyExtensions\MyWpfExtension.vb"> | ||
<VBMyExtensionTemplateID>Microsoft.VisualBasic.WPF.MyExtension</VBMyExtensionTemplateID> | ||
<VBMyExtensionTemplateVersion>1.0.0.0</VBMyExtensionTemplateVersion> | ||
</Compile> | ||
<Compile Include="My Project\Resources.Designer.vb"> | ||
<AutoGen>True</AutoGen> | ||
<DesignTime>True</DesignTime> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
<Compile Include="My Project\Settings.Designer.vb"> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Settings.settings</DependentUpon> | ||
<DesignTimeSharedInput>True</DesignTimeSharedInput> | ||
</Compile> | ||
<EmbeddedResource Include="My Project\Resources.resx"> | ||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.vb</LastGenOutput> | ||
<CustomToolNamespace>My.Resources</CustomToolNamespace> | ||
</EmbeddedResource> | ||
<None Include="My Project\Settings.settings"> | ||
<Generator>SettingsSingleFileGenerator</Generator> | ||
<LastGenOutput>Settings.Designer.vb</LastGenOutput> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> | ||
</Project> |
24 changes: 24 additions & 0 deletions
24
...t-desktop-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/Employee.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Imports System.ComponentModel | ||
|
||
Public Class Employee | ||
Implements INotifyPropertyChanged | ||
|
||
Private _salary As Decimal | ||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged | ||
|
||
Public Property FirstName As String | ||
Public Property LastName As String | ||
Public Property Title As String | ||
Public Property HireDate As DateTime | ||
|
||
Public Property Salary As Decimal | ||
Get | ||
Return _salary | ||
End Get | ||
Set(value As Decimal) | ||
_salary = value | ||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(NameOf(Salary))) | ||
End Set | ||
End Property | ||
|
||
End Class |
46 changes: 46 additions & 0 deletions
46
...top-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/EmployeeView.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<Window x:Class="EmployeeView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:ArticleSample" | ||
Title="" Height="250" Width="300"> | ||
<Window.Resources> | ||
<local:Employee x:Key="EmployeeExample" FirstName="Niki" LastName="Demetriou" | ||
HireDate="2022-02-16" Salary="5012.00" | ||
Title="Content Artist" /> | ||
</Window.Resources> | ||
<StackPanel DataContext="{StaticResource EmployeeExample}"> | ||
<Label FontSize="32">Employee</Label> | ||
<Border BorderBrush="Gray" BorderThickness="2" /> | ||
<Grid Grid.Row="1" Margin="5"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition Width="*"/> | ||
</Grid.ColumnDefinitions> | ||
|
||
<TextBlock Text="First Name:" Grid.Row="0" Margin="0,0,10,0" /> | ||
<TextBlock Text="Last Name:" Grid.Row="1" /> | ||
<TextBlock Text="Title:" Grid.Row="2" /> | ||
<TextBlock Text="Hire Date:" Grid.Row="3" /> | ||
<TextBlock Text="Salary" Grid.Row="4" /> | ||
|
||
<TextBlock Text="{Binding FirstName}" Grid.Row="0" Grid.Column="1" /> | ||
<TextBlock Text="{Binding LastName}" Grid.Row="1" Grid.Column="1" /> | ||
<TextBlock Text="{Binding Title}" Grid.Row="2" Grid.Column="1" /> | ||
<TextBlock Text="{Binding HireDate, StringFormat=d}" Grid.Row="3" Grid.Column="1" /> | ||
<TextBlock Text="{Binding Salary, StringFormat=C0}" Grid.Row="4" Grid.Column="1" /> | ||
</Grid> | ||
<Border BorderBrush="Gray" BorderThickness="2" /> | ||
|
||
<StackPanel Margin="5,10" Orientation="Horizontal"> | ||
<TextBlock Text="Change Salary:" Margin="0,0,10,0" /> | ||
<TextBox Text="{Binding Salary, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, StringFormat=C0}" Width="100" /> | ||
</StackPanel> | ||
</StackPanel> | ||
</Window> |
3 changes: 3 additions & 0 deletions
3
...-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/EmployeeView.xaml.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Public Class EmployeeView | ||
|
||
End Class |
12 changes: 12 additions & 0 deletions
12
...sktop-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/MainWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Window x:Class="MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:ArticleSample" | ||
mc:Ignorable="d" | ||
Title="MainWindow" Height="450" Width="800"> | ||
<Grid> | ||
|
||
</Grid> | ||
</Window> |
3 changes: 3 additions & 0 deletions
3
...op-guide/framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/MainWindow.xaml.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Class MainWindow | ||
|
||
End Class |
59 changes: 59 additions & 0 deletions
59
.../framework/wpf/data/snippets/how-to-create-a-simple-binding/vb/My Project/AssemblyInfo.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Imports System | ||
Imports System.Globalization | ||
Imports System.Reflection | ||
Imports System.Resources | ||
Imports System.Runtime.InteropServices | ||
Imports System.Windows | ||
|
||
' General Information about an assembly is controlled through the following | ||
' set of attributes. Change these attribute values to modify the information | ||
' associated with an assembly. | ||
|
||
' Review the values of the assembly attributes | ||
|
||
<Assembly: AssemblyTitle("ArticleSample")> | ||
<Assembly: AssemblyDescription("")> | ||
<Assembly: AssemblyCompany("")> | ||
<Assembly: AssemblyProduct("ArticleSample")> | ||
<Assembly: AssemblyCopyright("Copyright © 2024")> | ||
<Assembly: AssemblyTrademark("")> | ||
<Assembly: ComVisible(false)> | ||
|
||
'In order to begin building localizable applications, set | ||
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file | ||
'inside a <PropertyGroup>. For example, if you are using US english | ||
'in your source files, set the <UICulture> to "en-US". Then uncomment the | ||
'NeutralResourceLanguage attribute below. Update the "en-US" in the line | ||
'below to match the UICulture setting in the project file. | ||
|
||
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)> | ||
|
||
|
||
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found. | ||
'1st parameter: where theme specific resource dictionaries are located | ||
'(used if a resource is not found in the page, | ||
' or application resource dictionaries) | ||
|
||
'2nd parameter: where the generic resource dictionary is located | ||
'(used if a resource is not found in the page, | ||
'app, and any theme specific resource dictionaries) | ||
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)> | ||
|
||
|
||
|
||
'The following GUID is for the ID of the typelib if this project is exposed to COM | ||
<Assembly: Guid("e06c7deb-ecf1-4574-9c93-4d748606cd1a")> | ||
|
||
' Version information for an assembly consists of the following four values: | ||
' | ||
' Major Version | ||
' Minor Version | ||
' Build Number | ||
' Revision | ||
' | ||
' You can specify all the values or you can default the Build and Revision Numbers | ||
' by using the '*' as shown below: | ||
' <Assembly: AssemblyVersion("1.0.*")> | ||
|
||
<Assembly: AssemblyVersion("1.0.0.0")> | ||
<Assembly: AssemblyFileVersion("1.0.0.0")> |
Oops, something went wrong.