Skip to content

Commit 754f458

Browse files
committed
gggggg
1 parent eb895e0 commit 754f458

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

docs/document/Avalonia/docs/1. Fundamentals/2. Xml namespace.md renamed to docs/document/Avalonia/docs/1. Fundamentals/2. XAML Essentials.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Xml namespace
1+
# XAML Essentials
22

33
## Importing a namespace
44

55
The semantic of `xmlns:x` basically means importing a namespace as an alias named `x`.
66
Then we can use `:` to access the members of the namespace.
77
`x:Class` binds the code behind(`.axaml.cs`) the AXAML(not the ViewModel!).
88

9-
```xml{2,3}
9+
```xml
1010
<Application xmlns="https://github.com/avaloniaui"
1111
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
1212
x:Class="AvaloniaApplication.App"
@@ -16,13 +16,13 @@ Then we can use `:` to access the members of the namespace.
1616
</Application>
1717
```
1818

19-
## Default xml namespace
19+
## Spreading Namespace
2020

21-
The default namespace is imported without name, which mean its members are imported globally in this AXAML file, we can access them without any prefix.
21+
The default namespace is imported without name, which mean its members are imported globally in this AXAML file, can be accessed them without any prefix.
2222
Generally the default is avalonia namespace which contains built-in components like `Button`, `TextBlock`.
2323

24-
```xml{1}
25-
<Application xmlns="https://github.com/avaloniaui"
24+
```xml
25+
<Application xmlns="https://github.com/avaloniaui" <!-- [!code highlight] -->
2626
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2727
x:Class="AvaloniaApplication.App"
2828
xmlns:local="using:AvaloniaApplication"
@@ -31,20 +31,20 @@ Generally the default is avalonia namespace which contains built-in components l
3131
</Application>
3232
```
3333

34-
## Project namespace
34+
## Import from Project Namespace
3535

36-
`using:AvaloniaApplication` imports the namespace from **specific project**, so `local:` is available to access the types from the project.
36+
`using:<namespace>` imports the namespace from **specific project** with the alias name `local`
3737

38-
```xml{4,8-10}
38+
```xml
3939
<Application xmlns="https://github.com/avaloniaui"
4040
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4141
x:Class="AvaloniaApplication.App"
42-
xmlns:local="using:AvaloniaApplication"
42+
xmlns:local="using:AvaloniaApplication" <!-- [!code highlight] -->
4343
RequestedThemeVariant="Default">
4444
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
4545

4646
<Application.DataTemplates>
47-
<local:ViewLocator/>
47+
<local:ViewLocator/> <!-- use `local` here to access types from it --> <!-- [!code highlight] -->
4848
</Application.DataTemplates>
4949
</Application>
5050
```

docs/document/Avalonia/docs/1. Fundamentals/3. MVVM Essentials.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
# MVVM Essentials
22

33
```mermaid
44
graph TD;

0 commit comments

Comments
 (0)