..
:
2. WPF.
: WPF.
: WPF VS 2013 C#.
: 4 .
VS 2013 C#
WPF, byadmin.
WPF (WindowsPresentationFoundation), WPF.
, . -, , Delphi , , , . . WPF.
, , WPF. , MSDN:
WindowsPresentationFoundation (WPF) ― Windows . C WPF , , -. WPF , . WPF , ExtensibleApplicationMarkupLanguage (XAML), , , , 2-D- 3-D-, , , , , , . WPF Microsoft.NET Framework , .NET Framework. WPF Windows.
.
ExtensibleApplicationMarkupLanguage (XAML) .
( ).
, , , ( , , ..) XAML. , , , .. , , , C#.
|
|
, , . , XAML , , . , XAML , .NET , , .
, , WPF -. , , XAML, , . WPF , .
, Hello, World. VisualStudio, WPF, HelloWPF:
. , WindowsForms :
1.
2. XAML
. ( *.xaml) , *.cs.
1 MainWindow Grid .
, . -. , . Title Window, , HelloWPF. , :
, , , , , .. . . .
. , , , HelloWorld!.
(ToolBox), Button . XAML ( Width Height) ( Margin).
, , , . , .
button Name. HelloButton. . , , , . Content, .
|
|
, XAML (Grid), , MasterGrid:
, .
Click . Button , . :
privatevoid HelloButton_Click(object sender, RoutedEventArgs e) { TextBlocktb=newTextBlock(); // tb.Text=Hello World!; // // Thicknessmrgn=newThickness(0, 0, 0, 0); tb.Margin=mrgn; // MasterGrid.Children.Add(tb); } |
, , . , TextBlock, , , XAML, , TextBlock Children.
, WPF runtime. TextBlock .
, , . -, , .
<Window x:Class="WpfApplication3.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="MasterGrid" >
<Button Content="Button"HorizontalAlignment="Left"VerticalAlignment="Top" Width="75" Margin="127,142,0,0"
Name="HelloBeby" Click="HelloBeby_Click"/>
<Ellipse Fill="#FFF4F4F5"HorizontalAlignment="Left" Height="100" Margin="286,100,0,0" Stroke="Black"VerticalAlignment="Top" Width="140"/>
<ProgressBarHorizontalAlignment="Left" Height="92"VerticalAlignment="Top" Width="158" Margin="286,142,0,0"/>
<Rectangle Fill="#FFF4F4F5"HorizontalAlignment="Left" Height="70" Margin="38,10,0,0" Stroke="Black"VerticalAlignment="Top" Width="119"RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="7.239"/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<Line X1="10" Y1="10" X2="50" Y2="50" Stroke="Black"StrokeThickness="4" Margin="178,-97,-121,150"RenderTransformOrigin="0.5,0.5" >
<Line.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-33.135"/>
<TranslateTransform/>
</TransformGroup>
</Line.RenderTransform>
</Line>
</Grid>
</Window>
:
-
-
-
- , .
- .
, (. ) , ! 5 , , , , , . 2 .docx
|
|