http
Windows Presentation Foundation (WPF).
2. XAML.
XAML,
. :
- XAML
.NET,
.
- XML ,
XAML
.
- .
, XAML
WPF-,
WPF :
<Window
x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Height="350"
Width="525">
<Grid>
</Grid>
</Window> |
: -
Windows. .
MainWindows,
WpfApplication2.
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Windows;
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.Shapes;
namespace
WpfApplication2
{
///
<summary>
///
MainWindow.xaml
///
</summary>
public partial
class MainWindow
: Window
{
public
MainWindow()
{
InitializeComponent();
}
}
} |
Grid - ,
:

, , :

XAML :
<Window
x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Height="350"
Width="525">
<Grid>
<Button
Content="Button"
Height="23"
HorizontalAlignment="Left"
Margin="32,22,0,0"
Name="button1"
VerticalAlignment="Top"
Width="75"
/>
</Grid>
</Window> |
, XAML
:
- Windows ( NavigationWindow,
. ).
- Page.
- Application.
XAML
.
,
, .
XAML xmlns,
. ,
XAML
.
http://schemas.microsoft.com/winfx/2006/xaml/presentation
WPF.
WPF, .
http://schemas.microsoft.com/winfx/2006/xaml
XAML,
, .
URL,
,
, . , ,
XAML
. schemas.microsoft.com
Microsoft,
Microsoft .
: XAML
.NET, .
XAML
.NET.
XAML (Name):
<Window
x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Height="350"
Width="525">
<Grid
Name="myGrid"
Width="150"></Grid>
</Window> |
C#, :
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Windows;
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.Shapes;
namespace
WpfApplication1
{
///
<summary>
///
MainWindow.xaml
///
</summary>
public partial
class MainWindow
: Window
{
public MainWindow()
{
InitializeComponent();
MessageBox.Show("
:
"+myGrid.Width.ToString());
}
}
} |
Grid:

:

:

:
private void
button1_Click(object sender,
RoutedEventArgs e)
{
MessageBox.Show("
:
"
+ myGrid.Width.ToString());
} |
:

|