diff --git a/.gitignore b/.gitignore
index 9517ddcab..24ce72c3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@
# Generated files
.docusaurus
.cache-loader
+.idea
# Misc
.DS_Store
diff --git a/docs/basics/data/data-binding/compiled-bindings.md b/docs/basics/data/data-binding/compiled-bindings.md
index 70d11c881..8a3288668 100644
--- a/docs/basics/data/data-binding/compiled-bindings.md
+++ b/docs/basics/data/data-binding/compiled-bindings.md
@@ -11,9 +11,25 @@ Bindings defined in the XAML are using reflection in order to find and access th
## Enable and disable compiled bindings
+:::info
+
+Depending on the template that was used to create the Avalonia project, compiled bindings may or may not be enabled by default. You can check this in the project file.
+
+:::
+
+### Enable and disable globally
+
+If you want your application to use compiled bindings globally by default, you can add
+
+```markup
+true
+```
+
+to your project file. You will still need to provide `x:DataType` for the objects you want to bind but you don't need to to set `x:CompileBindings="[True|False]"` for each `UserControl` or `Window`.
+
### Enable and disable per UserControl or Window
-Compiled bindings are not enabled by default. To enable compiled bindings, you will need to define the `DataType` of the object you want to bind to first. In [`DataTemplates`](../data-templates) there is a property `DataType`, for all other elements you can set it via `x:DataType`. Most likely you will set `x:DataType` in your root node, for example in a `Window` or an `UserControl`. You can also specify the `DataType` in the `Binding` directly.
+To enable compiled bindings, you will need to define the `DataType` of the object you want to bind to first. In [`DataTemplates`](../data-templates) there is a property `DataType`, for all other elements you can set it via `x:DataType`. Most likely you will set `x:DataType` in your root node, for example in a `Window` or an `UserControl`. You can also specify the `DataType` in the `Binding` directly.
You can now enable or disable compiled bindings by setting `x:CompileBindings="[True|False]"`. All child nodes will inherit this property, so you can enable it in your root node and disable it for a specific child, if needed.
@@ -39,16 +55,6 @@ You can now enable or disable compiled bindings by setting `x:CompileBindings="[
```
-### Enable and disable globally
-
-If you want your application to use compiled bindings globally by default, you can add
-
-```markup
-true
-```
-
-to your project file. You will still need to provide `x:DataType` for the objects you want to bind but you don't need to to set `x:CompileBindings="[True|False]"` for each `UserControl` or `Window`.
-
## CompiledBinding-Markup
If you don't want to enable compiled bindings for all child nodes, you can also use the `CompiledBinding`-markup. You still need to define the `DataType`, but you can omit `x:CompileBindings="True"`.
diff --git a/docs/basics/data/data-binding/data-binding-syntax.md b/docs/basics/data/data-binding/data-binding-syntax.md
index 3bc74100b..d5c94c0d0 100644
--- a/docs/basics/data/data-binding/data-binding-syntax.md
+++ b/docs/basics/data/data-binding/data-binding-syntax.md
@@ -2,6 +2,8 @@
description: CONCEPTS
---
+import DataBindingModeDiagram from '/img/gitbook-import/assets/image (2).png';
+
# Data Binding Syntax
In Avalonia, you can define data binding in XAML or code. To define data binding in XAML, you use the data binding mark-up extension, and this has its own syntax which is described here.
@@ -56,7 +58,7 @@ You can change how data is moved in a data binding by specifying the data bindin
-
+
For example:
diff --git a/docs/basics/data/data-binding/data-context.md b/docs/basics/data/data-binding/data-context.md
index 81daecd78..4af505a7a 100644
--- a/docs/basics/data/data-binding/data-context.md
+++ b/docs/basics/data/data-binding/data-context.md
@@ -2,17 +2,22 @@
description: CONCEPTS
---
+import DataContextBindingOverviewDiagram from '/img/gitbook-import/assets/image (56).png';
+import DataContextTreeSearchDiagram from '/img/gitbook-import/assets/image (62).png';
+import DataContextContentBindingScreenshot from '/img/gitbook-import/assets/image (20) (2).png';
+import DataContextPreviewerScreenshot from '/img/gitbook-import/assets/image (40) (1).png'
+
# Data Context
When Avalonia performs data binding, it has to locate an application object to bind to. This location is represented by a **Data Context**.
-
+
Every control in Avalonia has a property called `DataContext`, and this includes built-in controls, user controls and windows.
When binding, Avalonia performs a hierarchical search of the logical control tree, starting with the control where the binding is defined, until it finds a data context to use.
-
+
This means that a control defined in a window can use the data context of the window; or (as above) a control in a control in a window can use the window's data context.
@@ -72,13 +77,13 @@ In the main window file **MainWindow.axaml** you can see that the window content
When the project runs, the data binder searches up the logical control tree from the text block and finds a data context set at the main window level. So the bound text appears as:
-
+
## Design Data Context
You may have noticed, after you first compiled this project, that the preview pane also shows the greeting.
-
+
This is because Avalonia can also set a data context for a control for use at design-time. You will find this useful because it means that the preview pane can show some realistic data while you adjust layout and styles.
diff --git a/docs/basics/data/data-binding/index.md b/docs/basics/data/data-binding/index.md
index cfbd7c7ba..13d919976 100644
--- a/docs/basics/data/data-binding/index.md
+++ b/docs/basics/data/data-binding/index.md
@@ -2,11 +2,13 @@
description: CONCEPTS
---
+import DataBindingBasicOverviewDiagram from '/img/gitbook-import/assets/image (31) (1).png';
+
# Data Binding
Avalonia uses data binding to move data from application objects into UI controls, change the data in application objects in response to user input, and initiate actions on the application objects in response to commands from the user.
-
+
In this arrangement, the control is the **binding target**, and the object is the **data source**.
diff --git a/docs/basics/data/data-templates.md b/docs/basics/data/data-templates.md
index 20197ae05..0871748e7 100644
--- a/docs/basics/data/data-templates.md
+++ b/docs/basics/data/data-templates.md
@@ -25,7 +25,7 @@ For instance, if you have a `ListBox` that should display a collection of `Item`
-
+
```
In this example, the Data Template defines a visual layout using a `StackPanel` container. Within the `StackPanel`, we have a `TextBlock` bound to the `Name` property of the item and an `Image` control bound to the `ImageSource` property.
@@ -36,4 +36,4 @@ Data Templates can be customized and tailored to specific scenarios. You can inc
## Further Reading
-For more information see the Deep Dive into to [data templates](../../concepts/templates).
\ No newline at end of file
+For more information see the Deep Dive into to [data templates](../../concepts/templates).
diff --git a/docs/basics/user-interface/animations.md b/docs/basics/user-interface/animations.md
index de0d8ac08..817852491 100644
--- a/docs/basics/user-interface/animations.md
+++ b/docs/basics/user-interface/animations.md
@@ -3,6 +3,8 @@ id: animations
title: Animations
---
+import AnimationKeyframeDiagram from '/img/gitbook-import/assets/image (2) (1) (4).png';
+
# Animations
There are two types of animations in _Avalonia UI_:
@@ -14,7 +16,7 @@ There are two types of animations in _Avalonia UI_:
The simplest keyframe animation will change one property value over a a specified duration by defining two keyframes with cue points at the start (0% of the duration) and the end (100% of the duration).
-
+
The property value is then changed over time between the keyframes using the profile defined by an easing function. The default easing function is also the simplest - a straight-line interpolation between two keyframes.
diff --git a/docs/basics/user-interface/assets.md b/docs/basics/user-interface/assets.md
index 39cdbcc2b..5c838f8db 100644
--- a/docs/basics/user-interface/assets.md
+++ b/docs/basics/user-interface/assets.md
@@ -3,13 +3,16 @@ id: assets
title: Assets and Images
---
+import AssetIncludeFileAssetDiagram from '/img/gitbook-import/assets/image (8).png';
+import AssetIncludeLibraryAssetDiagram from '/img/gitbook-import/assets/image.png';
+
# Assets
Many applications need to include assets such as bitmaps, styles and resource dictionaries. Resource dictionaries contain graphical fundamentals that can be declared in XAML. Styles can also be written in XAML, but bitmap assets are binary files, for example PNG and JPEG formats.
## Including assets
-
+
You include assets in an application by using the `` element in your project file.
@@ -46,7 +49,7 @@ As an alternative, you can use the rooted path:
## Library Assets
-
+
If the asset is included in a different assembly from the XAML file, then you use the `avares:` URI scheme. For example, if the asset is contained in an assembly called `MyAssembly.dll` in a `Assets` folder, then you use:
diff --git a/docs/basics/user-interface/building-layouts/alignment-margins-and-padding.md b/docs/basics/user-interface/building-layouts/alignment-margins-and-padding.md
index 8bf15b276..d9c86682a 100644
--- a/docs/basics/user-interface/building-layouts/alignment-margins-and-padding.md
+++ b/docs/basics/user-interface/building-layouts/alignment-margins-and-padding.md
@@ -1,3 +1,9 @@
+import LayoutMarginsPaddingAlignmentBasicScreenshot from '/img/gitbook-import/assets/layout-margins-padding-alignment-graphic1.png';
+import LayoutMarginsPaddingAlignmentBasicAnnotatedScreenshot from '/img/gitbook-import/assets/layout-margins-padding-alignment-graphic2.png';
+import LayoutHorizontalAlignmentScreenshot from '/img/gitbook-import/assets/layout-horizontal-alignment-graphic.png';
+import LayoutVerticalAlignmentScreenshot from '/img/gitbook-import/assets/layout-vertical-alignment-graphic.png';
+import LayoutMarginsPaddingAlignmentComplexAnnotatedScreenshot from '/img/gitbook-import/assets/layout-margins-padding-aligment-graphic3.png';
+
# Alignment, Margins and Padding
An Avalonia control exposes several properties that are used to precisely position child elements. This topic discusses four of the most important properties: `HorizontalAlignment`, `Margin`, `Padding`, and `VerticalAlignment`. The effects of these properties are important to understand, because they provide the basis for controlling the position of elements in Avalonia applications.
@@ -8,7 +14,7 @@ There are numerous ways to position elements using Avalonia. However, achieving
The following illustration shows a layout scenario that utilizes several positioning properties.
-
+
At first glance, the `Button` elements in this illustration may appear to be placed randomly. However, their positions are actually precisely controlled by using a combination of margins, alignments, and padding.
@@ -42,7 +48,7 @@ The following example describes how to create the layout in the preceding illust
The following diagram provides a close-up view of the various positioning properties that are used in the preceding sample. Subsequent sections in this topic describe in greater detail how to use each positioning property.
-
+
### Understanding Alignment Properties
@@ -72,7 +78,7 @@ The following example shows how to apply the `HorizontalAlignment` property to `
The preceding code yields a layout similar to the following image. The positioning effects of each `HorizontalAlignment` value are visible in the illustration.
-
+
#### VerticalAlignment Property
@@ -112,7 +118,7 @@ The following example shows how to apply the `VerticalAlignment` property to `Bu
The preceding code yields a layout similar to the following image. The positioning effects of each `VerticalAlignment` value are visible in the illustration.
-
+
### Understanding Margin Properties
@@ -220,5 +226,5 @@ The following example demonstrates each of the concepts that are detailed in thi
When compiled, the preceding application yields a UI that looks like the following illustration. The effects of the various property values are evident in the spacing between elements, and significant property values for elements in each column are shown within `TextBlock` elements.
-
+
diff --git a/docs/basics/user-interface/building-layouts/panels-overview.md b/docs/basics/user-interface/building-layouts/panels-overview.md
index 29ba58aac..6cb895d1e 100644
--- a/docs/basics/user-interface/building-layouts/panels-overview.md
+++ b/docs/basics/user-interface/building-layouts/panels-overview.md
@@ -1,6 +1,13 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import CanvasOverlapScreenshot from '/img/basics/user-interface/building-layouts/panels-overview/CanvasExample.png';
+import DockPanelSampleScreenshot from '/img/basics/user-interface/building-layouts/panels-overview/DockPanelExample.png';
+import GridSampleScreenshot from '/img/basics/user-interface/building-layouts/panels-overview/GridExample.png';
+import StackPanelSampleScreenshot from '/img/basics/user-interface/building-layouts/panels-overview/StackPanelExample.png';
+import WrapPanelSampleScreenshot from '/img/basics/user-interface/building-layouts/panels-overview/WrapPanelExample.png';
+import UniformGridSampleScreenshot from '/img/basics/user-interface/building-layouts/panels-overview/UniformGridExample.png';
+
# Panels Overview
`Panel` elements are components that control the rendering of elements - their size and dimensions, their position, and the arrangement of their child content. _Avalonia UI_ provides a number of predefined `Panel` elements as well as the ability to construct custom `Panel` elements.
@@ -41,9 +48,7 @@ The `Canvas` element enables positioning of content according to absolute _x-_ a
A `Canvas` can be instantiated simply by using XAML or code. The following example demonstrates how to use `Canvas` to absolutely position content. This code produces three 100-pixel squares. The first square is red, and its top-left (_x, y_) position is specified as (0, 0). The second square is green, and its top-left position is (100, 100), just below and to the right of the first square. The third square is blue, and its top-left position is (50, 50), thus encompassing the lower-right quadrant of the first square and the upper-left quadrant of the second. Because the third square is laid out last, it appears to be on top of the other two squares—that is, the overlapping portions assume the color of the third box.
-
-
-
+
-
-
+
-
-
+
-
-
+
-
-
+
-
-
+
The code-behind file contains a class that shares the same name as the XAML file. For example:
diff --git a/docs/basics/user-interface/controls/builtin-controls.md b/docs/basics/user-interface/controls/builtin-controls.md
index 033820c96..03ae21912 100644
--- a/docs/basics/user-interface/controls/builtin-controls.md
+++ b/docs/basics/user-interface/controls/builtin-controls.md
@@ -1,6 +1,6 @@
# Built-in Controls
-Here are some of the more commonly-used Avalonia controls, organised by catagory:
+Here are some of the more commonly-used Avalonia controls, organised by category:
## Layout controls
@@ -28,7 +28,7 @@ Here are some of the more commonly-used Avalonia controls, organised by catagory
|[Button](../../../reference/controls/buttons/button.md)|The basic button control - can display text, an icon or both. Has standard 'click' behavior.|
|[Repeat Button](../../../reference/controls/buttons/repeatbutton.md)|A button that raises its click event repeatedly when it is pressed and held.|
|[Radio Button](../../../reference/controls/buttons/radiobutton.md)|A button that has a selected state. It can be placed in a group so that selection of one button deselects all the others in the group.|
-|[Toggle Button](../../../reference/controls/buttons/togglesplitbutton.md)|A button that has a selected state and a unselected state. Subsequent clicks 'toggle' this state. A 'checked' pseudo class allows different styles to be allocated to the selected and unselected states.|
+|[Toggle Button](../../../reference/controls/buttons/togglebutton.md)|A button that has a selected state and a unselected state. Subsequent clicks 'toggle' this state. A 'checked' pseudo class allows different styles to be allocated to the selected and unselected states.|
|[Button Spinner](../../../reference/controls/buttons/buttonspinner.md)|A control with two spin buttons and a content zone.|
|[Split Button](../../../reference/controls/buttons/splitbutton.md)|This functions as a button with primary and secondary parts that can be pressed independently. The primary part behaves like standard button, and the secondary part opens a flyout with additional actions.|
|[Toggle Split Button](../../../reference/controls/buttons/togglesplitbutton.md)|This functions as a button with primary and secondary parts that can be pressed independently. The primary part behaves like toggle button, and the secondary part opens a flyout with additional actions.|
@@ -62,6 +62,7 @@ These controls display repeating data, in either a tabular or list format:
|[Slider](../../../reference/controls/slider.md)|Double|Relative value compared to a maximum and minimum value presented as the position along the length of the slider track of the slider button. Drag interaction on the slider button can alter the value between the maximum and minimum values. Keyboard and click interactions can also nudge the value.|
|[Calendar](../../../reference/controls/detailed-reference/calendar)|DateTime|The calendar is a control for users to select dates or date ranges.|
|[Calendar Date Picker](../../../reference/controls/detailed-reference/calendar/calendar-date-picker.md)|DateTime|An extension of the calendar control that includes a text box and button.|
+|[Color Picker](../../../reference/controls/colorpicker)|Color / HsvColor|The color picker supports user-selection and editing of colors using a spectrum, palette and component sliders. It also supports an optional alpha component, RGB or HSV color models and hexadecimal color values.|
|[Date Picker](../../../reference/controls/datepicker.md)|DateTime|The date picker has three 'spinner' controls to allow the user to pick a date value.|
|[Time Picker](../../../reference/controls/detailed-reference/timepicker.md)|TimeSpan|The time picker has three 'spinner' controls to allow the user to pick a time from hours, minutes and seconds.|
diff --git a/docs/basics/user-interface/styling/control-themes.md b/docs/basics/user-interface/styling/control-themes.md
index f4bbe3935..34d893a3e 100644
--- a/docs/basics/user-interface/styling/control-themes.md
+++ b/docs/basics/user-interface/styling/control-themes.md
@@ -3,6 +3,8 @@ id: control-themes
title: Control Themes
---
+import StylingEllipseButtonScreenshot from '/img/basics/user-interface/styling/ellipse-button.png';
+
Control themes build upon [Styles](styles) to create switchable themes for controls. Control themes are analogous to Styles in WPF/UWP, though their mechanism is slightly different.
:::tip
@@ -75,7 +77,7 @@ The following example shows a simple `Button` theme which displays a button with
```
-![Ellipe Button](/img/basics/user-interface/styling/ellipse-button.png)
+
## Interaction in Control Themes
diff --git a/docs/basics/user-interface/styling/styles.md b/docs/basics/user-interface/styling/styles.md
index 72a38239e..5e68d39ae 100644
--- a/docs/basics/user-interface/styling/styles.md
+++ b/docs/basics/user-interface/styling/styles.md
@@ -3,6 +3,8 @@ id: styles
title: Styles
---
+import StyleH1SampleScreenshot from '/img/gitbook-import/assets/image (5) (5).png';
+
# Styles
The _Avalonia UI_ style system is a mechanism that can share property settings between controls.
@@ -58,7 +60,7 @@ This is an example of how a style is written and applied to a control element, w
In this example, all `TextBlock` elements with the `h1` style class will be displayed with the font size and weight set by the style. This works in the preview pane:
-
+
## Where to put Styles
diff --git a/docs/basics/user-interface/styling/themes/fluent.md b/docs/basics/user-interface/styling/themes/fluent.md
index de20c0429..467c65d3a 100644
--- a/docs/basics/user-interface/styling/themes/fluent.md
+++ b/docs/basics/user-interface/styling/themes/fluent.md
@@ -3,11 +3,14 @@ id: fluent
title: Fluent Theme
---
+import FluentThemeNormalScreenshot from '/img/basics/user-interface/styling/fluent-theme-normal.png';
+import FluentThemeForestScreenshot from '/img/basics/user-interface/styling/fluent-theme-forest.png';
+
## Introduction
Avalonia Fluent theme is inspired by Microsoft's Fluent Design System, which is a set of design guidelines and components for creating visually appealing and interactive user interfaces. The Fluent Design System emphasizes modern, clean aesthetics, smooth animations, and intuitive interactions. It provides a consistent and polished look-and-feel across different platforms, while giving developers flexibility with our styling system.
-![Fluent Theme](/img/basics/user-interface/styling/fluent-theme-normal.png)
+
## How to use
@@ -102,4 +105,4 @@ It is available on page and supports following featur
6. Couple of quick start presets.
Example of FluentTheme with a Forest palette preset available on the web app:
-![Fluent Theme Forest Palette](/img/basics/user-interface/styling/fluent-theme-forest.png)
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/community.md b/docs/community.md
index 45728fe80..79a32e229 100644
--- a/docs/community.md
+++ b/docs/community.md
@@ -1,8 +1,14 @@
# Community Support
+import TelegramLogoScreenshot from '/img/gitbook-import/assets/image (7) (1) (1).png';
+import GitterLogoScreenshot from '/img/gitbook-import/assets/image (38) (1) (1).png';
+import GitterChatScreenshot from '/img/gitbook-import/assets/image (37) (1) (1).png';
+
## Telegram
-You can also access the Avalonia chat using the _Telegram_ app (recommended for the best experience).
+
+
+Access the Avalonia chat using the _Telegram_ app (recommended for the best experience).
:::info
You can access the _Telegram_ chat [here](https://t.me/Avalonia).
@@ -10,15 +16,14 @@ You can access the _Telegram_ chat [here](https://t.me/Avalonia).
## Gitter
-
+
We run a chat in English on the Gitter platform.
-
+
:::info
Access the chat in your browser using Gitter [here](https://gitter.im/AvaloniaUI/Avalonia).
:::
-
diff --git a/docs/concepts/attached-property.md b/docs/concepts/attached-property.md
index 2647e436d..c43d16e43 100644
--- a/docs/concepts/attached-property.md
+++ b/docs/concepts/attached-property.md
@@ -2,11 +2,14 @@
description: CONCEPTS
---
+import AttachedControlDiagram from '/img/gitbook-import/assets/image (9).png';
+import AttachedLayoutPropertyDiagram from '/img/gitbook-import/assets/image (17).png';
+
# Attached Properties
-_Avalonia UI_ controls support the **attached property** concept. This is a property applied to a child control that references its container control.
+_Avalonia UI_ controls support the **attached property** concept. This is a property applied to a child control that references its container control.
-In XMAL attached properties are defined as attributes of the child control element, using the format: `ContainerClassName.AttachedPropertyName="value"`
+In XAML, attached properties are defined as attributes of the child control element using the format: `ContainerClassName.AttachedPropertyName="value"`
Here are some scenarios where an attached property is used:
@@ -14,13 +17,13 @@ Here are some scenarios where an attached property is used:
An additional control is attached to a 'host control' for some purpose. This can be used where the control usually only allows a single child in its content zone. In this scenario the attached control is not counted as part of the content, but it will be used in some other way by the container. Examples include: context menus, tool tips and flyouts.
-
+
## Layout Control
Attached layout properties are used in scenarios where the container control has to know something about the child controls it is going to arrange. Examples include: grids, dock panels and relative panels.
-
+
:::info
For a full list of the _Avalonia UI_ built-in controls, see the reference [here](../reference/controls/).
diff --git a/docs/concepts/control-trees.md b/docs/concepts/control-trees.md
index 20218dfbe..24912cd87 100644
--- a/docs/concepts/control-trees.md
+++ b/docs/concepts/control-trees.md
@@ -2,6 +2,10 @@
description: CONCEPTS
---
+import ControlTreesLogicalScreenshot from '/img/gitbook-import/assets/image (61).png';
+import ControlTreesVisualScreenshot from '/img/gitbook-import/assets/image (15) (2).png';
+import ControlTreesEventScreenshot from '/img/gitbook-import/assets/image (1) (1) (2).png';
+
# Control Trees
_Avalonia UI_ creates control trees from the XAML files in an application so that it can render the UI presentation and manage the application functionality.
@@ -10,7 +14,7 @@ _Avalonia UI_ creates control trees from the XAML files in an application so tha
The logical control tree represents the application controls (including the main window) in the hierarchy in which they are defined in the XAML. For example: and control (button) inside another control (stack panel) in a window will have the 3-layer logical tree shown here:
-
+
While your application is running, you can show the _Avalonia Dev Tools_ window (hit F12). This displays the logical tree on its **Logical Tree** tab.
@@ -18,7 +22,7 @@ While your application is running, you can show the _Avalonia Dev Tools_ window
The visual control tree contains everything that is actually being run by _Avalonia UI_. It shows all the properties set on the controls, and all the additional parts that have been added by _Avalonia UI_ in order to present the UI and manage the application functionality.
-
+
You can see the visual control tree on the **Visual Tree** tab of the _Avalonia Dev Tools_ window.
@@ -26,4 +30,4 @@ You can see the visual control tree on the **Visual Tree** tab of the _Avalonia
An essential part of application functionality management performed by _Avalonia UI_, is the generation and propagation of events. The **Events** tab logs the source and propagation of events as you move around, and otherwise interact with the running application.
-
+
diff --git a/docs/concepts/input/pointer.md b/docs/concepts/input/pointer.md
index 4d2d240f7..13df52a53 100644
--- a/docs/concepts/input/pointer.md
+++ b/docs/concepts/input/pointer.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Input
---
+import PointerPressedSampleScreenshot from '/img/gitbook-import/assets/pressed.gif';
+
# Mouse and Pointer Devices
In _Avalonia UI_ you implement the interaction of pointing devices with your application using a 'pointer' abstraction. This can represent devices including, but not limited to a mouse, touchpad, and pen. _Avalonia UI_ controls have events that allow you to subscribe to pointer movements, clicks and wheel movements. These are as follows:
@@ -44,7 +46,7 @@ private void PointerPressedHandler (object sender, PointerPressedEventArgs args)
```
-
+
## Pointer Position
diff --git a/docs/concepts/input/routed-events.md b/docs/concepts/input/routed-events.md
index 857a8f672..b966900ca 100644
--- a/docs/concepts/input/routed-events.md
+++ b/docs/concepts/input/routed-events.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Input
---
+import InputEventRoutingDiagram from '/img/gitbook-import/assets/input-event-routing.png';
+
# Routed Events
Most events in Avalonia are implemented as Routed Events. Routed events are events that are raised on the whole tree rather than just the control that raised the event.
@@ -221,7 +223,7 @@ Avalonia input events that come in pairs are implemented so that a single user a
As an illustration of how input event processing works, consider the following input event example. In the following tree illustration, `leaf element #2` is the source of a `PointerPressed` event:
-
+
The order of event processing is as follows:
diff --git a/docs/concepts/layout/layout-zones.md b/docs/concepts/layout/layout-zones.md
index d840ea660..2a4226708 100644
--- a/docs/concepts/layout/layout-zones.md
+++ b/docs/concepts/layout/layout-zones.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Layout
---
+import LayoutZonesDiagram from '/img/gitbook-import/assets/image (25) (2) (1).png';
+
# Layout Zones
-
+
diff --git a/docs/concepts/reactiveui/index.md b/docs/concepts/reactiveui/index.md
index 892c0df44..d112f7073 100644
--- a/docs/concepts/reactiveui/index.md
+++ b/docs/concepts/reactiveui/index.md
@@ -2,6 +2,8 @@
description: CONCEPTS
---
+import ReactiveUINuGetScreenshot from '/img/gitbook-import/assets/image (44) (1).png';
+
# ReactiveUI
:::tip
@@ -18,7 +20,7 @@ For a full technical background on functional reactive programming, see the Wiki
_Avalonia UI_ ships with its own fork of _ReactiveUI_ in the `Avalonia.ReactiveUI` _NuGet_ package.
-
+
To use _ReactiveUI_ and the MVVM pattern in your _Avalonia UI_ application, add the package to your project using the _NuGet_ package manager (as above), or execute the following CLI command:
diff --git a/docs/concepts/reactiveui/reactive-command.md b/docs/concepts/reactiveui/reactive-command.md
index ab3486d88..d7035294c 100644
--- a/docs/concepts/reactiveui/reactive-command.md
+++ b/docs/concepts/reactiveui/reactive-command.md
@@ -2,6 +2,10 @@
description: CONCEPTS - ReactiveUI
---
+import ReactiveCommandViewScreenshot from '/img/gitbook-import/assets/image (2) (1) (1) (1).png';
+import ReactiveCommandRunOutputScreenshot from '/img/gitbook-import/assets/image (6) (1) (1).png';
+import ReactiveCommandCanExecuteScreenshot from '/img/gitbook-import/assets/image (6) (1) (2).png';
+
# Reactive Command
On this page you will learn how to use the _ReactiveUI_ `ReactiveCommand` and an `ObservableObject` created in code, to implement the UI principle of revealed functionality.
@@ -24,7 +28,7 @@ As a starting point, you can create a simple view like this:
```
-
+
You can add a corresponding view model like this:
@@ -53,7 +57,7 @@ public class MainWindowViewModel : ViewModelBase
This view model does not yet perform revealed functionality. The `SubmitCommand` is declared with no parameter, and no result (void). The synchronous action parameter of the `Create` method is where you implement what happens when the command is run (when the user clicks the button). The example above just reports the action in the debug window.
-
+
## Can Execute?
@@ -81,8 +85,4 @@ SubmitCommand = ReactiveCommand.Create(() =>
Now you will see that the button only becomes enabled once you have entered 8 characters.
-
-
-
-
-
+
diff --git a/docs/concepts/reactiveui/reactive-view-model.md b/docs/concepts/reactiveui/reactive-view-model.md
index 5386f1caa..28fc5a7a0 100644
--- a/docs/concepts/reactiveui/reactive-view-model.md
+++ b/docs/concepts/reactiveui/reactive-view-model.md
@@ -2,6 +2,8 @@
description: CONCEPTS - ReactiveUI
---
+import ReactiveObjectDiagram from '/img/gitbook-import/assets/image (4) (2).png';
+
# Reactive View Model
This page describes how you can use the _ReactiveUI_ `ReactiveObject` as the basis of your view model to implement MVVM binding with _Avalonia UI_.
@@ -20,7 +22,7 @@ public class ViewModelBase : ReactiveObject
}
```
-
+
:::info
If you have used the Avalonia MVVM Application solution template, then you will find this base class already added to the project /ViewModels folder.
@@ -50,7 +52,7 @@ _Avalonia UI_ uses the underlying `ReactiveObject` to **Notify** changes in the
Watermark="Enter a description"/>
```
-Any change to the view model description property is achieved using the the `set` accessor and a change is raised causing _Avalonia UI_ to display the new value on the UI.
+Any change to the view model description property is achieved using the `set` accessor and a change is raised causing _Avalonia UI_ to display the new value on the UI.
## Update the View Model from Input
diff --git a/docs/concepts/reactiveui/routing.md b/docs/concepts/reactiveui/routing.md
index 6466ec19a..a50fccfbf 100644
--- a/docs/concepts/reactiveui/routing.md
+++ b/docs/concepts/reactiveui/routing.md
@@ -1,5 +1,7 @@
# Routing
+import ReactiveUIRoutingScreenshot from '/img/gitbook-import/assets/routing.gif';
+
[ReactiveUI routing](https://reactiveui.net/docs/handbook/routing/) consists of an [IScreen](https://reactiveui.net/api/reactiveui/iscreen/) that contains current [RoutingState](https://reactiveui.net/api/reactiveui/routingstate/), several [IRoutableViewModel](https://reactiveui.net/api/reactiveui/iroutableviewmodel/)s, and a platform-specific XAML control called [RoutedViewHost](https://github.com/AvaloniaUI/Avalonia/blob/55458cf7af24d6c987268ab5ff8a1ead1173310b/src/Avalonia.ReactiveUI/RoutedViewHost.cs). `RoutingState` manages the view model navigation stack and allows view models to navigate to other view models. `IScreen` is the root of a navigation stack; despite the name, its views don't have to occupy the whole screen. `RoutedViewHost` monitors an instance of `RoutingState`, responding to any changes in the navigation stack by creating and embedding the appropriate view.
## Routing Example
@@ -245,5 +247,5 @@ Now, you can run the app and see routing in action!
dotnet run --framework netcoreapp2.1
```
-
+
diff --git a/docs/concepts/services/storage-provider/file-picker-options.md b/docs/concepts/services/storage-provider/file-picker-options.md
index e2c837810..1b82e836c 100644
--- a/docs/concepts/services/storage-provider/file-picker-options.md
+++ b/docs/concepts/services/storage-provider/file-picker-options.md
@@ -33,6 +33,18 @@ Gets or sets an option indicating whether open picker allows users to select mul
Gets or sets the collection of file types that the file open picker displays.
+To create a list of file types for the file picker:
+
+```cs
+//This can also be applied for SaveFilePicker.
+var files = await _target.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions()
+{
+ Title = title,
+//You can add either custom or from the built-in file types. See "Defining custom file types" on how to create a custom one.
+ FileTypeFilter = new[] { ImageAll, FilePickerFileTypes.TextPlain }
+});
+```
+
## FilePickerSaveOptions
### SuggestedFileName
diff --git a/docs/concepts/templates/content-template.md b/docs/concepts/templates/content-template.md
index 8a46c85d3..e047cdc4c 100644
--- a/docs/concepts/templates/content-template.md
+++ b/docs/concepts/templates/content-template.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Data Templates
---
+import ContentTemplateStudentScreenshot from '/img/gitbook-import/assets/image (47).png';
+
# Content Template
The purpose of a data template is that it defines how _Avalonia UI_ should display an object created from a class that you have defined, and that is not a control, or a simple string.
@@ -43,7 +45,7 @@ You can define a data template (for no particular class) using the `DataTemplate
In the above, the bindings refer to the properties of any class present in the content zone of the window. Here the window content is the same student object as you used before; but when you run this code, _Avalonia UI_ now displays:
-
+
Using a data template in this way, you have both defined and chosen the data template for the content in the same place - by setting the `ContentTemplate` property of the window directly.
diff --git a/docs/concepts/templates/data-templates-collection.md b/docs/concepts/templates/data-templates-collection.md
index 1ef66396f..30a5a0bef 100644
--- a/docs/concepts/templates/data-templates-collection.md
+++ b/docs/concepts/templates/data-templates-collection.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Data Templates
---
+import DataTemplatesCollectionStudentScreenshot from '/img/gitbook-import/assets/image (57).png';
+
# Data Templates Collection
Every control in _Avalonia UI_ has a `DataTemplates` collection where you can place any number of data template definitions. You can then choose the template to use for display by class type.
@@ -38,5 +40,5 @@ So you can modify the previous sample to use the `DataTemplates` collection, as
This results in exactly the same display as on the previous page:
-
+
diff --git a/docs/concepts/templates/data-templates.md b/docs/concepts/templates/data-templates.md
index 1b784bca8..0079678ec 100644
--- a/docs/concepts/templates/data-templates.md
+++ b/docs/concepts/templates/data-templates.md
@@ -2,9 +2,13 @@
description: CONCEPTS - Data Templates
---
+import ControlContentButtonScreenshot from '/img/gitbook-import/assets/image (42) (1).png';
+import ControlContentStringScreenshot from '/img/gitbook-import/assets/image (51).png';
+import ControlContentTypeScreenshot from '/img/gitbook-import/assets/image (52).png';
+
# Control Content
-You have probably seen what happens if you put a button control into the content zone of an _Avalonia UI_ window.
+You have probably seen what happens if you put a button control into the content zone of an _Avalonia UI_ window.
:::info
The concept of the zones of an _Avalonia UI_ control is discussed [here](../layout/layout-zones).
@@ -26,7 +30,7 @@ For example:
The window displays the button - in this case centred both horizontally (specified) and vertically (by default). It looks like this:
-
+
And if you put a string into the window content zone, for example:
@@ -44,7 +48,7 @@ And if you put a string into the window content zone, for example:
The window will display the string:
-
+
But what happens if you try to display an object from a class that you have defined in the window?
@@ -74,7 +78,7 @@ And the XML namespace `local` defined as the `MySample` namespace (from above),
But you will see only the fully-qualified class name for the student object:
-
+
This is not very helpful! It happens because _Avalonia UI_ has no definition of how to display an object of class `Student` - and it is not a control - so it falls back on the `.ToString()` method, and all you see is the fully-qualified class name.
diff --git a/docs/concepts/templates/reusing-data-templates.md b/docs/concepts/templates/reusing-data-templates.md
index 25da2d39d..b948c55c5 100644
--- a/docs/concepts/templates/reusing-data-templates.md
+++ b/docs/concepts/templates/reusing-data-templates.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Data Templates
---
+import ReuseTeacherDataTemplateScreenshot from '/img/gitbook-import/assets/image (50).png';
+
# Reusing Data Templates
If you define a data template in the `Window.DataTemplates`collection (as on the previous page), you can reuse it anywhere in the window. However, you can also extend the reuse of a data template to any window in your application.
@@ -80,7 +82,7 @@ Use a local definition of a teacher in the window content zone:
Although there is no data template for a teacher in the window; Avalonia UI will find the template you defined in the application, and the display works as planned:
-
+
:::warning
Remember to specify a `DataType` in every data template, wherever it is defined, because if _Avalonia UI_ fails to find a data template match for your data; then nothing will be displayed!
diff --git a/docs/concepts/the-main-window.md b/docs/concepts/the-main-window.md
index 4404a77a9..5054bf52d 100644
--- a/docs/concepts/the-main-window.md
+++ b/docs/concepts/the-main-window.md
@@ -16,10 +16,10 @@ public override void OnFrameworkInitializationCompleted()
}
```
-It can be retrieved at any time by casting `Application.ApplicationLifetime` `IClassicDesktopStyleApplicationLifetime`.
+It can be retrieved at any time by casting `Application.ApplicationLifetime` to `IClassicDesktopStyleApplicationLifetime`.
:::warning
-Mobile and browser platforms don't have a concept of Window in Avalonia. Instead you need to set MainView control in Application.ApplicationLifetime when it implements ISingleViewApplicationLifetime interface.
+Mobile and browser platforms don't have a concept of Window in Avalonia. Instead you need to set the MainView control in Application.ApplicationLifetime when it implements ISingleViewApplicationLifetime interface.
:::
-###
+###
diff --git a/docs/concepts/the-mvvm-pattern/avalonia-ui-and-mvvm.md b/docs/concepts/the-mvvm-pattern/avalonia-ui-and-mvvm.md
index 482e46f1b..40b9e7653 100644
--- a/docs/concepts/the-mvvm-pattern/avalonia-ui-and-mvvm.md
+++ b/docs/concepts/the-mvvm-pattern/avalonia-ui-and-mvvm.md
@@ -2,6 +2,8 @@
description: CONCEPTS - The MVVM Pattern
---
+import MvvmDataBindingDiagram from '/img/gitbook-import/assets/mvvm.png';
+
# Avalonia UI and MVVM
On this page you will lean how the MVVM pattern is realised when you use it with _Avalonia UI_.
@@ -28,7 +30,7 @@ To learn how to design and implement your own controls, see [here](../../guides/
Data binding is the key technology that allows an _Avalonia UI_ MVVM application to separate views from view models. You can visualise the view to view model relationship as two layers connected by the data bindings:
-
+
Notice how some of the data bindings are represented by a two way arrow, and others by a single-headed arrow. For example, the name and address inputs are two ways - you want both changes in the view model to be notified to the view, and for inputs to the view to be updated on the view model.
diff --git a/docs/concepts/the-mvvm-pattern/index.md b/docs/concepts/the-mvvm-pattern/index.md
index b94166178..6fd44f2a3 100644
--- a/docs/concepts/the-mvvm-pattern/index.md
+++ b/docs/concepts/the-mvvm-pattern/index.md
@@ -2,9 +2,11 @@
description: CONCEPTS
---
+import MvvmPatternDiagram from '/img/gitbook-import/assets/image (60).png';
+
# The MVVM Pattern
-
+
The Model-View-View Model (MVVM) pattern is a common way of structuring a UI application. It uses a data binding system that helps move data between its view and view model parts. This means it achieves separation of application logic (view model) from the display of the UI (view).
diff --git a/docs/concepts/ui-composition.md b/docs/concepts/ui-composition.md
index 54388b934..b861e4518 100644
--- a/docs/concepts/ui-composition.md
+++ b/docs/concepts/ui-composition.md
@@ -2,6 +2,11 @@
description: CONCEPTS
---
+import CompositionBasicLayoutDiagram from '/img/gitbook-import/assets/image (10) (2).png';
+import CompositionTreesDiagram from '/img/gitbook-import/assets/image (3) (1).png';
+import CompositionUserControlsDiagram from '/img/gitbook-import/assets/image (8) (2).png';
+import CompositionCollectionControlsDiagram from '/img/gitbook-import/assets/image (8) (3).png';
+
# UI Composition
UI composition is the process you use to create the layouts that your apps require. It allows you to build a complex view from an arrangement of components. The advantages are:
@@ -25,7 +30,7 @@ A window in _Avalonia UI_ is a basic unit of layout (for a windowing platform).&
_Avalonia UI_ contains a large number of built-in controls that will cover most of your UI requirements.
-
+
When you first meet _Avalonia UI_, you might place a single built-in control in the content zone of a window (above, left). This is the simplest form of UI composition: the window has the title of the app and usually some window state controls (depending on the target platform). The built-in control allows your app to receive some user input, or to present some output with layout and styling.
@@ -39,7 +44,7 @@ To see the full range of Avalonia UI built-in controls, see the reference sectio
Whatever arrangement of controls you use, _Avalonia UI_ represents their relationships as a a tree structure, with the 'outermost' control as the root. So for example, the previous UI composition can be represented as the tree shown here:
-
+
This is the **logical control tree**, and it represents the application controls (including the main window) in the hierarchy in which they are defined in the XAML. There are many systems in _Avalonia UI_ that process the logical control tree and its companion the **visual control tree**.
@@ -51,7 +56,7 @@ For more information on the concept of control trees, see [here](control-trees.m
User controls are the mainstay of UI composition in _Avalonia UI_.
-
+
You can add a user control to the content zone of a main window, to represent a 'page view' (above, left). This allows you to implement a more complex app with multiple pages; where the layout and function of each page is in its own user control (XAML and code) files.
@@ -71,7 +76,7 @@ In the 'To Do List App' tutorial you will learn about how to add user controls a
Another variation of UI composition is where you need to present a collection of items.
-
+
This scenario will use one of the built-in repeating controls, bound to a collection; together with a data template to represent the items in the collection.
diff --git a/docs/deployment/macOS.md b/docs/deployment/macOS.md
index bfa87df4f..2fc13ada7 100644
--- a/docs/deployment/macOS.md
+++ b/docs/deployment/macOS.md
@@ -323,9 +323,9 @@ The following steps were modified from [this StackOverflow post](https://stackov
Once notarization is complete, you should be able to distribute your application!
-{% hint style="info" %}
+:::info
If you distribute your app in a `.dmg`, you will want to modify the steps slightly:
-{% endhint %}
+:::
1. Notarize your `.app` as normal \(in a `.zip` file\)
2. Add your notarized and stapled \(`xcrun stapler`\) app into the DMG \(the DMG now has the notarized/stapled `.app` file inside of it\).
@@ -649,4 +649,4 @@ When you run this workflow you will have an app bundle that is signed and notari
To verify that code signing worked you will need to download it first to trigger the quarantine functionality of macOS. You can do this by e-mailing it to yourself or using a service like WeTransfer or similar.
-Once you've downloaded the app bundle and want to start it you should see the popup from macOS saying that the app was scanned and no malware was found.
\ No newline at end of file
+Once you've downloaded the app bundle and want to start it you should see the popup from macOS saying that the app was scanned and no malware was found.
diff --git a/docs/get-started/getting-started.md b/docs/get-started/getting-started.md
index d89f191a5..86c93c3e1 100644
--- a/docs/get-started/getting-started.md
+++ b/docs/get-started/getting-started.md
@@ -1,4 +1,4 @@
----
+s---
id: getting-started
title: Starting with the CLI
---
diff --git a/docs/get-started/set-up-an-editor.md b/docs/get-started/set-up-an-editor.md
index 065f892a6..fcb649d1d 100644
--- a/docs/get-started/set-up-an-editor.md
+++ b/docs/get-started/set-up-an-editor.md
@@ -3,6 +3,9 @@ id: set-up-an-editor
title: Set Up an Editor
---
+import AvaloniaVsExtensionMarketplaceScreenshot from '/img/get-started/install-the-avalonia-extension/image (17) (2).png';
+import AvaloniaVsExtensionNuGetScreenshot from '/img/get-started/install-the-avalonia-extension/image (3) (1) (1) (1).png';
+
# Set Up an Editor
You can create an Avalonia application using any code editor, but using an IDE will give you support for authoring Avalonia XAML files with a previewer and code completion.
@@ -19,9 +22,7 @@ Rider does not yet provide a visual designer, but this is in development. See [t
If you're developing Avalonia with Visual Studio you should install the [Avalonia for Visual Studio](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaVS) extension.
-
-
-
+
The extension provides intellisense support for Avalonia XAML together with a previewer.
@@ -31,9 +32,7 @@ To install the Avalonia for Visual Studio extension:
- In the **Search** box, type "Avalonia"
- Click **Download** and follow the instructions (you will need to close Visual Studio to complete the installation)
-
-
-
+
:::info
Alternatively you can download the extension [here](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaVS).
diff --git a/docs/get-started/test-drive/add-a-control.md b/docs/get-started/test-drive/add-a-control.md
index ac79e5c26..c3d7cc1f5 100644
--- a/docs/get-started/test-drive/add-a-control.md
+++ b/docs/get-started/test-drive/add-a-control.md
@@ -4,6 +4,7 @@ title: Add a Control
---
import Highlight from '@site/src/components/Highlight';
+import AvaloniaPropertyIntellisenseScreenshot from '/img/get-started/add-a-control/image (1) (2) (1).png';
So far the main window of your application displays only a text string. On this page, you will learn how to add some of the built-in controls that are part of Avalonia.
@@ -41,9 +42,8 @@ For example, you will notice that the button you just implemented is rendered h
:::tip
If you're using an IDE, notice how the Avalonia Intellisense guides you as you add attributes to the XAML.
-
-
-
+
+
:::
The button should now move to the center of the window content zone (both horizontally and vertically).
diff --git a/docs/get-started/test-drive/add-some-layout.md b/docs/get-started/test-drive/add-some-layout.md
index 3af374b5e..bb554159e 100644
--- a/docs/get-started/test-drive/add-some-layout.md
+++ b/docs/get-started/test-drive/add-some-layout.md
@@ -3,6 +3,9 @@ id: add-some-layout
title: Add Some Layout
---
+import StackPanelDiagram from '/img/get-started/add-some-layout/image (40) (1) (1).png';
+import StackPanelSampleScreenshot from '/img/get-started/add-some-layout/image (41) (1).png';
+
Avalonia provides a range of built-in controls to help you layout the visual elements of an application. On this page you will see how to use some of these layout controls.
At this stage, your application has a single button located in the content zone of the main window.
@@ -13,11 +16,7 @@ In fact an Avalonia window allows only a single other control in its content zon
The stack panel control allows multiple controls in its content zone, and arranges them in a vertical stack in the sequence they are defined in the XAML.
-
-
-
-
-
+
```xml
@@ -49,9 +48,7 @@ To take the example forwards, add a stack panel as follows (you can include the
```
-
-
-
+
:::info
You can explore the other layout controls in Avalonia from the reference [here](../../reference/controls/layout-controls.md).
diff --git a/docs/get-started/test-drive/create-a-project.md b/docs/get-started/test-drive/create-a-project.md
index d8664668e..c07d8d36c 100644
--- a/docs/get-started/test-drive/create-a-project.md
+++ b/docs/get-started/test-drive/create-a-project.md
@@ -6,6 +6,13 @@ title: Create and Run a Project
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import RiderSplashScreenshot from '/img/get-started/test-drive/rider-splashscreen.png';
+import RiderSolutionScreenshot from '/img/get-started/test-drive/rider-solution.png';
+import VsFindAvaloniaTemplateScreenshot from '/img/get-started/choose-a-solution-template/image (31) (1) (1).png';
+import VsNewAvaloniaProjectScreenshot from '/img/get-started/choose-a-solution-template/image (27) (1).png';
+import RiderRunScreenshot from '/img/get-started/test-drive/rider-run.png';
+import InitialWindowScreenshot from '/img/get-started/test-drive/initial-window.png';
+
## Install Templates
Before starting, ensure that you have [installed the Avalonia templates](../install.md):
@@ -32,9 +39,7 @@ This will create a new folder called `GetStartedApp` containing the new project.
- On the Rider startup screen, select **New Solution**
-
-
-
+
- In the sidebar, scroll down and select **Avalonia App**
- Type `GetStartedApp` in the **Solution Name** field
@@ -42,9 +47,7 @@ This will create a new folder called `GetStartedApp` containing the new project.
The template will create a new solution and project.
-
-
-
+
@@ -53,17 +56,14 @@ The template will create a new solution and project.
- Type `Avalonia` in the search box.
- Click **Avalonia Application** then click **Next**.
-
-
-
+
- Name the project `GetStartedApp`, and click **Create**.
The template will create a new solution and project.
-
-
-
+
+
@@ -83,9 +83,8 @@ dotnet run
Press the **Run** button in the Rider toolbar:
-
-
-
+
+
@@ -93,22 +92,17 @@ Press the **Run** button in the Rider toolbar:
- Type `Avalonia` in the search box.
- Click **Avalonia Application** then click **Next**.
-
-
-
+
- Name the project `GetStartedApp`, and click **Create**.
The template will create a new solution and project.
-
-
-
+
+
You should now be running your first Avalonia application!
-
-
-
+
diff --git a/docs/get-started/test-drive/index.md b/docs/get-started/test-drive/index.md
new file mode 100644
index 000000000..09c1a3e94
--- /dev/null
+++ b/docs/get-started/test-drive/index.md
@@ -0,0 +1,8 @@
+# Test Drive
+
+```mdx-code-block
+import {DocsCardList} from '../../../src/components/DocsCard';
+import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
+
+
+```
\ No newline at end of file
diff --git a/docs/get-started/test-drive/input-controls.md b/docs/get-started/test-drive/input-controls.md
index 50539f384..2c6840062 100644
--- a/docs/get-started/test-drive/input-controls.md
+++ b/docs/get-started/test-drive/input-controls.md
@@ -3,15 +3,15 @@ id: input-controls
title: Input Controls
---
+import InputControlsScreenshot from '/img/get-started/test-drive/input-controls.png';
+
On this page, you will learn how to add some of the Avalonia input controls in a neat layout. The aim is to add a numerical inputs with their associated labels in horizontal rows; with an output control in the row below.
To achieve this layout, you will use the built-in grid control, and locate label and input controls in its cells.
-This picture shows the resulting layout (running) with the gridlines showing. The gridlines are showing for the purpose of visualizing the layout - you would not usually do this on a production UI.
+This picture shows the resulting layout (running) with the gridlines showing. The gridlines are showing for the purpose of visualizing the layout - you would not usually do this on a production UI.
-
-
-
+
To create a layout using the grid control, follow this procedure:
diff --git a/docs/get-started/test-drive/main-window.md b/docs/get-started/test-drive/main-window.md
index 456fc69f4..94e822b34 100644
--- a/docs/get-started/test-drive/main-window.md
+++ b/docs/get-started/test-drive/main-window.md
@@ -3,6 +3,11 @@ id: main-window
title: The Main Window
---
+import LayoutZonesDiagram from '/img/gitbook-import/assets/image (25) (2) (1).png';
+import MainWindowScreenshot from '/img/get-started/the-main-window/image (15) (1) (1).png';
+import VsDesignerScreenshot from '/img/get-started/the-main-window/image (22) (1).png';
+import VsPreviewPaneScreenshot from '/img/get-started/the-main-window/image (6) (2).png';
+
You can now start your tour of an Avalonia project. We'll start with the main application window. Open the **MainWindow.axaml** file.
:::info
@@ -13,15 +18,11 @@ Notice that in Avalonia, XAML files have the extension **.axaml** (and not .xaml
In the **MainWindow.axaml** XAML file, the `...` XAML tag represents an Avalonia window. Like other Avalonia controls; the window will be drawn on the target platform with 4 **layout zones**: margin, border, padding and content.
-
-
-
+
In your current application, the content zone of the window has only a simple string comprising your latest message; so that is what is displayed.
-
-
-
+
At this stage, you do not have a margin, border or any padding defined, so the message appears right up against the top left corner of the window.
@@ -33,9 +34,7 @@ For more information about the concept of control layout zones, see [here](../..
If you're using Visual Studio you should see the XAML code and preview pane.
-
-
-
+
:::info
Notice the red exclamation icon (top left) and the message **The designer is loading...**. This indicates that the project must be built before the preview pane will respond.
@@ -44,9 +43,7 @@ Notice the red exclamation icon (top left) and the message **The designer is loa
- Build the project.
- Scroll the preview pane to the left to view the preview outline and the text displayed in the top left corner.
-
-
-
+
- Locate the `Welcome to Avalonia!`message text in the XAML pane, and make a change.
diff --git a/docs/get-started/test-drive/response-to-an-event.md b/docs/get-started/test-drive/response-to-an-event.md
index 0d478fe5f..c17be0c27 100644
--- a/docs/get-started/test-drive/response-to-an-event.md
+++ b/docs/get-started/test-drive/response-to-an-event.md
@@ -3,6 +3,10 @@ id: respond-to-an-event
title: Respond to an Event
---
+import SolutionCodeBehindScreenshot from '/img/get-started/respond-to-an-event/image (59).png';
+import AvaloniaEventIntellisenseScreenshot from '/img/get-started/respond-to-an-event/image (25) (2).png';
+import EventDebugOutputScreenshot from '/img/get-started/respond-to-an-event/image (54).png';
+
There are a number of ways you can implement actions in an Avalonia application. On this page, you will see how to use one of the simplest: how to write event handling code for a button click.
To start, you will write a button click event handler that does not interact with any of the other controls.
@@ -11,9 +15,7 @@ To start, you will write a button click event handler that does not interact wit
The XAML file for the main window has a C# code-behind file associated with it. If you're using an IDE, you can find this file in the **Solution Explorer** - it is a sub-item of the `.axaml` file.
-
-
-
+
To change the code-behind for the main window:
@@ -78,17 +80,13 @@ using System.Diagnostics;
:::tip
If you're using an IDE you will see the Avalonia UI Intellisense as you type.
-
-
-
+
:::
- Run the app and click the button.
You should see the result on the Output window for Debug, like this:
-
-
-
+
On the next page, you will see how to use code-behind to read and change the properties of Avalonia UI controls at runtime.
diff --git a/docs/guides/building-cross-platform-applications/dealing-with-platforms.md b/docs/guides/building-cross-platform-applications/dealing-with-platforms.md
index 11f1a64cf..a61b74eb5 100644
--- a/docs/guides/building-cross-platform-applications/dealing-with-platforms.md
+++ b/docs/guides/building-cross-platform-applications/dealing-with-platforms.md
@@ -39,6 +39,7 @@ Supporting multiple platforms from the same code-base can be achieved through ab
* **Platform Abstraction**: This approach leverages the Business Façade pattern to provide uniform access across platforms. It abstracts the unique platform implementations into a single, cohesive API. The primary advantage is the ability to write platform-agnostic code, enhancing code reusability and maintainability. However, this approach may not fully exploit the unique features and capabilities of each platform.
+
## Platform Abstraction
diff --git a/docs/guides/custom-controls/draw-with-a-property.md b/docs/guides/custom-controls/draw-with-a-property.md
index 275409ad2..b65be2db7 100644
--- a/docs/guides/custom-controls/draw-with-a-property.md
+++ b/docs/guides/custom-controls/draw-with-a-property.md
@@ -3,6 +3,8 @@ id: draw-with-a-property
title: Draw with a Property
---
+import DrawWithPropertyScreenshot from '/img/gitbook-import/assets/image (1) (2) (2).png';
+
# Draw with a Property
On this page you will see how to draw a custom control, using the value for a simple property that defines the background color. The code now looks like this:
@@ -48,7 +50,7 @@ This example defines a simple brush property on the custom control for the backg
The drawing code uses the _Avalonia UI_ graphics context (that is passed to the render method), to draw a rectangle that is filled with the background color, and made the same size as the control (as supplied by the `Bounds.Size` object).
-
+
Notice how the control now shows both at runtime (above) and in the preview pane.
diff --git a/docs/guides/custom-controls/how-to-create-a-custom-controls-library.md b/docs/guides/custom-controls/how-to-create-a-custom-controls-library.md
index c1af9d199..583d77beb 100644
--- a/docs/guides/custom-controls/how-to-create-a-custom-controls-library.md
+++ b/docs/guides/custom-controls/how-to-create-a-custom-controls-library.md
@@ -3,15 +3,18 @@ id: how-to-create-a-custom-controls-library
title: How To Create a Custom Controls Library
---
+import CustomControlsSolutionScreenshot from '/img/gitbook-import/assets/image (22) (3).png';
+import CustomControlNuGetScreenshot from '/img/gitbook-import/assets/image (11) (2).png';
+
# How To Create a Custom Controls Library
This guide shows you how to create a custom controls library and reference it for use in an _Avalonia UI_ app.
-
+
In this example, a custom control file is added to a .NET class library. The library has the _Avalonia UI_ _NuGet_ package installed:
-
+
+
diff --git a/docs/guides/data-binding/how-to-bind-can-execute.md b/docs/guides/data-binding/how-to-bind-can-execute.md
index b0833f335..7b91583b0 100644
--- a/docs/guides/data-binding/how-to-bind-can-execute.md
+++ b/docs/guides/data-binding/how-to-bind-can-execute.md
@@ -3,6 +3,7 @@ id: how-to-bind-can-execute
title: How to Bind Can Execute
---
+import BindCanExecuteScreenshot from '/img/gitbook-import/assets/command4.gif';
# How to Bind Can Execute
@@ -86,4 +87,4 @@ Here the `WhenAnyValue` method takes two arguments, the first collects a value f
The `WhenAnyValue` method actually has overloads that can take up to 10 different value getters (for the validation function parameters), plus the validation function itself.
:::
-
+
diff --git a/docs/guides/data-binding/how-to-bind-to-a-command-with-reactiveui.md b/docs/guides/data-binding/how-to-bind-to-a-command-with-reactiveui.md
index 54349a73d..cca51ee67 100644
--- a/docs/guides/data-binding/how-to-bind-to-a-command-with-reactiveui.md
+++ b/docs/guides/data-binding/how-to-bind-to-a-command-with-reactiveui.md
@@ -3,6 +3,7 @@ id: how-to-bind-to-a-command-with-reactiveui
title: How to Bind to a Command with ReactiveUI
---
+import BindReactiveCommandScreenshot from '/img/gitbook-import/assets/command.gif';
# How to Bind to a Command with ReactiveUI
@@ -72,7 +73,7 @@ namespace AvaloniaGuides.ViewModels
When the control bound to the reactive command is activated (in this example: when the button is clicked); then the private method to perform the action is called through the reactive command.
-
+
## Command Parameter
diff --git a/docs/guides/data-binding/how-to-bind-to-a-command-without-reactiveui.md b/docs/guides/data-binding/how-to-bind-to-a-command-without-reactiveui.md
index a890654a8..e234198b9 100644
--- a/docs/guides/data-binding/how-to-bind-to-a-command-without-reactiveui.md
+++ b/docs/guides/data-binding/how-to-bind-to-a-command-without-reactiveui.md
@@ -3,6 +3,8 @@ id: how-to-bind-to-a-command-without-reactiveui
title: How to Bind to a Command without ReactiveUI
---
+import BindCommandMethodScreenshot from '/img/gitbook-import/assets/command2.gif';
+import BindCanExecuteMethodScreenshot from '/img/gitbook-import/assets/command3.gif';
# How to Bind to a Command without ReactiveUI
@@ -34,7 +36,7 @@ namespace AvaloniaGuides.ViewModels
{
public class MainWindowViewModel
{
- private void PerformAction(string msg)
+ public void PerformAction(object msg)
{
Debug.WriteLine($"The action was called. {msg}");
}
@@ -42,7 +44,7 @@ namespace AvaloniaGuides.ViewModels
}
```
-
+
## Can Execute?
@@ -59,12 +61,12 @@ namespace AvaloniaGuides.ViewModels
{
public class MainWindowViewModel
{
- private void PerformAction(string msg)
+ public void PerformAction(object msg)
{
Debug.WriteLine($"The action was called. {msg}");
}
- private bool CanPerformAction(object msg)
+ public bool CanPerformAction(object msg)
{
if (msg!=null) return !string.IsNullOrWhiteSpace( msg.ToString() );
return false;
@@ -92,7 +94,7 @@ This example uses the technique of binding directly to another control. You can
You will see that the button becomes enables only when the text box contains a string.
-
+
## **Trigger Can Execute**
diff --git a/docs/guides/development-guides/accessing-the-ui-thread.md b/docs/guides/development-guides/accessing-the-ui-thread.md
index 50bdd039c..5d6d98342 100644
--- a/docs/guides/development-guides/accessing-the-ui-thread.md
+++ b/docs/guides/development-guides/accessing-the-ui-thread.md
@@ -3,6 +3,8 @@ id: accessing-the-ui-thread
title: How To Access the UI Thread
---
+import DispatchPostLongRunningScreenshot from '/img/gitbook-import/assets/long1.gif';
+import DispatchInvokeAsyncLongRunningScreenshot from '/img/gitbook-import/assets/long2.gif';
# How To Access the UI Thread
@@ -24,7 +26,7 @@ Use `InvokeAsync` when you need to wait for the result, and potentially want to
## Dispatcher Priority
-Both of the above methods have a dispatcher priority parameter. You can use this with the `DispatcherPriority` enumeration to specify the queue priority that the given job should be given.
+Both of the above methods have a dispatcher priority parameter. You can use this with the `DispatcherPriority` enumeration to specify the queue priority that the given job should be given.
:::info
For the possible values of the `DispatcherPriority` enumeration, see [here](http://reference.avaloniaui.net/api/Avalonia.Threading/DispatcherPriority/).
@@ -64,7 +66,7 @@ private void ButtonClickHandler(object sender, RoutedEventArgs e)
}
```
-
+
Notice that because the long running task is executed on its own thread, the UI does not lose responsiveness.
@@ -74,7 +76,7 @@ To get a result from the long running task, the XAML is the same, but this versi
-
+
```
```csharp title='Task C#'
@@ -100,7 +102,7 @@ private async void ButtonClickHandler(object sender, RoutedEventArgs e)
}
```
-
+
## More Information
diff --git a/docs/guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md b/docs/guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md
index 0dfbe363b..19a6ab8ca 100644
--- a/docs/guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md
+++ b/docs/guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md
@@ -3,8 +3,7 @@ id: how-to-show-and-hide-a-split-view-pane-with-mvvm
title: How To Show and Hide a Split View Pane with MVVM
---
-
-# How To Show and Hide a Split View Pane with MVVM
+import SplitViewExpanderScreenshot from '/img/gitbook-import/assets/splitview2.gif';
Content in preparation.
@@ -16,4 +15,5 @@ This technique uses a complex **binding path** to locate the parent view model f
TO DO
-
+
+
diff --git a/docs/guides/development-guides/improving-performance.md b/docs/guides/development-guides/improving-performance.md
index 7af8eee61..d8c11d561 100644
--- a/docs/guides/development-guides/improving-performance.md
+++ b/docs/guides/development-guides/improving-performance.md
@@ -5,27 +5,27 @@ title: Improving Performance
The performance of Avalonia applications can be significantly improved by taking into account several key considerations during the development process. This document discusses the steps you can take to optimize the performance of your Avalonia applications.
-
## Use CompiledBindings
One of the most effective ways to improve performance in Avalonia is to use [`CompiledBindings`](../../basics/data/data-binding/compiled-bindings) in your application. Compiled bindings enable faster data binding by compiling the binding path at compile time, thus reducing the overhead of reflection at runtime.
## Choose the Right Control for Data Display
-When you need to display a large amount of data in a `DataGrid` or a `TreeView` with many nodes, it is recommended to use the `TreeDataGrid` control. `TreeDataGrid` is built from scratch and provides better performance than the normal `DataGrid`. It supports virtualization and is particularly useful if you need a virtualized tree, as it has hierarchical data templates.
+When you need to display a large amount of data in a `DataGrid` or a `TreeView` with many nodes, it is recommended to use the `TreeDataGrid` control. `TreeDataGrid` is built from scratch and provides better performance than the normal `DataGrid`. It supports virtualization and is particularly useful if you need a virtualized tree, as it has hierarchical data templates.
-Avoid using the `DataGrid` control if you don't need editing features. It's generally regarded as a less optimal control for performance.
+Avoid using the `DataGrid` control if you don't need editing features. It's generally regarded as a less optimal control for performance.
## Virtualization
When working with large amounts of data, enabling virtualization can improve the performance of your Avalonia application. Virtualization means that only the visible items in the control are rendered, which significantly improves the performance when there are a large number of items to display.
### TreeDataGrid
-`TreeDataGrid` supports virtualization and can handle thousands of rows with complex cells effectively.
+
+`TreeDataGrid` supports virtualization and can handle thousands of rows with complex cells effectively.
## Optimize Your Visual Tree Structure
-Performance can often be hindered by a deeply nested and complicated layout. Strive to maintain your XAML markup as uncomplicated and flat as possible. Rendering UI elements onscreen triggers a "layout pass" twice for every single element (a measure pass followed by an arrange pass).
+Performance can often be hindered by a deeply nested and complicated layout. Strive to maintain your XAML markup as uncomplicated and flat as possible. Rendering UI elements onscreen triggers a "layout pass" twice for every single element (a measure pass followed by an arrange pass).
This layout pass process is computation-heavy—the more child elements an item has, the more calculations are needed. Therefore, minimizing the complexity of your visual tree in Avalonia UI can significantly enhance the application's performance.
diff --git a/docs/guides/graphics-and-animation/graphics-and-animations.md b/docs/guides/graphics-and-animation/graphics-and-animations.md
index 13d8a80fc..7dbb44849 100644
--- a/docs/guides/graphics-and-animation/graphics-and-animations.md
+++ b/docs/guides/graphics-and-animation/graphics-and-animations.md
@@ -3,6 +3,7 @@ id: graphics-and-animations
title: How To Draw Graphics
---
+import ShapeAndGeometrySampleScreenshot from '/img/gitbook-import/assets/shapes.png';
# How To Draw Graphics
@@ -53,7 +54,7 @@ Avalonia provides a library of common vector-drawn 2D shapes such as `Ellipse`,
```
-
+
## Add Animations
diff --git a/docs/guides/graphics-and-animation/how-to-create-a-custom-page-transition.md b/docs/guides/graphics-and-animation/how-to-create-a-custom-page-transition.md
index 68aa6f092..9e807e1d0 100644
--- a/docs/guides/graphics-and-animation/how-to-create-a-custom-page-transition.md
+++ b/docs/guides/graphics-and-animation/how-to-create-a-custom-page-transition.md
@@ -3,6 +3,7 @@ id: how-to-create-a-custom-page-transition
title: How To Create a Custom Page Transition
---
+import CustomPageTransitionScreenshot from '/img/animations/page-transitions/TransitioningContentControl_03.webp';
# How To Create a Custom Page Transition
@@ -162,7 +163,7 @@ public class CustomTransition : IPageTransition
}
```
-
+
## More Information
diff --git a/docs/guides/graphics-and-animation/keyframe-animations.md b/docs/guides/graphics-and-animation/keyframe-animations.md
index 3c75632b1..07c6cd89f 100644
--- a/docs/guides/graphics-and-animation/keyframe-animations.md
+++ b/docs/guides/graphics-and-animation/keyframe-animations.md
@@ -3,12 +3,17 @@ id: keyframe-animations
title: How To Use Keyframe Animations
---
+import AnimationKeyframeDiagram from '/img/gitbook-import/assets/image (2) (1) (4).png';
+import KeyframeFadeScreenshot from '/img/gitbook-import/assets/anim1 (1).gif';
+import KeyframeCompositeAnimationScreenshot from '/img/gitbook-import/assets/anim2.gif';
+import LinearEasingScreenshot from '/img/gitbook-import/assets/image (72).png';
+import BounceEaseInScreenshot from '/img/gitbook-import/assets/image (76).png';
# How To Use Keyframe Animations
You can use a keyframe animation to change one or more control properties following a timeline. The keyframes are defined in _Avalonia UI_ styles with **cue** points along the **duration** of the animation, and set the intermediate values of the properties at a point in time.
-
+
The property values between keyframes are set following the profile of an **easing function**. The default easing function is a straight-line interpolation.
@@ -62,7 +67,7 @@ The finished code will look like this:
The resulting animation looks like this:
-
+
The animation runs as soon as the rectangle control is loaded and can be selected by the style. In fact it runs in the preview pane as well!
@@ -75,7 +80,7 @@ This example shows you how to animate two properties on the same timeline.
```
-{% endcode %}
-{% code title="Styles1.axaml" %}
```markup
c
+
```
-{% endcode %}
-{% code title="App.axaml" %}
```markup
```
-{% endcode %}
Here styles from file **Styles1.axaml** were applied first, so setters in styles of file **Styles2.axaml** take priority. The resulting TextBlock will have FontSize="16" and Foreground="Green". The same order prioritization happens within style files also.
@@ -103,7 +97,7 @@ The following code example of styles that can be expected to work on top of defa
-
```
diff --git a/docs/reference/animation-settings.md b/docs/reference/animation-settings.md
index 3d40ce3cf..8e11ef9e1 100644
--- a/docs/reference/animation-settings.md
+++ b/docs/reference/animation-settings.md
@@ -2,6 +2,8 @@
description: REFERENCE
---
+import SineEaseOutScreenshot from '/img/gitbook-import/assets/image (67).png';
+
# Animation Settings
This section contains full lists of the _Avalonia UI_ animation settings:
@@ -13,7 +15,7 @@ This section contains full lists of the _Avalonia UI_ animation settings:
## Easing Functions
-
Profile
Setting
SineEaseOut
+
Profile
Setting
SineEaseOut
## Fill Modes
diff --git a/docs/reference/built-in-data-binding-converters.md b/docs/reference/built-in-data-binding-converters.md
index a4367e12f..3dd2c73a3 100644
--- a/docs/reference/built-in-data-binding-converters.md
+++ b/docs/reference/built-in-data-binding-converters.md
@@ -29,7 +29,7 @@ This example shows the text block when the bound value is false:
Negation also works when you bind to a non-Boolean value. This works because the bound value is first converted to a Boolean (using the function `Convert.ToBoolean` ) and then the result is negated.
-For example, as the integer zero is converted to false (by the the function `Convert.ToBoolean`) and all other integer values are converted to true, you can use the negation operator to show a message when a collection is empty, like this:
+For example, as the integer zero is converted to false (by the function `Convert.ToBoolean`) and all other integer values are converted to true, you can use the negation operator to show a message when a collection is empty, like this:
```markup
diff --git a/docs/reference/controls/autocompletebox.md b/docs/reference/controls/autocompletebox.md
index cc7f2e3f5..858564317 100644
--- a/docs/reference/controls/autocompletebox.md
+++ b/docs/reference/controls/autocompletebox.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import AutoCompleteBoxScreenshot from '/img/gitbook-import/assets/autocomplete.gif';
+
# Auto-complete Box
The auto-complete box presents a text box for user input and a drop-down that contains possible matches from an items source collection, for the text typed in. The drop-down shows when the user starts to type, and the match is updated for each character typed. The user can select from the drop-down.
@@ -26,8 +28,6 @@ In an **ordinal** string comparison, each character is compared using its simple
This example has a fixed items source (array) that is set in the C# code-behind.
-
-
```xml
Choose an animal:
@@ -35,7 +35,6 @@ This example has a fixed items source (array) that is set in the C# code-behind.
```
-
```csharp title='C#'
using Avalonia.Controls;
using System.Linq;
@@ -55,11 +54,7 @@ namespace AvaloniaControls.Views
}
```
-
-
-
-
-
+
## More Information
diff --git a/docs/reference/controls/buttons/button.md b/docs/reference/controls/buttons/button.md
index ad9732459..674c47107 100644
--- a/docs/reference/controls/buttons/button.md
+++ b/docs/reference/controls/buttons/button.md
@@ -2,12 +2,20 @@
description: REFERENCE - Built-in Controls
---
+import ButtonClickHandlerScreenshot from '/img/gitbook-import/assets/button.gif';
+
# Button
The button is a control that reacts to pointer actions (and has some keyboard equivalents). It presents visual feedback in the form of a depressed state when the pointer is down.
A pointer-down to pointer release sequence is interpreted as a click; and this behaviour is configurable.
+:::warning
+When determining if a button is pressed by the user, always use the `Click` event instead of `PointerPressed`. `Click` is the high-level event specific to a `Button` that indicates it has been pressed.
+
+`PointerPressed` is more a low-level input event: one that the `Button` needs to handle internally to raise the `Click` event. Since `Button` handles `PointerPressed` (sets `IsHandled` to true), applications will never receive this event as in some other controls.
+:::
+
:::info
Click is one of many button events, for a full list see [here](http://reference.avaloniaui.net/api/Avalonia.Controls/Button/#Events).
:::
@@ -56,9 +64,7 @@ public partial class MainWindow : Window
}
```
-
-
-
+
## More Information
diff --git a/docs/reference/controls/buttons/buttonspinner.md b/docs/reference/controls/buttons/buttonspinner.md
index 0b4d88119..999b65675 100644
--- a/docs/reference/controls/buttons/buttonspinner.md
+++ b/docs/reference/controls/buttons/buttonspinner.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import ButtonSpinnerScreenshot from '/img/gitbook-import/assets/image (3) (3).png';
+
# Button Spinner
The button spinner presents a control that includes buttons for spin-up and spin-down. The content of this button is flexible, but you will have to code quite a lot of the behavior.
@@ -20,7 +22,8 @@ You will probably use these properties most often:
```
-
+
+
## More Information
:::info
diff --git a/docs/reference/controls/buttons/radiobutton.md b/docs/reference/controls/buttons/radiobutton.md
index 970ded074..f3a6ad149 100644
--- a/docs/reference/controls/buttons/radiobutton.md
+++ b/docs/reference/controls/buttons/radiobutton.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import RadioButtonScreenshot from '/img/gitbook-import/assets/radio.gif';
+
# Radio Button
The radio button control presents a group of options from which only one may be selected at a time. A selected option is drawn as a filled circle, and an unselected option as an empty circle.
@@ -39,7 +41,7 @@ This example shows two groups of radio buttons working independently:
```
-
+
## More Information
diff --git a/docs/reference/controls/buttons/repeatbutton.md b/docs/reference/controls/buttons/repeatbutton.md
index 501695902..9388d7e20 100644
--- a/docs/reference/controls/buttons/repeatbutton.md
+++ b/docs/reference/controls/buttons/repeatbutton.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import RepeatButtonScreenshot from '/img/gitbook-import/assets/repeatbutton.gif';
+
# Repeat Button
The repeat button is a control that has the added feature of regularly generating click events while the button is being pressed down.
@@ -19,8 +21,6 @@ You will probably use these properties most often:
This example shows a repeat button generating click events with the default interval and delay.
-
-
```
Press and hold down
@@ -30,7 +30,6 @@ This example shows a repeat button generating click events with the default inte
```
-
```csharp title='C#'
public partial class MainWindow : Window
{
@@ -46,9 +45,7 @@ public partial class MainWindow : Window
}
```
-
-
-
+
## More Information
diff --git a/docs/reference/controls/buttons/splitbutton.md b/docs/reference/controls/buttons/splitbutton.md
index 4f143ec7f..e4aeac0ac 100644
--- a/docs/reference/controls/buttons/splitbutton.md
+++ b/docs/reference/controls/buttons/splitbutton.md
@@ -1,5 +1,10 @@
# Split Button
+import SplitButtonClosedScreenshot from '/img/gitbook-import/assets/SplitButtonClosed.png';
+import SplitButtonOpenedScreenshot from '/img/gitbook-import/assets/SplitButtonOpened.png';
+import SplitButtonColorPickerScreenshot from '/img/controls/buttons/splitbutton/SplitButton_ColorPickerSample.png';
+import SplitButtonExportButtonScreenshot from '/img/controls/buttons/splitbutton/SplitButton_ExportButtonSample.png';
+
The `SplitButton` functions as a [`Button`](./button) with primary and secondary parts that can each be pressed separately. The primary part behaves like normal `Button` and the secondary part opens a [`Flyout`](docs/controls/flyouts) with additional actions.
## Is this the right control?
@@ -54,10 +59,12 @@ The user-selection action should be invoked immediately when pressing either the
```
-
+
+
_SplitButton (Flyout closed)_
-
+
+
_SplitButton (Flyout opened)_
### Color-Selection example
@@ -67,7 +74,7 @@ A common use case of a `SplitButton` is for coloring text within an editor. Pres
```xml
-
+
@@ -83,7 +90,7 @@ A common use case of a `SplitButton` is for coloring text within an editor. Pres
+ Height="200" Width="200">
@@ -95,7 +102,8 @@ A common use case of a `SplitButton` is for coloring text within an editor. Pres
```
-
+
+
_Sample of SplitButton for color selection_
### Export Button Sample
@@ -119,5 +127,6 @@ Another common example of the `SplitButton` could be an export button. When the
```
-
+
+
_Sample of a SplitButton with different export options_
diff --git a/docs/reference/controls/buttons/togglebutton.md b/docs/reference/controls/buttons/togglebutton.md
index 7c141f05e..9048df6ef 100644
--- a/docs/reference/controls/buttons/togglebutton.md
+++ b/docs/reference/controls/buttons/togglebutton.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import ToggleButtonScreenshot from '/img/gitbook-import/assets/toggle.gif';
+
# Toggle Button
The toggle button can present a Boolean value by using styles and a pseudo class that is either present (true) or absent (false).
@@ -16,8 +18,6 @@ This allows a wide range of possible graphical presentations for the control in
This example shows a toggle button containing a speaker icon, or a muted speaker icon, depending on whether the button has the checked pseudo class or not.
-
-
```xml
Audio
@@ -86,7 +86,7 @@ To see the full list of Fluent icons available with _Avalonia UI_, see [https://
The visibility of the path icons is set by the window styles, and these use the `:checked` pseudo class to determine when the toggle button is in its checked state. So, when the toggle button is checked, then the `audio-on` path icon is visible, and the `audio-mute` path icon is hidden. And conversely, when the toggle button is not checked, then the `audio-mute` path icon is visible, and the `audio-on` path icon is hidden.
-
+
## More Information
@@ -97,10 +97,3 @@ For the complete API documentation about this control, see [here](https://refere
:::info
View the source code on _GitHub_ [`ToggleButton.cs`](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Primitives/ToggleButton.cs)
:::
-
-
-
-
-
-
-
diff --git a/docs/reference/controls/buttons/togglesplitbutton.md b/docs/reference/controls/buttons/togglesplitbutton.md
index b75e0b720..f5b4b1f0b 100644
--- a/docs/reference/controls/buttons/togglesplitbutton.md
+++ b/docs/reference/controls/buttons/togglesplitbutton.md
@@ -1,5 +1,10 @@
# Toggle Split Button
+import ToggleSplitButtonClosedUncheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_closed_unchecked.png';
+import ToggleSplitButtonClosedCheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_closed_checked.png';
+import ToggleSplitButtonOpenedCheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_opened_checked.png';
+import ToggleSplitButtonTextListScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_TextListExample.png';
+
The `ToggleSplitButton` functions as a [`ToggleButton`](togglebutton) with primary and secondary parts that can each be pressed separately. The primary part behaves like a normal `ToggleButton` and the secondary part opens a [`Flyout`](../flyouts) with additional actions.
:::info
@@ -63,13 +68,16 @@ Pressing a configuration in the `Flyout` should either (1) turn on the feature w
```
-
+
+
_SplitButton (Flyout closed, unchecked)_
-
+
+
_SplitButton (Flyout closed, checked)_
-
+
+
_SplitButton (Flyout opened, checked)_
### Text editor with numbered or bulleted list example
@@ -110,5 +118,6 @@ Continuing the text editor example from `SplitButton`, a common use case of the
```
-
+
+
_Sample of ToggleSplitButton for toggle text lists on and off and selecting the list format_
diff --git a/docs/reference/controls/canvas.md b/docs/reference/controls/canvas.md
index d0710e129..28af1a604 100644
--- a/docs/reference/controls/canvas.md
+++ b/docs/reference/controls/canvas.md
@@ -2,13 +2,16 @@
description: REFERENCE - Built-in Controls
---
+import CanvasContentZoneScreenshot from '/img/gitbook-import/assets/image (16) (2).png';
+import CanvasChildOverlapScreenshot from '/img/gitbook-import/assets/image (9) (2).png';
+
# Canvas
The canvas control displays its child controls at specified positions (given as coordinates).
-The position of each child control is defined as two distances between edge the canvas content zone, and the outer edge of the child margin zone. For example, this might be the top-left corner of the child to the top-left of canvas, as shown here:
+The position of each child control is defined as two distances between edge the canvas content zone, and the outer edge of the child margin zone. For example, this might be the top-left corner of the child to the top-left of canvas, as shown here:
-
+
:::info
To review the concept of layout zones, see [here](../../concepts/layout/layout-zones).
@@ -20,10 +23,10 @@ You will probably use these properties most often:
Property
Description
Canvas.Left
Attached to a child control - gives the distance between the inner left edge of the canvas content zone to the outer left edge of the child (margin zone).
Canvas.Top
Attached to a child control - gives the distance between the inner top edge of the canvas content zone to the outer top edge of the child (margin zone).
Canvas.Right
Attached to a child control - gives the distance between the inner right edge of the canvas content zone to the outer right edge of the child (margin zone).
Canvas.Bottom
Attached to a child control - gives the distance between the inner bottom edge of the canvas content zone to the outer bottom edge of the child (margin zone).
Canvas.ZIndex
Attached to a child control - this can override the default drawing sequence (see below).
-Child controls in a canvas are drawn in the sequence that the are defined. This can cause them to overlap.
+Child controls in a canvas are drawn in the sequence that the are defined. This can cause them to overlap.
:::warning
-The canvas does not size any of its child controls. You must set width and height properties on a child control, or it will not appear!
+The canvas does not size any of its child controls. You must set width and height properties on a child control, or it will not appear!
:::
## Z-index
@@ -50,7 +53,7 @@ However you define the drawing sequence, the opacity of child controls is respec
The result looks like this:
-
+
:::info
Use the canvas panel with discretion. While it may be convenient to position child controls like this, your UI will no longer be adaptive to changes in the app window size.
diff --git a/docs/reference/controls/carousel.md b/docs/reference/controls/carousel.md
index b1610a8c8..8a96fe3d8 100644
--- a/docs/reference/controls/carousel.md
+++ b/docs/reference/controls/carousel.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import CarouselScreenshot from '/img/gitbook-import/assets/carousel.gif';
+
# Carousel
The carousel has an items collection, and displays each item as a page, in sequence, so that it fills the control.
@@ -10,9 +12,7 @@ You can use the carousel control to create a slide show.
## Example
-This example has three images in the items collection, with buttons to move the display forwards and back. The buttons have click event handlers in the C# code-behind.
-
-
+This example has three images in the items collection, with buttons to move the display forwards and back. The buttons have click event handlers in the C# code-behind.
```xml
@@ -36,7 +36,6 @@ This example has three images in the items collection, with buttons to move the
```
-
```csharp title='C#'
using Avalonia.Controls;
using Avalonia.Interactivity;
@@ -63,9 +62,7 @@ namespace AvaloniaControls.Views
}
```
-
-
-
+
## More Information
diff --git a/docs/reference/controls/checkbox.md b/docs/reference/controls/checkbox.md
index 6cbeb25ce..9b9d02baa 100644
--- a/docs/reference/controls/checkbox.md
+++ b/docs/reference/controls/checkbox.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Control
---
+import CheckBoxTwoStateScreenshot from '/img/gitbook-import/assets/checkbox1.gif';
+import CheckBoxThreeStateScreenshot from '/img/gitbook-import/assets/checkbox2.gif';
+
# Check Box
The check box control presents a Boolean value where the true value is represented using a check mark, and the false value is an empty box. The check box has an option to present a nullable Boolean, where the null value represents 'unknown' and is drawn as a shaded box.
@@ -38,7 +41,7 @@ This is an example of two-state check boxes:
Looks like this when running on Windows:
-
+
This is an example of a three-state checkbox:
@@ -60,7 +63,7 @@ This is an example of a three-state checkbox:
Looks like this when running on Windows:
-
+
## More Information
diff --git a/docs/reference/controls/colorpicker/README.md b/docs/reference/controls/colorpicker/README.md
new file mode 100644
index 000000000..d5a708268
--- /dev/null
+++ b/docs/reference/controls/colorpicker/README.md
@@ -0,0 +1,90 @@
+---
+description: REFERENCE - Built-in Controls
+---
+
+import ColorPaletteFluent from '/img/controls/colorpicker/color-palette-fluent.png';
+import ColorPaletteFlat from '/img/controls/colorpicker/color-palette-flat.png';
+import ColorPaletteFlatHalf from '/img/controls/colorpicker/color-palette-flat-half.png';
+import ColorPaletteMaterial from '/img/controls/colorpicker/color-palette-material.png';
+import ColorPaletteMaterialHalf from '/img/controls/colorpicker/color-palette-material-half.png';
+import ColorPaletteSixteen from '/img/controls/colorpicker/color-palette-sixteen.png';
+
+# ColorPicker
+
+The `ColorPicker` provides a highly customizable, general-purpose control that users can use to select colors in RGB or HSV color space. This implementation is just as much about providing primitive controls that developers can use to build their own color pickers as it is about providing a ready-to-use picker.
+
+The `ColorPicker` includes a family of controls (components):
+
+ * `ColorSpectrum` (primitive) : A two dimensional spectrum for color selection.
+ * `ColorSlider` (primitive) : A slider with a background that represents a single color component.
+ * `ColorPreviewer` (primitive) : Shows a preview color with optional accent colors.
+ * `ColorView` : Presents a color for user editing using a spectrum, palette and component sliders.
+ * `ColorPicker` : Presents a color for user editing using a spectrum, palette and component sliders within a drop down. Editing is available when the drop down flyout is opened; otherwise, only the preview color is shown.
+
+Each primitive component can be used on its own and mixed/matched with others. This allows significant composability that isn't possible with other color picker implementations. For example, you can quickly bind together the `ColorSpectrum`, `ColorSlider` and `ColorPreviewer` primitives to create your own color picker with a brand-new design.
+
+Note on terminology: "color picker" usually refers to the family of controls while `ColorPicker` refers to the specific control.
+
+## Is this the right control?
+
+This control is intended to be used directly to select colors in a user-friendly, developer customizable way. This can be done using either a canvas-type `ColorView` control or a compact `ColorPicker` drop down.
+
+For apps with even more special-purpose needs, each control and primitive component can be independently customized to create a new color picker without having to re-implement all the advanced rendering and color logic. This is very useful to match a specific app's design and usability requirements.
+
+Developers using this control may:
+ 1. Use `ColorView` or `ColorPicker` as-is directly in their apps
+ 2. Customize `ColorView` or `ColorPicker` using the included properties. These properties allow significant changes to the control such as disabling components sliders, showing different palettes or hiding all but the spectrum tab.
+ 3. Create a new color picker to meet a specific app's design and usability requirements using the existing primitive components.
+ 4. Re-template the existing components to create a brand-new fully customized color picker.
+
+## Using in Your App
+
+Avalonia is used in several resource-constrained environments such as embedded devices. For this and other reasons, certain larger controls such as the `ColorPicker` are not included with the main Avalonia UI Nuget packages. This means a bit of extra work is required to add the `ColorPicker` to your app:
+
+ 1. Add the `Avalonia.Controls.ColorPicker` nuget to your project. This MUST match your version of Avalonia's other packages.
+ 2. Add control themes and styles for all color picker controls in `App.axaml` by adding:
+ * `` for Fluent themes **OR**
+ * `` for Simple themes
+
+:::note
+This step is not required for some theme packages such as FluentAvalonia which include all controls by default.
+:::
+
+## Background
+
+This control originated as a re-styling of the one in UWP (later WinUI) using the basic designs implemented for the Windows Community Toolkit. The WinUI `ColorPicker` isn't conducive to smaller screen sizes and the overall design/usability of the control left something to be desired for both users and developers.
+
+With all its features, the WinUI control still wasn't as good as it should be. It couldn't be re-templated and customized without a lot of effort (partially because individual components were highly inter-dependent on each other). It also used a lot of template parts and code-behind. The Avalonia UI version of the control (a complete rewrite) attempts to fix all of these issues and become the predominant XAML color picker design.
+
+Main improvements learning from WinUI were:
+ * The `ColorPicker` is implemented as a drop-down (matching all other "pickers"). There is also a `ColorView` control for those that want the canvas-type control (similar to WinUI).
+ * The Avalonia controls attempt to do everything possible in XAML control themes keeping code-behind to an absolute minimum. This significantly increases composability and enables app developers to customize every part of these controls (and even the primitives in most cases).
+ * Primitives such as the `ColorSlider` and `ColorSpectrum` are fully self-contained and can be used separately enabling app developers to create custom color picker implementations.
+ * A new `HsvColor` struct was added to base Avalonia itself (alongside `Color` and `HslColor`) and is now used in all color picker controls. This simplified code-behind and also made binding of color properties between primitives and controls possible. Color picker controls internally work in HSV color space.
+ * `HsvColor` along with `ColorSlider` together unlock a lot of power compared to WinUI (and enable easy re-templating).
+ * Many new properties (more than in WinUI) were added to control all aspects of the `ColorView` visibility. Each tab can be separately hidden along with most individual subsections. This allows a lot of design customization without having to re-template or use complex style selectors.
+ * Color palettes were added using the `IColorPalette` interface (same as the Windows Community Toolkit). No color palettes are supported in the WinUI version of this control.
+ * New properties such as `SelectedIndex` and `ColorModel` allow customizing the color picker and putting it into a pre-defined state. For example, the WinUI ColorPicker always defaults to RGB and this cannot be changed in code or XAML. This implementation does not have such limitations.
+
+## Controls & Primitives
+
+| Control | Link |
+|---------|------|
+| `ColorPicker` | |
+| `ColorView` | See the dedicated [`ColorView`](colorview.md) page. |
+| `ColorSpectrum` | |
+| `ColorSlider` | |
+| `ColorPreviewer` | |
+
+## Color Palettes
+
+Several pre-defined color palettes implementing the `IColorPalette` interface are provided. Instances of these palettes may be set to the `Palette` property of a `ColorView` or `ColorPicker`.
+
+| Palette | Description |
+|---------|-------------|
+| | Contains the Fluent color palette found in Windows 10 and later. This is the default color palette. |
+| | Contains the full [Flat UI color palette](https://github.com/designmodo/Flat-UI). |
+| | Contains half of [Flat UI color palette](https://github.com/designmodo/Flat-UI) for improved usability especially on mobile devices. |
+| | Contains most of the [Material design color palette](https://material.io/design/color/the-color-system.html#tools-for-picking-colors). In order to make the palette uniform and rectangular the following alterations were made 1. The A100-A700 shades of each color are excluded. These shades do not exist for all colors (Brown/Gray). 2. Black/White are stand-alone colors and are also excluded. |
+| | Contains half of the [Material design color palette](https://material.io/design/color/the-color-system.html#tools-for-picking-colors) shown above for improved usability especially on mobile devices. |
+| | Contains the standard [sixteen color palette](https://en.wikipedia.org/wiki/Web_colors#HTML_color_names) from the HTML 4.01 specification. |
diff --git a/docs/reference/controls/colorpicker/colorview.md b/docs/reference/controls/colorpicker/colorview.md
new file mode 100644
index 000000000..554799b93
--- /dev/null
+++ b/docs/reference/controls/colorpicker/colorview.md
@@ -0,0 +1,55 @@
+---
+description: REFERENCE - Built-in Controls
+---
+
+# ColorView
+
+Presents a color for user editing using a spectrum, palette and component sliders.
+
+## Common Properties
+
+| Property | Description |
+|----------|-------------|
+| `Color` | Gets or sets the currently selected color in the RGB color model. For control authors, use `HsvColor` instead to avoid loss of precision and color drifting. |
+| `ColorModel` | Gets or sets the active color model used by the sliders. This property is only applicable to the components tab. The spectrum tab must always be in HSV and the palette tab contains only pre-defined colors. |
+| `ColorSpectrumComponents` | Gets or sets the two HSV color components displayed by the spectrum. |
+| `ColorSpectrumShape` | Gets or sets the displayed shape of the spectrum. |
+| `HexInputAlphaPosition` | Gets or sets the position of the alpha component in the hexadecimal input box relative to all other color components. |
+| `HsvColor` | Gets or sets the currently selected color in the HSV color model. This should be used in all cases instead of the `Color` property. Internally, the `ColorSpectrum` uses the HSV color model and using this property will avoid loss of precision and color drifting. |
+| `IsAccentColorsVisible` | Gets or sets a value indicating whether accent colors are visible along with the preview color. |
+| `IsAlphaEnabled` | Gets or sets a value indicating whether the alpha component is enabled. When disabled (set to false) the alpha component will be fixed to maximum and editing controls disabled. |
+| `IsAlphaVisible` | Gets or sets a value indicating whether the alpha component editing controls (Slider(s) and TextBox) are visible. When hidden, the existing alpha component value is maintained. Note that `IsComponentTextInputVisible` also controls the alpha component TextBox visibility. |
+| `IsColorComponentsVisible` | Gets or sets a value indicating whether the color components tab/panel/page (subview) is visible. |
+| `IsColorModelVisible` | Gets or sets a value indicating whether the active color model indicator/selector is visible. |
+| `IsColorPaletteVisible` | Gets or sets a value indicating whether the color palette tab/panel/page (subview) is visible. |
+| `IsColorPreviewVisible` | Gets or sets a value indicating whether the color preview is visible. Note that accent color visibility is controlled separately by `IsAccentColorsVisible`. |
+| `IsColorSpectrumVisible` | Gets or sets a value indicating whether the color spectrum tab/panel/page (subview) is visible. |
+| `IsColorSpectrumSliderVisible` | Gets or sets a value indicating whether the color spectrum's third component slider is visible. |
+| `IsComponentSliderVisible` | Gets or sets a value indicating whether color component sliders are visible. All color components are controlled by this property but alpha can also be controlled with `IsAlphaVisible`. |
+| `IsComponentTextInputVisible` | Gets or sets a value indicating whether color component text inputs are visible. All color components are controlled by this property but alpha can also be controlled with `IsAlphaVisible`. |
+| `IsHexInputVisible` | Gets or sets a value indicating whether the hexadecimal color value text input is visible. |
+| `MaxHue` | Gets or sets the maximum value of the Hue component in the range from 0..359. This property must be greater than `MinHue`. |
+| `MaxSaturation` | Gets or sets the maximum value of the Saturation component in the range from 0..100. This property must be greater than `MinSaturation`. |
+| `MaxValue` | Gets or sets the maximum value of the Value component in the range from 0..100. This property must be greater than `MinValue`. |
+| `MinHue` | Gets or sets the minimum value of the Hue component in the range from 0..359. This property must be less than `MaxHue`. |
+| `MinSaturation` | Gets or sets the minimum value of the Saturation component in the range from 0..100. This property must be less than `MaxSaturation`. |
+| `MinValue` | Gets or sets the minimum value of the Value component in the range from 0..100. This property must be less than `MaxValue`. |
+| `PaletteColors` | Gets or sets the collection of individual colors in the palette. This is not commonly set manually. Instead, it should be set automatically by providing an `IColorPalette` to the `Palette` property. |
+| `PaletteColumnCount` | Gets or sets the number of colors in each row (section) of the color palette. Within a standard palette, rows are shades and columns are colors. This is not commonly set manually. Instead, it should be set automatically by providing an `IColorPalette` to the `Palette` property. |
+| `Palette` | Gets or sets the color palette. This will automatically set both `PaletteColors` and `PaletteColumnCount` overwriting any existing values. |
+| `SelectedIndex` | Gets or sets the index of the selected tab/panel/page (subview). When using the default control theme, this property is designed to be used with the `ColorViewTab` enum. The `ColorViewTab` enum defines the index values of each of the three standard tabs. Use like `SelectedIndex = (int)ColorViewTab.Palette`. |
+
+:::note
+The properties for visibility use the naming pattern "IsThingVisible" rather than "ShowThing" because some elements of the UI have the ability to control both enabled and visible status separately. Naming also matches `Control` in this case.
+:::
+
+## Pseudoclasses
+
+None
+
+## Template Parts
+
+| Name | Type | Description |
+|------|----- |-------------|
+| `PART_HexTextBox` | TextBox | Provides an input or output for hexadecimal color notation that can be parsed by the control. |
+| `PART_TabControl` | TabControl | The main control used to navigate through the spectrum, palette and components tab/panel/page (subviews). This template part is optional and is only required for some validation scenarios of the `SelectedIndex`. |
diff --git a/docs/reference/controls/combobox.md b/docs/reference/controls/combobox.md
index d09181b48..666021625 100644
--- a/docs/reference/controls/combobox.md
+++ b/docs/reference/controls/combobox.md
@@ -2,6 +2,10 @@
description: REFERENCE - Built-in Control
---
+import ComboBoxMaxDropDownHeightScreenshot from '/img/gitbook-import/assets/combobox1.gif';
+import ComboBoxComplexContentScreenshot from '/img/gitbook-import/assets/combobox2.gif';
+import ComboBoxDataTemplateScreenshot from '/img/gitbook-import/assets/combobox3.gif';
+
# Combo Box
The combo box presents a selected item and a drop-down button that displays a list of options. The length and height of the combo box are determined by the selected item, unless otherwise defined.
@@ -46,7 +50,7 @@ This is basic example with text items has a limit set on the drop-down list heig
```
-
+
This example uses a composed view for each item:
@@ -78,12 +82,10 @@ This example uses a composed view for each item:
```
-
+
This example binds the items in a combo box using a data template. The C# code-behind loads the installed font family names and binds them to the items property.
-
-
```xml
```
-
```csharp title='C#'
using Avalonia.Controls;
using Avalonia.Media;
@@ -120,9 +121,7 @@ namespace AvaloniaControls.Views
}
```
-
-
-
+
## More Information
diff --git a/docs/reference/controls/contextmenu.md b/docs/reference/controls/contextmenu.md
index e674535d5..30e438d5d 100644
--- a/docs/reference/controls/contextmenu.md
+++ b/docs/reference/controls/contextmenu.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import ContextMenuScreenshot from '/img/gitbook-import/assets/contextmenu.gif';
+
# Context Menu
The context menu can be applied to any host control to implement a right-click 'context sensitive' menu. This uses an **attached property** of the host control.
@@ -25,7 +27,7 @@ This example, a context menu is attached to a multi-line text box:
```
-
+
## Context Flyout
diff --git a/docs/reference/controls/datagrid/README.md b/docs/reference/controls/datagrid/README.md
index 89c0a186a..6b7e342e5 100644
--- a/docs/reference/controls/datagrid/README.md
+++ b/docs/reference/controls/datagrid/README.md
@@ -2,6 +2,11 @@
description: REFERENCE - Built-in Controls
---
+import DataGridNuGetScreenshot from '/img/gitbook-import/assets/image (8) (4).png';
+import DataGridSortColumnScreenshot from '/img/gitbook-import/assets/grid1.gif';
+import DataGridReorderColumnScreenshot from '/img/gitbook-import/assets/grid2.gif';
+import DataGridColumnTypesScreenshot from '/img/gitbook-import/assets/grid3.gif';
+
# Data Grid
The data grid displays repeating data in a customizable grid. The control can be styled, templated and bound.
@@ -20,9 +25,9 @@ The data grid is in an additional _Avalonia UI_ package. To use the data grid in
You must install the _NuGet_ package for the data grid, there are several ways of doing this. You can use **Manage NuGet Packages** from the project menu of your IDE:
-
+
-Alternatively, you can run this instruction from the command line:
+Alternatively, you can run this instruction from the command line:
```bash
dotnet add package Avalonia.Controls.DataGrid
@@ -31,7 +36,7 @@ dotnet add package Avalonia.Controls.DataGrid
Or add package reference directly to the project (`.csproj`) file:
```xml
-
+
```
:::warning
@@ -68,8 +73,6 @@ You will probably use these properties most often:
This example will generate a basic data grid, with column header names auto-generated from the item class. The items data source is bound to the main window view model.
-
-
```xml
```
-
```csharp title='C# View Model'
using AvaloniaControls.Models;
using System.Collections.Generic;
@@ -104,7 +106,6 @@ namespace AvaloniaControls.ViewModels
}
```
-
```csharp title='C# Item Class'
public class Person
{
@@ -119,9 +120,7 @@ public class Person
}
```
-
-
-
+
:::info
These examples use the MVVM pattern with data binding to an `ObservableCollection`. For more information on the concepts behind data binding, see [here](../../../basics/data/data-binding).
@@ -144,12 +143,10 @@ Property names from the item class will generally not make good column names. Th
```
-
+
This example shows how the data grid can accept changes and update the underlying collection, and use different column types to edit the data:
-
-
```xml
```
-
```csharp title='C# View Model'
using AvaloniaControls.Models;
using System.Collections.Generic;
@@ -188,7 +184,6 @@ namespace AvaloniaControls.ViewModels
}
```
-
```csharp title='C# Item Class'
public class Person
{
@@ -205,9 +200,7 @@ public class Person
}
```
-
-
-
+
## More Information
diff --git a/docs/reference/controls/datagrid/datagridcolumns.md b/docs/reference/controls/datagrid/datagridcolumns.md
index b20b31d1a..0324c9551 100644
--- a/docs/reference/controls/datagrid/datagridcolumns.md
+++ b/docs/reference/controls/datagrid/datagridcolumns.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import DataGridColumnPreviewScreenshot from '/img/gitbook-import/assets/image (4) (1).png';
+
# Data Grid Columns
A data grid can contain multiple data grid columns and _Avalonia UI_ has two built-in column types which can be used to display a different data types, and a template type that can customise the column appearance.
@@ -50,8 +52,6 @@ Example
This example improves a data grid by expanding two columns equally across the width:
-
-
```xml
@@ -71,7 +71,6 @@ This example improves a data grid by expanding two columns equally across the wi
```
-
```csharp title='C# View Model'
using AvaloniaControls.Models;
using System.Collections.Generic;
@@ -97,7 +96,6 @@ namespace AvaloniaControls.ViewModels
}
```
-
```csharp title='C# Item Class'
public class Person
{
@@ -112,11 +110,9 @@ public class Person
}
```
-
-
It works in the preview pane because the `` element creates a view model to bind to:
-
+
## More Information
diff --git a/docs/reference/controls/datepicker.md b/docs/reference/controls/datepicker.md
index bdeea0963..bfd995437 100644
--- a/docs/reference/controls/datepicker.md
+++ b/docs/reference/controls/datepicker.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import DatePickerScreenshot from '/img/gitbook-import/assets/datepicker.gif';
+
# Date Picker
The date picker has three 'spinner' controls to allow the user to pick a date value. The spinners display when the control is clicked.
@@ -22,7 +24,7 @@ This example uses the date format attribute to display the name of the day as we
```
-
+
## **Initializing the Date**
diff --git a/docs/reference/controls/detailed-reference/border.md b/docs/reference/controls/detailed-reference/border.md
index d4de07860..86f87ad98 100644
--- a/docs/reference/controls/detailed-reference/border.md
+++ b/docs/reference/controls/detailed-reference/border.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import BorderPodLookScreenshot from '/img/gitbook-import/assets/image (8) (1).png';
+import BorderDropShadowScreenshot from '/img/gitbook-import/assets/image (24) (2).png';
+
# Border
The border control decorates a (single) child with a border and background. It can also be used to display rounded corners.
@@ -29,7 +32,7 @@ When all four values are in the list, _Avalonia UI_ will interpret them using th
`CornerRadius="TopLeft TopRight BottomRight BottomLeft"`
:::warning
-If you use the four value pattern; you must provide all four values, even if one of them is zero. Three values are not permitted in the list.
+If you use the four value pattern; you must provide all four values, even if one of them is zero. Three values are not permitted in the list.
:::
### Example
@@ -55,7 +58,7 @@ This example adds some border controls to create a 'pod' look in the layout:
```
-
+
## Box Shadows
@@ -96,7 +99,7 @@ This is an example of a drop-shadow:
```
-
+
## More Information
diff --git a/docs/reference/controls/detailed-reference/calendar/README.md b/docs/reference/controls/detailed-reference/calendar/README.md
index 5efa5ef2a..b9a386dd5 100644
--- a/docs/reference/controls/detailed-reference/calendar/README.md
+++ b/docs/reference/controls/detailed-reference/calendar/README.md
@@ -2,11 +2,16 @@
description: REFERENCE - Built-in Controls
---
+import CalendarBasicUsageScreenshot from '/img/gitbook-import/assets/calendar3.gif';
+import CalendarSingleSelectionScreenshot from '/img/gitbook-import/assets/calendar.gif';
+import CalendarMultipleSelectionScreenshot from '/img/gitbook-import/assets/calendar2.gif';
+import CalendarCustomRangeScreenshot from '/img/gitbook-import/assets/calendar4.gif';
+
# Calendar
The calendar is a control for users to select dates or date ranges.
-
+
## Useful Properties
@@ -26,7 +31,7 @@ This is a basic calendar allowing a single date selection. The calendar's select
```
-
+
This example allows multiple range selections:
@@ -38,7 +43,7 @@ This example allows multiple range selections:
After clicking a start date you can extend a single range by holding the shift key and clicking on the end date. You can add extra dates and ranges by holding the control key and clicking on other dates.
-
+
This example has custom start and end dates, and some dates unavailable. This uses C# code behind the window.
@@ -68,7 +73,7 @@ public partial class MainWindow : Window
-
+
## More Information
diff --git a/docs/reference/controls/detailed-reference/calendar/calendar-date-picker.md b/docs/reference/controls/detailed-reference/calendar/calendar-date-picker.md
index 15386ab20..ff9d76a39 100644
--- a/docs/reference/controls/detailed-reference/calendar/calendar-date-picker.md
+++ b/docs/reference/controls/detailed-reference/calendar/calendar-date-picker.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import CalendarDatePickerScreenshot from '/img/gitbook-import/assets/calendardatepicker.gif';
+
# Calendar Date Picker
This is an extension of the calendar control that includes a text box and button. The calendar shows when the user clicks the button (and hides on a subsequent click). The selected date shows in the text box when a date on the calendar is clicked.
@@ -22,7 +24,7 @@ This example shows a basic single date selection calendar when the button is cli
```
-
+
## More Information
diff --git a/docs/reference/controls/detailed-reference/menu-flyout.md b/docs/reference/controls/detailed-reference/menu-flyout.md
index 40e6802d9..ff4472eef 100644
--- a/docs/reference/controls/detailed-reference/menu-flyout.md
+++ b/docs/reference/controls/detailed-reference/menu-flyout.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import MenuFlyoutScreenshot from '/img/gitbook-import/assets/menuflyout.gif';
+
# Menu Flyout
A menu flyout allows you to host a simple menu as the flyout for a control. You might use this as an alternative to the context menu.
@@ -32,12 +34,12 @@ This is a simple example of the menu flyout:
```
:::info
-Note the `` element will not work in a menu flyout. To make a separator line, use a `
```
-
+
## More Information
diff --git a/docs/reference/controls/slider.md b/docs/reference/controls/slider.md
index 2bb4bba5f..ae4923be4 100644
--- a/docs/reference/controls/slider.md
+++ b/docs/reference/controls/slider.md
@@ -2,9 +2,11 @@
description: REFERENCE - Built-in Controls
---
+import SliderScreenshot from '/img/gitbook-import/assets/slider.gif';
+
# Slider
-The slider control presents its numerical value as the relative position of a slider button along the length of a track. The position is relative to maximum and minimum values.
+The slider control presents its numerical value as the relative position of a slider button along the length of a track. The position is relative to maximum and minimum values.
Drag interaction on the slider button can alter the value between the maximum and minimum values. Keyboard and click interactions can also nudge the value.
@@ -34,7 +36,7 @@ Here the maximum and minimum values are default (0 and 100 respectively).
The slider looks like this on Windows:
-
+
## More Information
diff --git a/docs/reference/controls/splitview.md b/docs/reference/controls/splitview.md
index 2817b3c10..082a2a723 100644
--- a/docs/reference/controls/splitview.md
+++ b/docs/reference/controls/splitview.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import SplitViewScreenshot from '/img/gitbook-import/assets/image (5) (5) (1).png';
+import SplitViewCompactScreenshot from '/img/gitbook-import/assets/splitview2.gif';
+
# Split View
A split view presents a container with two parts: the main content zone and a side pane. The main content zone is always visible. The pane can be expanded and collapsed. The collapsed pane can be completely hidden, or left slightly open - with enough space to host some icon buttons for example.
@@ -57,13 +60,13 @@ The display mode property controls how the pane is drawn in its open and closed
The control looks like this, running on Windows:
-
+
## Compact Display Mode
You can use the MVVM pattern with the split view control and one of the compact display mode settings to implement a 'tool pane' style UI. There is enough room on the pane when it is closed to display an icon button that opens the pane.
-
+
:::info
To learn how to use the split view control in this way, see the guide [here](../../guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md).
diff --git a/docs/reference/controls/stackpanel.md b/docs/reference/controls/stackpanel.md
index a3c1c73f7..55b5fb89d 100644
--- a/docs/reference/controls/stackpanel.md
+++ b/docs/reference/controls/stackpanel.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import StackPanelVerticalRectanglesScreenshot from '/img/gitbook-import/assets/image (14) (2).png';
+
# Stack Panel
The stack panel arranges its child controls by stacking them horizontally or vertically. The stack panel is often used to arrange a small subsection of the UI on a page.
@@ -34,7 +36,7 @@ The following XAML shows how to create a vertical stack panel.
The result shows the child controls stretched to fit the width, and the overall height of the stack panel equal to the sum of the child control heights.
-
+
## More Information
diff --git a/docs/reference/jetbrains-rider-ide/jetbrains-rider-setup.md b/docs/reference/jetbrains-rider-ide/jetbrains-rider-setup.md
index cb71a6cc2..eeebdffef 100644
--- a/docs/reference/jetbrains-rider-ide/jetbrains-rider-setup.md
+++ b/docs/reference/jetbrains-rider-ide/jetbrains-rider-setup.md
@@ -2,19 +2,24 @@
description: REFERENCE
---
+import RiderWelcomeScreenshot from '/img/gitbook-import/assets/jetbrains-rider-setup-1-rider-welcome.png';
+import RiderConfigurePluginReposScreenshot from '/img/gitbook-import/assets/jetbrains-rider-setup-2-configure-plugin-repos.png'
+import RiderEnterPluginRepoScreenshot from '/img/gitbook-import/assets/jetbrains-rider-setup-3-enter-plugin-repo.png';
+import RiderInstallAvaloniaPluginScreenshot from '/img/gitbook-import/assets/jetbrains-rider-setup-4-plugin-install.png';
+
# JetBrains Rider Setup
To set up _JetBrains Rider_ for developing with _Avalonia UI,_ follow this procedure:
- Download and install the .NET SDK of your choice from _Microsoft_. This contains the runtime, development kit (compiler, etc) that is used to build _Avalonia UI_ applications.
-- Install the _Avalonia UI_ templates by running the command `dotnet new install Avalonia.Templates` from the command prompt on your machine.
+- Install the _Avalonia UI_ templates by running the command `dotnet new install Avalonia.Templates` from the command prompt on your machine.
:::info
For the latest .NET SDK downloads, see [here](https://dotnet.microsoft.com/download).
:::
:::info
-For SDK versions before .NET 7, you will need to run the command `dotnet new -i Avalonia.Templates`
+For SDK versions before .NET 7, you will need to run the command `dotnet new -i Avalonia.Templates`
:::
The output will look similar to this.
@@ -39,29 +44,32 @@ $
```
:::info
-To download _JetBrains Rider,_ see [here](https://www.jetbrains.com/rider/).
+To download _JetBrains Rider,_ see [here](https://www.jetbrains.com/rider/).
:::
Rider will give you the very best development experience available for _Avalonia UI_. It is available for Windows, Linux, and macOS. Rider supports XAML out of the box. However, if you want to use the XAML previewer, you will need the Avalonia plugin.
## Install the Avalonia Plugin
-Once Rider loads you will see the **Welcome to JetBrains Rider** screen.
+Once Rider loads you will see the **Welcome to JetBrains Rider** screen.
- Click **Configure**, and then click **Plugins** on the dropdown menu.
-
-The **Preferences** screen will open.
+
+The **Preferences** screen will open.
- Click the settings (gear wheel) icon and then click **Manage Plugin Repositories...** on the popup menu.
-
+
+
- In the **Custom Plugin Repositories** dialog, click the plus (+) icon and enter the URL `https://plugins.jetbrains.com/plugins/dev/14839`, and then click **OK**.
-
-- Back at the Preferences window, click **Marketplace** enter 'Avalonia' in the search. Click **AvaloniaRider** when it appears in the search results pane, then click **Install**.
+
+
+- Back at the Preferences window, click **Marketplace** enter 'Avalonia' in the search. Click **AvaloniaRider** when it appears in the search results pane, then click **Install**.
+
+
-
- After the installation has completed, click **Restart IDE** (button appears).
- Now _JetBrains Rider_ is ready to develop _Avalonia UI_ applications.
+Now _JetBrains Rider_ is ready to develop _Avalonia UI_ applications.
diff --git a/docs/stay-up-to-date/upgrade-from-0.10.md b/docs/stay-up-to-date/upgrade-from-0.10.md
index a6cbf2520..ab64996f4 100644
--- a/docs/stay-up-to-date/upgrade-from-0.10.md
+++ b/docs/stay-up-to-date/upgrade-from-0.10.md
@@ -280,7 +280,7 @@ var focusManager = TopLevel.GetTopLevel(control).FocusManager;
In addition, the `IFocusManager` API has been changed.
-- To get the currently focused element, use `IFocusManager.GetFocusedEleemnt()`
+- To get the currently focused element, use `IFocusManager.GetFocusedElement()`
- To focus a control use `control.Focus()`
There is currently no event for listening to focus changes on `IFocusManager`. To listen for focus changes, add a listener to the `InputElement.GotFocusEvent`:
diff --git a/docs/tutorials/index.md b/docs/tutorials/index.md
index 06fb0ca7a..c35a3a8d5 100644
--- a/docs/tutorials/index.md
+++ b/docs/tutorials/index.md
@@ -14,7 +14,7 @@ A simple to do list application using the Model View View-Model (MVVM) pattern,
* `IObservable<>`
* `Observable.Merge()` with `Select()`, `Take()`, and `Subscribe()` methods.
-This is a very good introduction to the MVVM and _ReactiveUI_ techniques recommended for _Avalonia UI_ programming. Follow the tutorial [here](todo-list-app/).
+This is a very good introduction to the MVVM and _ReactiveUI_ techniques recommended for _Avalonia UI_ programming. Follow the tutorial [here](./todo-list-app/).
## Music Store App
@@ -28,4 +28,4 @@ It uses the _JetBrains Rider_ IDE running on macOS, but the steps will be equiva
The app features a highly graphical application using the MVVM pattern, and including how to display a dialog, present images and collections of data, and implement data persistence.
-Follow this demonstration [here](music-store-app/).
+Follow this demonstration [here](./music-store-app/).
diff --git a/docs/tutorials/music-store-app/add-and-layout-controls.md b/docs/tutorials/music-store-app/add-and-layout-controls.md
index 196592ed4..136abb1cc 100644
--- a/docs/tutorials/music-store-app/add-and-layout-controls.md
+++ b/docs/tutorials/music-store-app/add-and-layout-controls.md
@@ -2,6 +2,11 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreBuyButtonScreenshot from './images/buy-button.png';
+import MusicStoreFinishedAddButtonScreenshot from '/img/gitbook-import/assets/image (13) (2).png';
+import MusicStoreAddStylesScreenshot from './images/add-styles.png';
+import MusicStorePrettyButtonScreenshot from './images/pretty-button.png';
+
# Add and Layout Controls
The main window of the app will eventually show a list of album covers in the user's collection, with a button at its top-right corner to allow the user to add a new album. The button will open a search dialog window to find new albums to add.
@@ -34,7 +39,7 @@ To display a button in the content zone of the main window, follow this procedur
- Click **Debug** to compile and run the project.
-![](images/buy-button.png)
+
You will see the button, but it is in the default position and not at the top-right of the window as required.
@@ -58,9 +63,7 @@ You should see all these changes reflected in the preview pane as you add them.&
Have a look back at the image of the finished app [here](./).
-
-
-
+
You will see that the button shows an icon, and not text (as it currently does). This is actually the Microsoft Store icon from the Fluent Icons collection, and _Avalonia UI_ has definitions for all these for you to use.
@@ -77,7 +80,7 @@ To use the Microsoft Store icon, follow this procedure:
- In the _Rider s_olution explorer, right-click the project.
- Click **Add**, then click **Avalonia Styles**
-![](images/add-styles.png)
+
- Enter the **Name** 'Icons', press enter.
- Locate and open the new **Icons.axaml** file that is created. The XAML will look like this:
@@ -148,6 +151,6 @@ To change the button from text to icon content, follow this procedure:
- Click **Debug** to compile and run the project.
-![](images/pretty-button.png)
+
On the next page, you will learn how to link the button in the view (of the MVVM pattern) to a command in the view model, so it can act on the application logic there.
diff --git a/docs/tutorials/music-store-app/add-content-to-dialog.md b/docs/tutorials/music-store-app/add-content-to-dialog.md
index e7ab61ebf..b4e28a785 100644
--- a/docs/tutorials/music-store-app/add-content-to-dialog.md
+++ b/docs/tutorials/music-store-app/add-content-to-dialog.md
@@ -2,15 +2,15 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreDialogContentDiagram from '/img/gitbook-import/assets/image (9) (3).png';
+
# Add Dialog Content
On the this page you will learn how to add some content to the dialog window. This will be some controls for the search and a dialog close button; together with a list of placeholders for the album covers - these will eventually be loaded as the results of the search.
-To arrange the dialog controls, you will use the dock panel layout control, that is part of the _Avalonia UI_ built-in controls. This will keep the search controls at the top of the dialog, and the button at the bottom, whatever the height. The list will be the 'fill' area of the dock panel, so it will always take up all the remaining content zone.
+To arrange the dialog controls, you will use the dock panel layout control, that is part of the _Avalonia UI_ built-in controls. This will keep the search controls at the top of the dialog, and the button at the bottom, whatever the height. The list will be the 'fill' area of the dock panel, so it will always take up all the remaining content zone.
-
-
-
+
:::info
For full information on the dock panel control, see the reference [here](../../reference/controls/dockpanel.md).
@@ -25,7 +25,7 @@ This is a common pattern of UI Composition, to read about this concept, see [her
Follow this procedure to add the user control and constituent controls for the dialog:
- Stop the app if it is still running.
-- In the solution explorer, right-click the **/Views** folder and then click **Add**.
+- In the solution explorer, right-click the **/Views** folder and then click **Add**.
- Click **Avalonia User Control**.
- When prompted for the name, type 'MusicStoreView'.
- Press enter.
@@ -54,7 +54,7 @@ Now the next step is for you to add the new user control to the content zone of
To add the user control, follow this procedure:
-- Locate and open the **MusicStoreWindow.axaml** file.
+- Locate and open the **MusicStoreWindow.axaml** file.
- Add the namespace for the views to the `` element:
```xml
@@ -72,4 +72,4 @@ To add the user control, follow this procedure:
You will see the controls appear in the preview pane.
-On the next page, you will learn how to use a mock for the album search feature - this is so that you can create the view and view model for the results, and leave the implementation of the real search until later.
+On the next page, you will learn how to use a mock for the album search feature - this is so that you can create the view and view model for the results, and leave the implementation of the real search until later.
diff --git a/docs/tutorials/music-store-app/add-items-to-users-collection.md b/docs/tutorials/music-store-app/add-items-to-users-collection.md
index 434e7ec22..bc2c23d21 100644
--- a/docs/tutorials/music-store-app/add-items-to-users-collection.md
+++ b/docs/tutorials/music-store-app/add-items-to-users-collection.md
@@ -2,6 +2,8 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreAddedAlbumsScreenshot from './images/image-20210310175949319.png';
+
# Add Items to the User's Collection
On this page you will implement a collection of albums that the user has selected using the search dialog and the **Buy Album** button, and display them in the main window.
@@ -45,7 +47,7 @@ Next you will add XAML to the main window view to display the items in the obser
To add the items control and its data template, follow this procedure:
- Locate and open the **MainWindow.axaml** file.
-- Add the following namespace declaraton to the `` element:
+- Add the following namespace declaration to the `` element:
```
xmlns:views="clr-namespace:Avalonia.MusicStore.Views"
@@ -69,8 +71,6 @@ xmlns:views="clr-namespace:Avalonia.MusicStore.Views"
```
-
-
- Click **Debug** to compile and run the project.
- Click the icon button.
- Type some search text.
@@ -78,7 +78,7 @@ xmlns:views="clr-namespace:Avalonia.MusicStore.Views"
- Click **Buy Album**.
- Repeat another time.
-![](images/image-20210310175949319.png)
+
You will see the user's album collection building as you search and select. However, if you stop the app running and then start it again, the collection reverts to empty.
diff --git a/docs/tutorials/music-store-app/album-view.md b/docs/tutorials/music-store-app/album-view.md
index a06ae8659..028a6b013 100644
--- a/docs/tutorials/music-store-app/album-view.md
+++ b/docs/tutorials/music-store-app/album-view.md
@@ -2,6 +2,10 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreBeforeTemplateScreenshot from '/img/gitbook-import/assets/image (6) (1) (3) (1).png';
+import MusicStoreBeforeWrapPanelScreenshot from './images/image-20210310010932979.png';
+import MusicStoreWrapPanelScreenshot from './images/image-20210310011526700.png';
+
# Album View
On this page you will continue developing the search results list for the app by replacing the text currently shown with graphical album tiles.
@@ -14,7 +18,7 @@ To add the music note icon resource, follow this procedure:
- Stop the app if it is still running.
- Navigate to the _Avalonia UI_ _GitHub_ to find the list of Fluent Icons at [https://avaloniaui.github.io/icons.html](https://avaloniaui.github.io/icons.html)
-- Use your browser's text search to locate the name of the icon 'music\_regular'. There should be some code similar to:
+- Use your browser's text search to locate the name of the icon 'music_regular'. There should be some code similar to:
```markup
M11.5,2.75 C11.5,2.22634895 12.0230228,1.86388952 12.5133347,2.04775015 L18.8913911,4.43943933 C20.1598961,4.91511241 21.0002742,6.1277638 21.0002742,7.48252202 L21.0002742,10.7513533 C21.0002742,11.2750044 20.4772513,11.6374638 19.9869395,11.4536032 L13,8.83332147 L13,17.5 C13,17.5545945 12.9941667,17.6078265 12.9830895,17.6591069 C12.9940859,17.7709636 13,17.884807 13,18 C13,20.2596863 10.7242052,22 8,22 C5.27579485,22 3,20.2596863 3,18 C3,15.7403137 5.27579485,14 8,14 C9.3521238,14 10.5937815,14.428727 11.5015337,15.1368931 L11.5,2.75 Z M8,15.5 C6.02978478,15.5 4.5,16.6698354 4.5,18 C4.5,19.3301646 6.02978478,20.5 8,20.5 C9.97021522,20.5 11.5,19.3301646 11.5,18 C11.5,16.6698354 9.97021522,15.5 8,15.5 Z M13,3.83223733 L13,7.23159672 L19.5002742,9.669116 L19.5002742,7.48252202 C19.5002742,6.75303682 19.0477629,6.10007069 18.3647217,5.84393903 L13,3.83223733 Z
@@ -58,9 +62,7 @@ The album view model will eventually contain data for the name of an album, the
As you saw on the last page, at this point the album list currently just shows the (fully qualified) name of the album view model class.
-
-
-
+
In this step you will be using the view locator class (**ViewLocator.cs** file) that was added to the project by the solution template. This class was registered (by the solution template) as a data template at the highest level in the app in the **App.axaml** file. The data template registration looks like this:
@@ -102,7 +104,7 @@ public class AlbumViewModel : ViewModelBase
- Click **Debug** to compile and run the project.
- Click the icon button.
-![](images/image-20210310010932979.png)
+
The view locator is finding the view `AlbumView` to use as a data template for the list items.
@@ -135,6 +137,6 @@ To tidy up the list, follow this procedure:
- Click **Debug** to compile and run the project.
- Click the icon button.
-![](images/image-20210310011526700.png)
+
On the next page, you will add some business logic in the form of a data service, so that you can get real album data from the search.
diff --git a/docs/tutorials/music-store-app/creating-a-modern-looking-window.md b/docs/tutorials/music-store-app/creating-a-modern-looking-window.md
index 9b0b0bf4f..5e0044ce2 100644
--- a/docs/tutorials/music-store-app/creating-a-modern-looking-window.md
+++ b/docs/tutorials/music-store-app/creating-a-modern-looking-window.md
@@ -2,6 +2,10 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreDarkModePreviewScreenshot from './images/dark-mode-preview.png';
+import MusicStoreAcrylicMaterialScreenshot from './images/acrylic-material.png';
+import MusicStoreFullAcrylicWindowScreenshot from './images/full-acrylic-window.png';
+
# Window Styling
On this page, you will make the main window look modern by applying a dark theme, and an acrylic blur to the window background.
@@ -12,7 +16,7 @@ Follow this procedure to style the main window in 'dark' mode:
- Stop the app if it is still running.
- Locate and open the file **App.axaml**.
-- In the XAML, change the `RequestedThemeVariant` attribute in the `` element from "Default" to "Dark"
+- In the XAML, change the `RequestedThemeVariant` attribute in the `` element from "Default" to "Dark"
```markup
## Acrylic Blur
@@ -65,7 +69,7 @@ Follow this procedure to style the background of the main window with an acrylic
- Click **Debug** (top right of the IDE) to compile and run the project.
-![](images/acrylic-material.png)
+
Notice that, as expected, the acrylic window effect covers the content zone of the main window. However the effect does not yet extend to the title bar.
@@ -76,7 +80,7 @@ Note that _Linux_ users can not yet take advantage of the following code due to
Follow this procedure to extend the acrylic blur effect onto the title bar:
- Stop the app if is still running.
-- Find the end of the opening tag of the `` element again.
+- Find the end of the opening tag of the `` element again.
- Add the `ExtendClientAreaToDecorationsHint` attribute as shown:
```markup
@@ -89,6 +93,6 @@ Follow this procedure to extend the acrylic blur effect onto the title bar:
- Click **Debug** to compile and run the project.
-![](images/full-acrylic-window.png)
+
-Now you have the acrylic blur effect extending into the title bar. On the next page you will learn how to add and layout a control in the window.
+Now you have the acrylic blur effect extending into the title bar. On the next page you will learn how to add and layout a control in the window.
diff --git a/docs/tutorials/music-store-app/creating-the-project.md b/docs/tutorials/music-store-app/creating-the-project.md
index 2878e481c..6d7ce5b6c 100644
--- a/docs/tutorials/music-store-app/creating-the-project.md
+++ b/docs/tutorials/music-store-app/creating-the-project.md
@@ -2,6 +2,11 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreCreateSolutionScreenshot from './images/CreateSolution.png';
+import MusicStoreProjectStructureScreenshot from './images/project-structure.png';
+import MusicStoreRiderDebugButtonScreenshot from './images/debug-button.png'
+import MusicStoreNewAppScreenshot from './images/image-20210310192926578.png'
+
# Create a New Project
On this page you will lean how to create a new project for the app.
@@ -22,22 +27,16 @@ With the solution templates installed, begin this tutorial by following these in
- Enter the **Solution name** as 'Avalonia.MusicStore'.
- Click **Create**.
-
-
-
+
A new project will be created with the following solution folders and files:
-
-
-
+
Take some time to review the files and folders that the solution template created. You will see that the following the MVVM pattern, these folders were created:
Folder Name
Description
Assets
Contains any embedded assets that are compiled into the program. Images, Icons, Fonts etc, anything that the UI might need to display,
Models
This is an empty folder for code that is the 'model' part of the MVVM pattern. This often contains everything else the app needs that is not part of the UI. For example: interaction with a database, Web API, or interfaces with a hardware device.
View Models
This is a folder for all the view models in the project, and it already contains an example. View models contain the application logic in the MVVM pattern. For example: a button is enabled only when the user has typed something; or open a dialog when the user clicks here; or show an error if the user enters too high a number type of logic in this input.
Views
This is a folder for all the views in the project, and it already contains the view for the application main window. Views in the MVVM pattern contain only the presentation for the application; that is layout and form, fonts, colors, icons and images. In MVVM they have only enough code to link them to the view model layer. In Avalonia UI there is only enough code to manage windows and dialogs here.
-
-
:::info
To explore the concepts behind the MVVM pattern, and when is appropriate to use it, see [here](../../concepts/the-mvvm-pattern/).
:::
@@ -48,10 +47,10 @@ The solution template has created enough files for the application to run. You w
Press the debug button top-right of the IDE to compile and run the project.
-![](images/debug-button.png)
+
This will show a window that looks like:
-![](images/image-20210310192926578.png)
+
It is a little plain - but you now have a running application, and a blank canvas to start developing with. On the next page you will learn how to add a modern-looking acrylic blur dark background.
diff --git a/docs/tutorials/music-store-app/displaying-images.md b/docs/tutorials/music-store-app/displaying-images.md
index 694a8fd4e..a1bde4a1a 100644
--- a/docs/tutorials/music-store-app/displaying-images.md
+++ b/docs/tutorials/music-store-app/displaying-images.md
@@ -2,9 +2,11 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreDisplayingImagesScreenshot from './images/image-20210310173858088.png';
+
# Displaying Images
-On this page, you will learn how to retrieve the cover art bitmap for each album in the search results. You will then be able to display the image on each album tile view instead of the placeholder note icon.
+On this page, you will learn how to retrieve the cover art bitmap for each album in the search results. You will then be able to display the image on each album tile view instead of the placeholder note icon.
## Album Service
@@ -34,13 +36,13 @@ public async Task LoadCoverBitmapAsync()
}
```
-This method returns a stream that can be used to load a bitmap from, either from a cache file or from the API.
+This method returns a stream that can be used to load a bitmap from, either from a cache file or from the API.
:::info
-Note that the cache is not active at this time, you will implement it later in the tutorial.
+Note that the cache is not active at this time, you will implement it later in the tutorial.
:::
-- So that you will see as soon as the cache becomes active, place a debug breakpoint at the following line:
+- So that you will see as soon as the cache becomes active, place a debug breakpoint at the following line:;
```csharp
return File.OpenRead(CachePath + ".bmp");
@@ -51,7 +53,7 @@ return File.OpenRead(CachePath + ".bmp");
In this step , you will add a property to the album view model to store the cover art as a bitmap.
:::warning
-Note: You must reference `Avalonia.Media.Imaging` in the album view model because you must use the _Avalonia UI_ bitmap here, and **not** the .NET `System.Bitmap`.
+Note: You must reference `Avalonia.Media.Imaging` in the album view model because you must use the _Avalonia UI_ bitmap here, and **not** the .NET `System.Bitmap`.
:::
Follow this procedure to update the album view model:
@@ -90,13 +92,13 @@ Take some time to examine this code because it gives an insight into manipulatin
This means that you will not waste large amounts of memory to display the album cover art, even though the Web API returns quite large files.
-Also notice how the `LoadCover` method is coded to run asynchronously, and on a background thread. This is so that the UI thread does not get blocked and make the UI unresponsive.
+Also notice how the `LoadCover` method is coded to run asynchronously, and on a background thread. This is so that the UI thread does not get blocked and make the UI unresponsive.
## Load Cover Art
-In this step you will alter the album search (in the music store view model) so that the cover art is loaded for each album that is found. To maintain the responsiveness of the app, you will make this process both asynchronous and cancellable.
+In this step you will alter the album search (in the music store view model) so that the cover art is loaded for each album that is found. To maintain the responsiveness of the app, you will make this process both asynchronous and cancellable.
-Firstly, you will need to add a method that can start loading the album covers whenever search results are returned. You will make this method asynchronous and cancellable.
+Firstly, you will need to add a method that can start loading the album covers whenever search results are returned. You will make this method asynchronous and cancellable.
To add the method to load album cover art, follow this procedure:
@@ -126,7 +128,7 @@ The cancellation token argument will allow you to stop the method loading album
## Cancellable Image Load
-In this step you will call the `LoadCovers` method in the `DoSearch` method (in the music store view model) but with full cancellation management.
+In this step you will call the `LoadCovers` method in the `DoSearch` method (in the music store view model) but with full cancellation management.
Follow this procedure:
@@ -146,7 +148,7 @@ var cancellationToken = _cancellationTokenSource.Token;
So if there is an existing request still loading album art, this will cancel it. Again, because `_cancellationTokenSource` might be replaced asynchronously by anther thread, you have to work with a copy stored as a local variable.
-- Add the following code to the end of `DoSearch` method:
+- Add the following code to the end of `DoSearch` method:
```csharp
if (!cancellationToken.IsCancellationRequested)
@@ -199,21 +201,21 @@ Follow this procedure:
- Add this data binding and converter to the panel element below:
```
-IsVisible="{Binding Cover, Converter={x:Static ObjectConverters.IsNull}}"
+IsVisible="{Binding Cover, Converter={x:Static ObjectConverters.IsNotNull}}"
```
A converter is an extension of a data binding expression that can convert the binding value before it is passed to the bound control. The `IsNull` converter returns a Boolean that is true when the value object is null.
:::info
-For more information about the _Avalonia UI_ built-in binding converters, see the reference [here](../../reference/built-in-data-binding-converters.md).
+For more information about the _Avalonia UI_ built-in binding converters, see the reference [here](../../reference/built-in-data-binding-converters.md).
:::
- Click **Debug** to compile and run the project.
- Click the icon button.
- Type some search text.
-![](images/image-20210310173858088.png)
+
Notice how the album covers load one by one, and the UI remains responsive.
-On the next page, you will learn how to return the selected album from dialog, when the user clicks **Buy Album**.
+On the next page, you will learn how to return the selected album from dialog, when the user clicks **Buy Album**.
diff --git a/docs/tutorials/music-store-app/index.md b/docs/tutorials/music-store-app/index.md
index c1446de3a..a5fd61f81 100644
--- a/docs/tutorials/music-store-app/index.md
+++ b/docs/tutorials/music-store-app/index.md
@@ -2,20 +2,22 @@
description: TUTORIALS
---
+import MusicStoreFinishedAppScreenshot from './images/image-20210310184538120.png';
+
# Music Store App
In this tutorial you will create a desktop app based on the idea of a music store. The app is highly graphical - it presents images of album covers, and uses semi-transparent 'acrylic' blurred window backgrounds to give a very up-to-date look. By the end of the tutorial, you will be able search the iTunes online list of albums, and select albums for your own list.
-![](images/image-20210310184538120.png)
+
-In this tutorial you will use the MVVM pattern with the _ReactiveUI_ framework to manage multiple application windows. Also you will use advanced asynchronous techniques to implement the album search and other features, so that application responsiveness is maintained.
+In this tutorial you will use the MVVM pattern with the _ReactiveUI_ framework to manage multiple application windows. Also you will use advanced asynchronous techniques to implement the album search and other features, so that application responsiveness is maintained.
:::warning
-This is a more advanced tutorial. The 'To Do List App' is a recommended prerequisite if you have limited experience with the MVVM pattern. Read about the 'To Do List App' tutorial [here](../todo-list-app/).
+This is a more advanced tutorial. The 'To Do List App' is a recommended prerequisite if you have limited experience with the MVVM pattern. Read about the 'To Do List App' tutorial [here](../todo-list-app/).
:::
:::info
-For information and background on the concept of the MVVM pattern, see [here](../../concepts/the-mvvm-pattern/).
+For information and background on the concept of the MVVM pattern, see [here](../../concepts/the-mvvm-pattern/).
:::
This tutorial contains instructions for using the _Rider_ IDE on macOS; however the steps will be similar on other operating systems, and using other IDEs such as Visual Studio on _Microsoft Windows_.
diff --git a/docs/tutorials/music-store-app/load-data-at-startup.md b/docs/tutorials/music-store-app/load-data-at-startup.md
index 48d6e24f6..5f329050e 100644
--- a/docs/tutorials/music-store-app/load-data-at-startup.md
+++ b/docs/tutorials/music-store-app/load-data-at-startup.md
@@ -2,6 +2,8 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreLoadedDataStartScreenshot from './images/image-20210310184202271.png';
+
# Load Data at Start-up
On this page you will add code to load the user's album collection from disk when the app starts.
@@ -33,11 +35,11 @@ private async void LoadAlbums()
As you can see this method uses the business service to load the list of albums from the disk cache. It then transforms each data model (`Album` class) into a view model (`AlbumViewModel` class). After this all the album view models are added to the observable collection - this will instantly update the UI with the text data for the albums.
-You will notice that after the JSON album files are loaded, the second loop loads the cover art image files. This provides your user with visual feedback as quickly as possible (in the form of album tiles with text and the placeholder music note icon) about what albums are in the collection. The cover art is then loaded asynchronously. This ensures that the app remains responsive during the image loading process.
+You will notice that after the JSON album files are loaded, the second loop loads the cover art image files. This provides your user with visual feedback as quickly as possible (in the form of album tiles with text and the placeholder music note icon) about what albums are in the collection. The cover art is then loaded asynchronously. This ensures that the app remains responsive during the image loading process.
-You next step is to schedule the `LoadAlbum` method to run when the app starts.
+You next step is to schedule the `LoadAlbum` method to run when the app starts.
-To schedule the method on the main thread, follow this procedure:
+To schedule the method on the main thread, follow this procedure:
- Keep the **MainWindowViewModel.cs** file open.
- Add a reference to `using System.Reactive.Concurrency;`
@@ -49,4 +51,4 @@ RxApp.MainThreadScheduler.Schedule(LoadAlbums);
- Click **Debug** to compile and run the project.
-![](images/image-20210310184202271.png)
+
diff --git a/docs/tutorials/music-store-app/mock-search.md b/docs/tutorials/music-store-app/mock-search.md
index b2d3af17c..d8059aa7f 100644
--- a/docs/tutorials/music-store-app/mock-search.md
+++ b/docs/tutorials/music-store-app/mock-search.md
@@ -2,6 +2,8 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreMockSearchScreenshot from './images/text-list.png';
+
# Mock Search
On this page you will create the view model for the album search feature, and then bind it to the controls on the new user control. At this stage you will use a mock of the search itself, so that you can concentrate on the view model.
@@ -144,6 +146,6 @@ public MusicStoreViewModel()
- Click **Debug** to compile and run the project.
-![](images/text-list.png)
+
This shows that the data binding from the list to the album collection in the view model is working, but the view is not graphical yet. On the next page you will develop the app further by replacing the text with graphical album tiles.
diff --git a/docs/tutorials/music-store-app/opening-a-dialog.md b/docs/tutorials/music-store-app/opening-a-dialog.md
index 3560570fc..08b1700f6 100644
--- a/docs/tutorials/music-store-app/opening-a-dialog.md
+++ b/docs/tutorials/music-store-app/opening-a-dialog.md
@@ -2,9 +2,12 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreAddWindowScreenshot from './images/add-window.png';
+import MusicStoreDialogOpenedScreenshot from './images/dialog-opened.png';
+
# Open a Dialog
-On this page you will learn how to use _ReactiveUI_ to manage another window in your app. The new window will eventually contain a search facility, and a button to add one of the album covers found to a list in the main window. This new window will be opened as a dialog - that is it will prevent activity in the main window while it is showing.
+On this page you will learn how to use _ReactiveUI_ to manage another window in your app. The new window will eventually contain a search facility, and a button to add one of the album covers found to a list in the main window. This new window will be opened as a dialog - that is it will prevent activity in the main window while it is showing.
## Add a New Dialog Window
@@ -13,12 +16,12 @@ There is nothing special about a window view file that makes it into a dialog; t
To create a new window, follow this procedure:
- Stop the app if it is still running.
-- In the solution explorer, right-click the **/Views** folder and then click **Add**.
+- In the solution explorer, right-click the **/Views** folder and then click **Add**.
- Click **Avalonia Window**.
- When prompted for the name, type 'MusicStoreWindow'
- Press enter.
-![](images/add-window.png)
+
## Dialog Window Styling
@@ -57,16 +60,16 @@ To style the new dialog window so that it matches the main window, follow this p
## Dialog Input and Output
-The application logic for the dialog will be controlled by its own view model. This will be created and linked to the dialog window view whenever the dialog is to be shown.
+The application logic for the dialog will be controlled by its own view model. This will be created and linked to the dialog window view whenever the dialog is to be shown.
Similarly, the result of the users interaction with the dialog will eventually have to be passed back to the application logic for the main window for processing.
At this stage you will create two empty view model classes to act as placeholders for the dialog view model, and the dialog return (selected album) object. To create these view models, follow this procedure:
-- In the solution explorer, right-click the **/ViewModels** folder and then click **Add**.
+- In the solution explorer, right-click the **/ViewModels** folder and then click **Add**.
- Click **Class**.
- Name the class 'MusicStoreViewModel' and click **Add**.
-- Right-click again the **/ViewModels** folder and then click **Add** a second time.
+- Right-click again the **/ViewModels** folder and then click **Add** a second time.
- Click **Class**.
- Name the class 'AlbumViewModel' and click **Add**.
@@ -121,7 +124,7 @@ namespace Avalonia.MusicStore.ViewModels
At this point, the code for the interaction is still incomplete. If you attempt to run the app now and click the icon button, you will get an exception of class `ReactiveUI.UnhandledInteractionException`.
-Your next step is to make sure that the main window view knows how to start the interaction. This is implemented in the code-behind file for the main window view, and uses some features of the the _ReactiveUI_ framework. Follow this procedure:
+Your next step is to make sure that the main window view knows how to start the interaction. This is implemented in the code-behind file for the main window view, and uses some features of the _ReactiveUI_ framework. Follow this procedure:
- Locate and open the code-behind **MainWindow.axaml.cs** file. (You may need to expand the **MainWindow.axaml** file to find it.)
- Alter the class wo that it inherits from `ReactiveWindow`.
@@ -187,7 +190,7 @@ It all works - but the dialog window opens at the same size as the main window,
## Dialog Position and Size
-In the last step here, you will make the dialog smaller that the main window, and open centered on it. You will also make the main window open in the center of the user's screen.
+In the last step here, you will make the dialog smaller that the main window, and open centered on it. You will also make the main window open in the center of the user's screen.
Follow this procedure:
@@ -202,7 +205,7 @@ Follow this procedure:
- Locate and open the **MusicStoreWindow.axaml** file.
- Add attributes for the width and height of the dialog, set at 1000 and 550 respectively.
-- Add the start-up position attribute set to `CenterOwner`, as shown:
+- Add the start-up position attribute set to `CenterOwner`, as shown:
```
The dialog window is now opened centered inside the main window.
-On the next page, you will learn how to add some content to the dialog window to represent a search for albums, and present the results.
+On the next page, you will learn how to add some content to the dialog window to represent a search for albums, and present the results.
diff --git a/docs/tutorials/music-store-app/searching-for-albums.md b/docs/tutorials/music-store-app/searching-for-albums.md
index 25f981c5c..d6c82d544 100644
--- a/docs/tutorials/music-store-app/searching-for-albums.md
+++ b/docs/tutorials/music-store-app/searching-for-albums.md
@@ -2,13 +2,18 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreiTunesSearchNugetScreenshot from './images/image-20210310013703557.png';
+import MusicStoreAlbumModelDiagram from '/img/gitbook-import/assets/image (2) (1) (3).png';
+import MusicStoreAlbumMvvmDiagram from '/img/gitbook-import/assets/image (25) (4).png';
+import MusicStoreAlbumViewScreenshot from './images/image-20210310110401944.png';
+
# Album Service
On this page, you will add some business logic to the app This will allow you to replace the mock data and get some real album data from the search. This business logic code forms the 'Model' part of the MVVM pattern.
To implement a real album search in the app, you will use a _NuGet_ package that can call the _Apple iTunes_ Web API album search.
-## Apple Web API Package
+## Apple Web API Package
Follow this procedure to add the required _NuGet_ package:
@@ -16,18 +21,16 @@ Follow this procedure to add the required _NuGet_ package:
- Right-click the project.
- Click **Manage NuGet Packages**.
-![](images/image-20210310013703557.png)
+
- Type 'itunes' in the search box (top-left).
-- Click **iTunesSearch**, then click **Install**.
+- Click **iTunesSearch**, then click **Install**.
## MVVM Model
In this tutorial the application is simple, and you can implement the business services required for the 'Model' part of the MVVM pattern, in one class. This class will contain both the data model for an album, and the method needed for the search.
-
-
-
+
Follow this procedure to add the album business logic:
@@ -80,9 +83,7 @@ Your album view model is currently empty. It will need to be able to store the a
In this step you will use a common pattern for the dependent relationship between a view model and a (business logic) model. This is where the view model contains an instance of the data model, and then exposes certain of its properties, as required for display.
-
-
-
+
Follow this procedure to prepare the album view model:
@@ -201,6 +202,6 @@ Follow this procedure to add the album name and artist name to the tile:
- Click the icon button.
- Type some search text.
-![](images/image-20210310110401944.png)
+
On the next page, you will learn how to improve the look of the app by retrieving the cover art for each album. This will be displayed on the tile instead of the note icon.
diff --git a/docs/tutorials/samples.md b/docs/tutorials/samples.md
index 40efe89d1..8e90bc140 100644
--- a/docs/tutorials/samples.md
+++ b/docs/tutorials/samples.md
@@ -9,4 +9,4 @@ title: Samples
## AvaloniaUI.QuickGuides
-[`AvaloniaUI.QuickGuides`](https://github.com/AvaloniaUI/AvaloniaUI.QuickGuides) are bitesized demos convering same of the more advanced aspects of Avalonia.
\ No newline at end of file
+[`AvaloniaUI.QuickGuides`](https://github.com/AvaloniaUI/AvaloniaUI.QuickGuides) are bitesized demos covering some of the more advanced aspects of Avalonia.
diff --git a/docs/tutorials/todo-list-app/add-a-data-context.md b/docs/tutorials/todo-list-app/add-a-data-context.md
index 7f1572053..c3b676126 100644
--- a/docs/tutorials/todo-list-app/add-a-data-context.md
+++ b/docs/tutorials/todo-list-app/add-a-data-context.md
@@ -2,13 +2,16 @@
description: TUTORIALS - To Do List App
---
+import ToDoDataContextResolvedArchitectureDiagram from '/img/gitbook-import/assets/image (20) (3).png';
+import ToDoDataContextResolvedScreenshot from '/img/gitbook-import/assets/image (5) (1) (2).png';
+
# Add a Data Context
On this page, you will set the data context of the to do list view to be the `ToDoList` property.
To set the data context, follow this procedure:
-- Locate the **MainWindowView.axaml** file in the **Views** folder.
+- Locate the **MainWindow.axaml** file in the **Views** folder.
- Remove the `` tag completely.
- Add the `x:DataType="vm:MainWindowViewModel"` attribute to `` element.
- Locate the content ``
@@ -34,14 +37,8 @@ The arrangement of views and view models now has an additional data context; def
So here is the arrangement after the data context binding has been resolved:
-
-
-
-
+
Now if you run the app, the _Avalonia UI_ binder has a suitable data context for the items control binding; and the items show up in the view:
-
-
-
-
+
diff --git a/docs/tutorials/todo-list-app/add-item-buttons.md b/docs/tutorials/todo-list-app/add-item-buttons.md
index 82a0a6b97..14037e35f 100644
--- a/docs/tutorials/todo-list-app/add-item-buttons.md
+++ b/docs/tutorials/todo-list-app/add-item-buttons.md
@@ -2,9 +2,12 @@
description: TUTORIALS - To Do List App
---
+import ToDoOkDisabledScreenshot from '/img/gitbook-import/assets/image (21) (2).png';
+import ToDoOkEnabledScreenshot from '/img/gitbook-import/assets/image (41).png';
+
# Add Item Buttons
-On this page, you will learn how to complete the to do list app by adding actions for the buttons in the add item view. You will include some revealed functionality that disables the OK button until the user enters text in the input.
+On this page, you will learn how to complete the to do list app by adding actions for the buttons in the add item view. You will include some revealed functionality that disables the OK button until the user enters text in the input.
Also the OK button action needs to pass the description text back to the main window view model, so it can be added to the items collection. You will do this by passing an argument to the command.
@@ -12,7 +15,7 @@ To alter the add item view model, follow this procedure:
- Stop the app if it is running.
- Locate the **AddItemViewModel.cs** file in the **/ViewModels** folder.
-- Edit the code as shown.
+- Edit the code as shown.
```csharp
using ReactiveUI;
@@ -56,9 +59,9 @@ Therefore this view model code declares a reactive command for the OK button, wi
The reactive command is part of _ReactiveUI_. For an introduction to this concept, see [here](../../concepts/reactiveui/reactive-command.md).
:::
-Although there is nothing special about the cancel button, a reactive command is declared for that as well. You will see later how this will allow the output from both commands to be handled in the same place.
+Although there is nothing special about the cancel button, a reactive command is declared for that as well. You will see later how this will allow the output from both commands to be handled in the same place.
-Both reactive command objects are then created in the constructor. The OK command defines a function that passes a to do item parameter. The cancel command has an empty object parameter.
+Both reactive command objects are then created in the constructor. The OK command defines a function that passes a to do item parameter. The cancel command has an empty object parameter.
```csharp
var isValidObservable = this.WhenAnyValue(
@@ -96,16 +99,16 @@ The code also creates a reactive command for the cancel button:
CancelCommand = ReactiveCommand.Create(() => { });
```
-The cancel command has no execution, so its first and only parameter does nothing. The cancel button is always enabled, so it does not have a 'can execute' parameter.
+The cancel command has no execution, so its first and only parameter does nothing. The cancel button is always enabled, so it does not have a 'can execute' parameter.
## Bind the OK and Cancel Buttons
-Your next step is to create binding for the OK and cancel buttons in the view.
+Your next step is to create binding for the OK and cancel buttons in the view.
To do this, follow this procedure:
- Locate the **AddItemView.axaml** file in the **/Views** folder.
-- Edit the XAML as shown.
+- Edit the XAML as shown.
```markup
-
-
+
-
-
-
-
+
-On the next page you will learn how to process the new to do item, so that it appears on the list, if the user clicks OK.
+On the next page you will learn how to process the new to do item, so that it appears on the list, if the user clicks OK.
diff --git a/docs/tutorials/todo-list-app/adding-new-items.md b/docs/tutorials/todo-list-app/adding-new-items.md
index f3fe2e087..fd23a8bbb 100644
--- a/docs/tutorials/todo-list-app/adding-new-items.md
+++ b/docs/tutorials/todo-list-app/adding-new-items.md
@@ -2,6 +2,8 @@
description: TUTORIALS - To Do List App
---
+import ToDoAddNewItemsScreenshot from '/img/gitbook-import/assets/image (44).png';
+
# Add New Items
When you created the `ToDoListView` user control earlier in this tutorial, you added a button so that the user can add a new item. On this page you will add an action to the button.
@@ -75,14 +77,12 @@ Alter the XAML to match the following:
This gives you a view which looks like this:
-
-
-
+
The new view has a text box control which has three properties for you to review:
* `AcceptsReturn` creates a multi-line text box.
-* `Text` binds the text that is displayed in the text box to the `Description` property on a view model (that you have not created yet).
+* `Text` binds the text that is displayed in the text box to the `Description` property on a view model (that you created above).
* `Watermark` causes a placeholder to be displayed when the text box is empty.
On the next page you will learn how to change the view in the main window to display the new item view in place of the to do list view.
diff --git a/docs/tutorials/todo-list-app/conclusion.md b/docs/tutorials/todo-list-app/conclusion.md
index a170384b4..8710e9901 100644
--- a/docs/tutorials/todo-list-app/conclusion.md
+++ b/docs/tutorials/todo-list-app/conclusion.md
@@ -2,19 +2,19 @@
description: TUTORIALS - To Do List App
---
+import ToDoFinalArchitectureDiagram from '/img/gitbook-import/assets/image (2) (3).png';
+
# Conclusion
-On this page you will learn why the app was implemented in the way that it has been, and recommended some further reading.
+On this page you will learn why the app was implemented in the way that it has been, and recommended some further reading.
## Application Solution Architecture
-This tutorial has used an application solution architecture that uses the MVVM pattern, and swaps the content of the main window to navigate between pages; while keeping the 'top level' view model in memory to provide application state. The pages (views) are composed in _Avalonia UI_ user controls.
+This tutorial has used an application solution architecture that uses the MVVM pattern, and swaps the content of the main window to navigate between pages; while keeping the 'top level' view model in memory to provide application state. The pages (views) are composed in _Avalonia UI_ user controls.
-
-
-
+
-This tutorial application is targeted at the _Windows_ platform where the main window exists - so it may appear to be an over complex approach.
+This tutorial application is targeted at the _Windows_ platform where the main window exists - so it may appear to be an over complex approach.
However on other target platforms, there is no main window. An application has to be arranged as a series of views.
diff --git a/docs/tutorials/todo-list-app/creating-a-model.md b/docs/tutorials/todo-list-app/creating-a-model.md
index 466e6389a..ff790c15d 100644
--- a/docs/tutorials/todo-list-app/creating-a-model.md
+++ b/docs/tutorials/todo-list-app/creating-a-model.md
@@ -4,11 +4,11 @@ description: TUTORIALS - To Do List App
# Create a Model
-So far the in this tutorial, you have created a basic view where none of the controls do anything yet; and linking it all together using the MVVM pattern is still a couple of steps away.
+So far the in this tutorial, you have created a basic view where none of the controls do anything yet; and linking it all together using the MVVM pattern is still a couple of steps away.
-On this page you will create the model part of the MVVM pattern for app.
+On this page you will create the model part of the MVVM pattern for app.
-In a real MVVM application, the model handles everything that is not in the application-specific logic of the view model, or the view itself. This may include data storage and any services needed to supply storage, and maybe other external services that the app needs (email for example).
+In a real MVVM application, the model handles everything that is not in the application-specific logic of the view model, or the view itself. This may include data storage and any services needed to supply storage, and maybe other external services that the app needs (email for example).
In this tutorial example, you will create a mock database and a service to access it. These will take the place of the model part of the application.
@@ -64,6 +64,4 @@ namespace ToDoList.Services
}
```
-That is the model done for now. On the next page, you will learn how to add a view model to the app to complete the MVVM pattern.
-
-###
+That is the model done for now. On the next page, you will learn how to add a view model to the app to complete the MVVM pattern.
diff --git a/docs/tutorials/todo-list-app/creating-a-new-project.md b/docs/tutorials/todo-list-app/creating-a-new-project.md
index 5201fc292..f0e492b9d 100644
--- a/docs/tutorials/todo-list-app/creating-a-new-project.md
+++ b/docs/tutorials/todo-list-app/creating-a-new-project.md
@@ -2,23 +2,26 @@
description: TUTORIALS - To Do List App
---
+import ToDoCreateNewProjectScreenshot from '/img/gitbook-import/assets/image (43).png';
+import ToDoNewSolutionScreenshot from '/img/gitbook-import/assets/image (3) (1) (1).png';
+
# Create a New Project
-On this page you will learn how to create a new project for the to do list app.
+On this page, you will learn how to create a new project for the To-Do List app. There are two methods to choose from:
+
+1. **Visual Studio Extension Template**: If you prefer using Visual Studio, follow the instructions below to create your project.
+
+2. **.NET Core CLI Command**: Alternatively, if you prefer command-line tools, you can use the .NET Core CLI command. Here's how:
## Visual Studio
-Before you start, check you have installed the _Avalonia UI_ extension for Visual Studio.
+Before you start, check if you have installed the _Avalonia UI_ extension for Visual Studio.
:::info
For full instructions about the extension, see [here](../../get-started/install-the-avalonia-extension.md).
:::
-
-
-
-
-
+
With the extension installed, start this tutorial by following these instructions:
@@ -27,20 +30,18 @@ With the extension installed, start this tutorial by following these instruction
- In **Search for Templates**, enter 'Avalonia'
- Click **Avalonia MVVM Application**
- Click **Next**
-- In **Project name**, enter 'ToDoList', and click **Create**
+- In **Project name**, enter 'ToDoList' as the project name and click **Create**
The newly created solution will look like this:
-
-
-
+
## .NET Core CLI
-Before you start, check you have installed the _Avalonia UI_ templates for .NET Core.
+Before you start, check if you have installed the _Avalonia UI_ templates for .NET Core.
:::info
-For full instructions about the starting with the CLI, see [here](../../get-started/getting-started.md).
+For full instructions about starting with the CLI, see [here](../../get-started/getting-started.md).
:::
With the templates installed, you can create the application from the template:
@@ -49,44 +50,44 @@ With the templates installed, you can create the application from the template:
dotnet new avalonia.mvvm -o ToDoList -n ToDoList
```
-The newly created project will be look like this:
+The newly created project will look like this:
```bash
ToDoList
- |- App.axaml
- |- App.axaml.cs
- |- app.manifest
|- Assets
| |- avalonia-logo.ico
- |- Models
- |- Program.cs
- |- ToDoList.csproj
- |- ViewLocator.cs
+ |- Models
|- ViewModels
| |- MainWindowViewModel.cs
| |- ViewModelBase.cs
|- Views
| |- MainWindow.axaml
- | |- MainWindow.axaml.cs
+ | | |- MainWindow.axaml.cs
+ |- App.axaml
+ | |- App.axaml.cs
+ |- app.manifest
+ |- Program.cs
+ |- ViewLocator.cs
+ |- ToDoList.csproj
```
## MVVM Project Structure
This section applies to both Visual Studio and CLI.
-You can see there are folders for each of the concepts in the MVVM pattern (models, views and view models) as well as some other files and folders.
+You can see there are folders for each of the concepts in the MVVM pattern (models, views, and view models) as well as some other files and folders.
* The `/Assets` folder contains binary assets for your application such as icons and bitmaps. Files placed here will automatically be included as resources in the application.
* The `/Models` folder is currently empty, you will add a file here later in this tutorial.
-* The `/ViewModels` folder contains a base class for view models and a rudimentary view model for the application main window.
+* The `/ViewModels` folder contains a base class for view models and a rudimentary view model for the application's main window.
* The `/Views` folder contains the application main window AXAML file. You will add other view files here during this tutorial.
* The `App.axaml` file is for XAML styles and data templates that apply to the whole application. You will not change this file in this tutorial.
-* The `Program.cs` file is the entry point for execution of the application. You can configure additional platform options for _Avalonia UI_ here if necessary, however you will not change this file in this tutorial.
+* The `Program.cs` file is the entry point for the execution of the application. You can configure additional platform options for _Avalonia UI_ here if necessary, however, you will not change this file in this tutorial.
* The `ViewLocator.cs` file is a special helper class, and it is used in the `App.axaml` file. The significance of this file will be explained later in this tutorial.
## AXAML Files
-_Avalonia UI_ uses the file extension `.axaml` for its XAML files, and this includes those created by the Visual Studio solution template, and more recent versions of the .NET Core CLI templates. If you previously used older .NET Core CLI templates, then the extension may be `.xaml`.
+_Avalonia UI_ uses the file extension `.axaml` for its XAML files, and this includes those created by the Visual Studio solution template and more recent versions of the .NET Core CLI templates. If you previously used older .NET Core CLI templates, the extension may be `.xaml`.
:::info
For more background on Avalonia UI XAML see [here](../../basics/user-interface/introduction-to-xaml.md).
diff --git a/docs/tutorials/todo-list-app/creating-a-view-model.md b/docs/tutorials/todo-list-app/creating-a-view-model.md
index 03b33240a..03f3ec657 100644
--- a/docs/tutorials/todo-list-app/creating-a-view-model.md
+++ b/docs/tutorials/todo-list-app/creating-a-view-model.md
@@ -2,6 +2,8 @@
description: TUTORIALS - To Do List App
---
+import MvvmArchitectureDiagram from '/img/gitbook-import/assets/image (3) (1) (2).png';
+
# Create a View Model
On this page, you will learn how to create a view model to provide the application logic for your app. This is the final part of the MVVM pattern, and it will make use of the _ReactiveUI_ framework.
@@ -12,7 +14,7 @@ To review the concepts behind MVVM pattern programming using ReactiveUI, see [he
The purpose of the view model is organise data and actions for the application in a way that suits the views. For reasons that will become clear in a future step of this tutorial, you will adopt the convention of naming a view model after the view that it supports in this way.
- Follow this procedure to add the to do list view model to your app:
+Follow this procedure to add the to do list view model to your app:
- Locate the **ViewModels** folder and add a new class.
- Name the new class 'ToDoListViewModel'.
@@ -39,21 +41,19 @@ namespace ToDoList.ViewModels
Your view model is very simple at this stage. Its constructor takes a collection of to do item data models and keeps them in an observable collection . This is publicly available through the `ListItems` property here on the view model.
-The view model derives from the base class `ViewModelBase` that was created by the solution template. More about this later in the tutorial.
+The view model derives from the base class `ViewModelBase` that was created by the solution template. More about this later in the tutorial.
## Separation in MVVM
-You have seen that the to do list view model has a constructor that requires a collection of to do item data models to be provided as the parameter. In turn this collection will be retrieved from the fake data service (model) at some point.
+You have seen that the to do list view model has a constructor that requires a collection of to do item data models to be provided as the parameter. In turn this collection will be retrieved from the fake data service (model) at some point.
Before you start to populate the view model with data, have another look at the MVVM pattern:
-
-
-
+
The stated purpose of the pattern is to separate the view and view model so that, for example, the view model may be independently tested. This removes the dependency between the view and view model.
-In a real application, you would aim to ensure separation between the view model and the model, for similar reasons. However this is beyond the scope of this tutorial, so here you will make the view model dependent on the model.
+In a real application, you would aim to ensure separation between the view model and the model, for similar reasons. However this is beyond the scope of this tutorial, so here you will make the view model dependent on the model.
:::info
Separation of the view model and the model in the MVVM pattern can be achieved by Dependency Injection (DI). For guidance on how to use DI with MVVM and _Avalonia UI_, see [here](../../guides/implementation-guides/how-to-implement-dependency-injection.md).
@@ -63,7 +63,7 @@ Separation of the view model and the model in the MVVM pattern can be achieved b
Follow this procedure to make the main window view model depend on the model, that is dependent on the to do list data service:
-- Locate the **MainWindowViewModel** class file, in the **ViewModels** folder.
+- Locate the **MainWindowViewModel** class file, in the **ViewModels** folder.
- Alter the code as follows:
```csharp
diff --git a/docs/tutorials/todo-list-app/creating-a-view.md b/docs/tutorials/todo-list-app/creating-a-view.md
index 9bf36fc9a..45a13c4b9 100644
--- a/docs/tutorials/todo-list-app/creating-a-view.md
+++ b/docs/tutorials/todo-list-app/creating-a-view.md
@@ -2,6 +2,8 @@
description: TUTORIALS - To Do List App
---
+import ToDoCreateANewViewScreenshot from '/img/gitbook-import/assets/image (1) (1).png';
+
# Create a New View
On this page, you will add a view to display the list of to do items, with a button to add a new item.
@@ -102,7 +104,4 @@ Edit the contents of `Views/TodoListView.axaml` to contain the following:
If you are using the Visual Studio extension you should see the contents of the control displayed in the previewer after completing a build:
-
-
-
-
+
diff --git a/docs/tutorials/todo-list-app/index.md b/docs/tutorials/todo-list-app/index.md
index 39ceca3b2..bc552edc3 100644
--- a/docs/tutorials/todo-list-app/index.md
+++ b/docs/tutorials/todo-list-app/index.md
@@ -3,13 +3,11 @@ id: index
title: To Do List App
---
-In this tutorial you will create a simple to do list application using _Avalonia UI_ and the Model View View-Model (MVVM) pattern with binding to the to do list (collection) data.
-
+import ToDoFinishedApplicationScreenshot from '/img/tutorials/todo-list-app/image (14).png';
-
-
-
+In this tutorial you will create a simple to do list application using _Avalonia UI_ and the Model View View-Model (MVVM) pattern with binding to the to do list (collection) data.
+
:::info
You can find the code for the completed application [here](https://github.com/grokys/todo-tutorial).
diff --git a/docs/tutorials/todo-list-app/locating-views.md b/docs/tutorials/todo-list-app/locating-views.md
index f8d7979b9..be9efd77d 100644
--- a/docs/tutorials/todo-list-app/locating-views.md
+++ b/docs/tutorials/todo-list-app/locating-views.md
@@ -2,11 +2,13 @@
description: TUTORIALS - To Do List App
---
+import ToDoViewLocatorArchitectureDiagram from '/img/gitbook-import/assets/image (45).png';
+
# The View Locator
On this page you will learn how the view locator class that the solution template added to your project is being used. You will see how this implements a 'convention over configuration' paradigm inside the content zone of your main window.
-To help learn how it works, take some time to examine the view locator class:
+To help learn how it works, take some time to examine the view locator class:
```csharp
using Avalonia.Controls;
@@ -43,10 +45,10 @@ namespace ToDoList
The view locator class defines a data template in code which takes a view model and can return a corresponding view. It works by defining two methods:
-* `Match(object data)` looks at the data and checks that it inherits from the `ViewModelBase` class - as both your view models do! If this check passes, then the `Build` method is called:
+* `Match(object data)` looks at the data and checks that it inherits from the `ViewModelBase` class - as both your view models do! If this check passes, then the `Build` method is called:
* `Build(object data)` takes the fully qualified name of the view model type and replaces the string `"ViewModel"` with the string `"View"`. It then tries to create the view type, and if that is successful returns it.
-An instance of `ViewLocator` is present in the **App.axaml** file in the app project (it was added by the solution template). It should look like this:
+An instance of `ViewLocator` is present in the **App.axaml** file in the app project (it was added by the solution template). It should look like this:
```markup
-
-
+As no other data templates match, the search will eventually reach the `ViewLocator` in the application data templates element. This will run its checks and if they pass, return an instance of the corresponding view. In your app this will be the to do list view.
+
-In this way the content of the main window is set to the correct view, based on the type of the view model and the naming convention.
+In this way the content of the main window is set to the correct view, based on the type of the view model and the naming convention.
## Source not Framework
diff --git a/docs/tutorials/todo-list-app/main-window-content.md b/docs/tutorials/todo-list-app/main-window-content.md
index 04fc9f473..882f2a37e 100644
--- a/docs/tutorials/todo-list-app/main-window-content.md
+++ b/docs/tutorials/todo-list-app/main-window-content.md
@@ -2,9 +2,11 @@
description: TUTORIALS - To Do List
---
+import ToDoMainWindowContentScreenshot from '/img/gitbook-import/assets/image (4) (1) (1).png';
+
# Main Window Content
-At this point your main window still displays the greeting text created by the solution template. On this page you will change the main window content zone, so it displays your new user control instead.
+At this point your main window still displays the greeting text created by the solution template. On this page you will change the main window content zone, so it displays your new user control instead.
Follow this procedure to change the main window content:
@@ -40,11 +42,11 @@ The main window XAML should now look like this:
This XAML is similar in may ways to the user control XAML you had a lookup on the previous page. Specifically, here you added:
-
+```markup
+
+```
-This maps the code namespace `ToDoList.Views` to the XML namespace alias `views`.
+This maps the code namespace `ToDoList.Views` to the XML namespace alias `views`.
:::warning
Any user control that you create will need this kind of mapping, or the Avalonia UI XAML engine will be unable to find it, and you will get an error.
@@ -64,10 +66,8 @@ Now run the application you have built so far. If you are using Visual Studio,
dotnet run
```
- You will see the main window, with its new title and user control:
+You will see the main window, with its new title and user control:
-
-
-
+
That is just the view - nothing really does anything yet! On the next pages, you will learn how to create the working parts of the app: the model and the view model.
diff --git a/docs/tutorials/todo-list-app/navigate-views.md b/docs/tutorials/todo-list-app/navigate-views.md
index 72d18e3c7..b873dfbd4 100644
--- a/docs/tutorials/todo-list-app/navigate-views.md
+++ b/docs/tutorials/todo-list-app/navigate-views.md
@@ -2,13 +2,16 @@
description: TUTORIALS - To Do List App
---
+import ToDoNavigationConceptDiagram from '/img/gitbook-import/assets/image (40).png';
+import ToDoNavigationArchitectureDiagram from '/img/gitbook-import/assets/image (38) (2).png';
+import ToDoBeforeNavigationScreenshot from '/img/gitbook-import/assets/image (43) (1).png';
+import ToDoAfterNavigationScreenshot from '/img/gitbook-import/assets/image (21) (1).png';
+
# Navigate Views
On this page you will learn how to change the view in the content zone of the main window to display the new item view, when the user clicks **Add Item**.
-
-
-
+
Up to this point, you have used the MVVM pattern for this tutorial app. This means that the application logic is controlled from the view models, and the view model in charge of what appears in the main window is the main window view model.
@@ -16,7 +19,7 @@ Therefore to start with, follow this procedure to add a method to the main windo
- Stop the app if it is running.
- Locate the **MainWindowViewModel.cs** file in the **/ViewModels** folder.
-- Edit the code as shown.
+- Edit the code as shown.
```csharp
using ReactiveUI;
@@ -53,7 +56,7 @@ namespace ToDoList.ViewModels
}
```
-Take some time to examine the code you just added. There is a new `ContentViewModel` property that can get and set the view model in the main window content zone. This is initially set in the constructor to be the to do list view model, with to do list data provided from the service.
+Take some time to examine the code you just added. There is a new `ContentViewModel` property that can get and set the view model in the main window content zone. This is initially set in the constructor to be the to do list view model, with to do list data provided from the service.
There is also now a new `AddItem()` method that can reassign the content to be the add item view model.
@@ -61,12 +64,12 @@ Notice that the `ContentViewModel` property set calls `RaiseAndSetIfChanged` whi
## Main Window Content Binding
-Now that you have passed control of what is shown in the main window over to the main window view model (in accordance with the MVVM pattern), you need to complete the link by changing the main window content to use a binding.
+Now that you have passed control of what is shown in the main window over to the main window view model (in accordance with the MVVM pattern), you need to complete the link by changing the main window content to use a binding.
Follow this procedure:
- Locate the **MainWindow.axaml** file in the **/Views** folder.
-- Edit the XAML as shown.
+- Edit the XAML as shown.
```markup
```
-
-
-
+
## Button Command
-Lastly, to make the add item button call the `AddItem()` method, follow this procedure:
+Lastly, to make the add item button call the `AddItem()` method, follow this procedure:
* Locate the **ToDoListView.axaml** file in the **/Views** folder.
-* Edit the XAML for the button as shown:
+* Edit the XAML for the button as shown:
```markup
```
-Take some time to examine the binding that you added to the button.
+Take some time to examine the binding that you added to the button.
-Firstly, the `Command` property defines a method to be called whenever the button is clicked.
+Firstly, the `Command` property defines a method to be called whenever the button is clicked.
Then the binding gives the exact **binding path** to the method using a binding source expression:
@@ -113,9 +115,9 @@ Then the binding gives the exact **binding path** to the method using a binding
$parent[Window].DataContext.AddItem
```
-The **binding source expression** redirects the source of the binding. The _Avalonia UI_ binding system will use the source in the expression, instead of the control's data context.
+The **binding source expression** redirects the source of the binding. The _Avalonia UI_ binding system will use the source in the expression, instead of the control's data context.
-In this case the expression is looking for any parent of the control with the type `Window`. It will then use that control's data context to call the `AddItem` method.
+In this case the expression is looking for any parent of the control with the type `Window`. It will then use that control's data context to call the `AddItem` method.
:::info
For information about the concept of binding source expressions, see [here](../../basics/data/data-binding/data-binding-syntax).
@@ -125,22 +127,14 @@ For information about the concept of binding source expressions, see [here](../.
Now If you run the application and click **Add Item**, you will see the new view appear.
-
-
-
-
-
-
-
-
-
+
-
+
-Have noticed something about this behaviour? The main window swaps the view model bound to its content zone, and the display correctly loads the add item view!
+Have noticed something about this behaviour? The main window swaps the view model bound to its content zone, and the display correctly loads the add item view!
:::info
-In _Avalonia UI_ you can call a simple method on the view model directly like this. You will see later in this tutorial a scenario where you must use a different implementation.
+In _Avalonia UI_ you can call a simple method on the view model directly like this. You will see later in this tutorial a scenario where you must use a different implementation.
:::
-On the next page you will learn how this is happening due to the presence of the view locator.
+On the next page you will learn how this is happening due to the presence of the view locator.
diff --git a/docs/tutorials/todo-list-app/process-a-new-item.md b/docs/tutorials/todo-list-app/process-a-new-item.md
index 4a881b069..6e252c391 100644
--- a/docs/tutorials/todo-list-app/process-a-new-item.md
+++ b/docs/tutorials/todo-list-app/process-a-new-item.md
@@ -6,7 +6,7 @@ description: TUTORIALS - To Do List App
On this page you will learn how to process the output from the OK and cancel buttons being pressed and re-show the list. If OK was pressed we also need to add the new item to the list. We'll implement this functionality in `MainWindowViewModel`:
-To alter the add item view model, follow this procedure:
+To alter the main window view model, follow this procedure:
- Stop the app if it is running.
- Locate the **MainWindowViewModel.cs** file in the **/ViewModels** folder.
@@ -80,8 +80,8 @@ The merge method combines the output from any number of observable streams, but
You will remember that the two reactive command declarations were different. They were:
```csharp
-public ReactiveCommand Ok { get; }
-public ReactiveCommand Cancel { get; }
+public ReactiveCommand OkCommand { get; }
+public ReactiveCommand CancelCommand { get; }
```
The OK command generates an object of class `ToDoItem` whenever it executes, and the cancel command generates only a `Unit`. The `Unit` is the reactive version of `void` - it means the command generates no value, but still notifies that it has happened!
@@ -101,16 +101,16 @@ You are only interested in the first click of either the OK or cancel buttons; o
{
ToDoListViewModel.ListItems.Add(newItem);
}
- ContentViewModel = ToDoListViewModel;
+ ContentViewModel = ToDoList;
});
```
-Lastly the code subscribes to the first item the merged observable sequence. The subscribe pulls out the new to do item object, and examines it to see it it is null.
+Lastly the code subscribes to the first item in the merged observable sequence. The subscribe pulls out the new to do item object, and examines it to see it it is null.
A null value means that the cancel button was clicked - and no further action is required; except to restore the main window content to show the (unchanged) to do list.
```csharp
-ContentViewModel = ToDoListViewModel;
+ContentViewModel = ToDoList;
```
If the value is not null, then it is because the OK button was clicked; and in this case the value should be a `ToDoItem` containing the description that the user typed. SO this can be added to the list.
diff --git a/docs/tutorials/todo-list-app/wiring-up-the-views.md b/docs/tutorials/todo-list-app/wiring-up-the-views.md
index 969335374..9cd8405d9 100644
--- a/docs/tutorials/todo-list-app/wiring-up-the-views.md
+++ b/docs/tutorials/todo-list-app/wiring-up-the-views.md
@@ -2,6 +2,9 @@
description: TUTORIALS - To Do List App
---
+import ToDoDataContextWiringDiagram from '/img/gitbook-import/assets/image (7) (3).png';
+import ToDoBlankAfterWiringScreenshot from '/img/gitbook-import/assets/image (42) (2).png';
+
# Data Binding
Now that you have the view model and model (data service) connected, the next step is to link the views and view models, so the list of items can be displayed.
@@ -46,7 +49,7 @@ Take some time here to examine the code that you just added:
The items control `` repeats its display for each item in a collection source that is defined by the `ItemsSource` attribute. Here the data binding expression `{Binding ListItems}` means we are looking for a data context with this property name.
-How each item is in a displayed inside the items control is controlled by the item template <`ItemTemplate>`. This can be any combination of controls, but in this example it is a **data template** is being used.
+How each item is displayed inside the items control is controlled by the item template <`ItemTemplate>`. This can be any combination of controls, but in this example a **data template** is being used.
:::info
You can review the data template concept [here](../../concepts/templates/).
@@ -56,14 +59,10 @@ The built-in controls inside the data template will expect to find the propertie
So the arrangement of views and view models so far looks like this:
-
-
-
+
This will work if any parent of the items control has a data context object having a`ListItems` property. The _Avalonia UI_ binding will search upwards in the control tree to locate a suitable data context. But although the main window data context has been set (during the app initialization - see the file **App.axaml.cs**), at this point there is still no data context with a `ListItems` property.
So if you run your app, the list is still blank!
-
+
-
-
+
-
-
+
-
-
+
-
-
+
code-behind文件包含一个与XAML文件同名的类。例如:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/controls/builtin-controls.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/controls/builtin-controls.md
index 923a966ba..3eb45a4e8 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/controls/builtin-controls.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/controls/builtin-controls.md
@@ -56,14 +56,15 @@
## 值选择
-| 控件 | 类型 | 描述 |
-|:--------------------------------------------------------------------------------------------------------|:---------|:------------------------------------------------------------------------|
-| [Check Box](../../../reference/controls/checkbox.md) | Boolean | 以勾选标记形式表示的 True 值。点击交互切换值。具有显示“未知”值的选项。 |
-| [Slider](../../../reference/controls/slider.md) | Double | 相对于最大值和最小值的相对值,以滑动条按钮在滑动条轨道上的位置表示。拖动滑动条按钮可以在最大值和最小值之间更改值。键盘和点击交互也可以微调值。 |
-| [Calendar](../../../reference/controls/detailed-reference/calendar) | DateTime | 日历是用户选择日期或日期范围的控件。 |
-| [Calendar Date Picker](../../../reference/controls/detailed-reference/calendar/calendar-date-picker.md) | DateTime | 日期选择器的扩展,包括文本框和按钮。 |
-| [Date Picker](../../../reference/controls/datepicker.md) | DateTime | 日期选择器有三个“微调”控件,允许用户选择日期值。 |
-| [Time Picker](../../../reference/controls/detailed-reference/timepicker.md) | TimeSpan | 时间选择器有三个“微调”控件,允许用户选择小时、分钟和秒钟。 |
+| 控件 | 类型 | 描述 |
+|:--------------------------------------------------------------------------------------------------------|:-----------------|:------------------------------------------------------------------------|
+| [Check Box](../../../reference/controls/checkbox.md) | Boolean | 以勾选标记形式表示的 True 值。点击交互切换值。具有显示“未知”值的选项。 |
+| [Slider](../../../reference/controls/slider.md) | Double | 相对于最大值和最小值的相对值,以滑动条按钮在滑动条轨道上的位置表示。拖动滑动条按钮可以在最大值和最小值之间更改值。键盘和点击交互也可以微调值。 |
+| [Calendar](../../../reference/controls/detailed-reference/calendar) | DateTime | 日历是用户选择日期或日期范围的控件。 |
+| [Calendar Date Picker](../../../reference/controls/detailed-reference/calendar/calendar-date-picker.md) | DateTime | 日期选择器的扩展,包括文本框和按钮。 |
+| [Color Picker](../../../reference/controls/colorpicker) | Color / HsvColor | 颜色选择器支持用户使用光谱、调色板和组件滑块选择和编辑颜色。它还支持可选的 alpha 分量、RGB 或 HSV 颜色模型和十六进制颜色值。 |
+| [Date Picker](../../../reference/controls/datepicker.md) | DateTime | 日期选择器有三个“微调”控件,允许用户选择日期值。 |
+| [Time Picker](../../../reference/controls/detailed-reference/timepicker.md) | TimeSpan | 时间选择器有三个“微调”控件,允许用户选择小时、分钟和秒钟。 |
## 显示图像
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/control-themes.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/control-themes.md
index 523c6b15d..c2fa2c71e 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/control-themes.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/control-themes.md
@@ -3,6 +3,8 @@ id: control-themes
title: 控件主题(Control Themes)
---
+import StylingEllipseButtonScreenshot from '/img/basics/user-interface/styling/ellipse-button.png';
+
控件主题是在[样式](Styles)的基础上构建的,用于为控件创建可切换的主题。尽管控件主题与 WPF/UWP 中的样式类似,但它们的机制略有不同。
:::tip
@@ -75,7 +77,7 @@ title: 控件主题(Control Themes)
```
-![椭圆形按钮](/img/basics/user-interface/styling/ellipse-button.png)
+
## 控件主题中的交互
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/styles.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/styles.md
index d7549dc15..84835a6c9 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/styles.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/styles.md
@@ -3,6 +3,8 @@ id: styles
title: 样式
---
+import StyleH1SampleScreenshot from '/img/gitbook-import/assets/image (5) (5).png';
+
# 样式
_Avalonia UI_ 的样式系统是一种可以在控件之间共享属性设置的机制。
@@ -58,7 +60,7 @@ _Avalonia UI_ **样式选择器语法** 类似于 CSS(层叠样式表)中使
在此示例中,所有带有 `h1` 样式类的 `TextBlock` 元素将显示为样式设置的字体大小和字重。这在预览面板中工作:
-
+
## 放置样式的位置
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/themes/fluent.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/themes/fluent.md
index 9f5b2984d..a0b2a33da 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/themes/fluent.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/basics/user-interface/styling/themes/fluent.md
@@ -3,11 +3,14 @@ id: fluent
title: Fluent 主题
---
+import FluentThemeNormalScreenshot from '/img/basics/user-interface/styling/fluent-theme-normal.png';
+import FluentThemeForestScreenshot from '/img/basics/user-interface/styling/fluent-theme-forest.png';
+
## Introduction
Avalonia Fluent 主题受到微软的 Fluent Design System 的启发,该系统是一组用于创建视觉吸引力和交互式用户界面的设计指南和组件。Fluent Design System 强调现代、清晰的美学,平滑的动画和直观的交互。它在不同平台上提供了一致而精致的外观和感觉,同时为开发人员提供了我们的样式系统的灵活性。
-![Fluent 主题](/img/basics/user-interface/styling/fluent-theme-normal.png)
+
## 如何使用
@@ -102,4 +105,4 @@ Microsoft Fluent Theme Editor 已移植到 Avalonia,现在也可以与我们
6. 提供几个快速启动预设。
以下是使用 Forest 调色板预设的 FluentTheme 示例:
-![Fluent 主题 Forest 调色板](/img/basics/user-interface/styling/fluent-theme-forest.png)
\ No newline at end of file
+
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community.md
index 687dc15d2..e66fb5348 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/community.md
@@ -1,7 +1,13 @@
# 社区支持
+import TelegramLogoScreenshot from '/img/gitbook-import/assets/image (7) (1) (1).png';
+import GitterLogoScreenshot from '/img/gitbook-import/assets/image (38) (1) (1).png';
+import GitterChatScreenshot from '/img/gitbook-import/assets/image (37) (1) (1).png';
+
## Telegram
+
+
您也可以使用 Telegram 应用程序访问 Avalonia 聊天室(推荐使用以获得最佳体验)。
:::info
@@ -10,15 +16,14 @@
## Gitter
-
+
我们在 Gitter 平台上运营一个英语聊天室。
-
+
:::info
您可以在[这里](https://gitter.im/AvaloniaUI/Avalonia)使用 Gitter 在浏览器中访问聊天室。
:::
-
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/control-trees.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/control-trees.md
index 3f2c6eb13..206e6631e 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/control-trees.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/control-trees.md
@@ -2,6 +2,10 @@
description: CONCEPTS
---
+import ControlTreesLogicalScreenshot from '/img/gitbook-import/assets/image (61).png';
+import ControlTreesVisualScreenshot from '/img/gitbook-import/assets/image (15) (2).png';
+import ControlTreesEventScreenshot from '/img/gitbook-import/assets/image (1) (1) (2).png';
+
# 控件树
_Avalonia UI_ 从应用程序的 XAML 文件中创建控件树,以便能够渲染 UI 并管理应用程序的功能。
@@ -10,7 +14,7 @@ _Avalonia UI_ 从应用程序的 XAML 文件中创建控件树,以便能够渲
逻辑控件树以 XAML 中定义的层次结构表示应用程序控件(包括主窗口)。例如:窗口中的一个控件(按钮)在另一个控件(堆栈面板)内部,将形成一个三层的逻辑树。
-
+
在应用程序运行时,您可以打开 _Avalonia Dev Tools_ 窗口(按 F12 键)。这将在其 **逻辑树** 选项卡上显示逻辑树。
@@ -18,7 +22,7 @@ _Avalonia UI_ 从应用程序的 XAML 文件中创建控件树,以便能够渲
可视控件树包含 _Avalonia UI_ 实际运行的所有内容。它显示了控件上设置的所有属性,以及 _Avalonia UI_ 添加的所有额外部分,以呈现 UI 并管理应用程序的功能。
-
+
您可以在 _Avalonia Dev Tools_ 窗口的 **可视树** 选项卡上查看可视控件树。
@@ -26,4 +30,4 @@ _Avalonia UI_ 从应用程序的 XAML 文件中创建控件树,以便能够渲
_Avalonia UI_ 执行应用程序功能管理的一个重要部分是事件的生成和传播。**事件** 选项卡记录了事件的源和传播,当您在运行的应用程序中移动或与其交互时。
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-custom.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-custom.md
new file mode 100644
index 000000000..9e9dcd84d
--- /dev/null
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-custom.md
@@ -0,0 +1,81 @@
+---
+id: headless-custom
+title: Manual Setup of Headless Platform
+---
+
+:::warning
+This page explains an advanced usage scenario with the Headless platform.
+We recommend using the [XUnit](headless-xunit.md) or [NUnit](headless-nunit.md) testing frameworks instead.
+:::
+
+## Install Packages
+
+To set up the Headless platform, you need to install two packages:
+- [Avalonia.Headless](https://www.nuget.org/packages/Avalonia.Headless), which also includes Avalonia.
+- [Avalonia.Themes.Fluent](https://www.nuget.org/packages/Avalonia.Themes.Fluent), as even headless controls need a theme.
+
+:::tip
+The Headless platform doesn't require any specific theme, and it is possible to swap FluentTheme with any other.
+:::
+
+## Setup Application
+
+As in any other Avalonia app, an `Application` instance needs to be created, and themes need to be applied. When using the Headless platform, the setup is not much different from a regular Avalonia app and can mostly be reused.
+
+```xml title=App.axaml
+
+
+
+
+
+```
+
+And the code:
+
+```csharp title=App.axaml.cs
+using Avalonia;
+using Avalonia.Headless;
+
+public class App : Application
+{
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}
+```
+
+## Run Headless Session
+
+```csharp title=Program.cs
+using Avalonia.Controls;
+using Avalonia.Headless;
+
+// Start Headless session passing Application type.
+using var session = HeadlessUnitTestSession.StartNew(typeof(App));
+
+// Since the Headless session has its own thread internally, we need to dispatch actions there:
+await session.Dispatch(() =>
+{
+ // Setup controls:
+ var textBox = new TextBox();
+ var window = new Window { Content = textBox };
+
+ // Open window:
+ window.Show();
+
+ // Focus text box:
+ textBox.Focus();
+
+ // Simulate text input:
+ window.KeyTextInput("Hello World");
+
+ // Assert:
+ if (textBox.Text != "Hello World")
+ {
+ throw new Exception("Assert");
+ }
+}, CancellationToken.None);
+```
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-nunit.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-nunit.md
new file mode 100644
index 000000000..e534218b6
--- /dev/null
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-nunit.md
@@ -0,0 +1,91 @@
+---
+id: headless-nunit
+title: Headless Testing with NUnit
+---
+
+## Preparation
+
+This page assumes that NUnit project was already created.
+If not, please follow NUnit "Getting Started" and "Installation" here https://docs.nunit.org/articles/nunit/getting-started/installation.html.
+
+## Install packages
+
+Aside from NUnit packages, we need to install two more packages:
+- [Avalonia.Headless.NUnit](https://www.nuget.org/packages/Avalonia.Headless.NUnit) which also includes Avalonia.
+- [Avalonia.Themes.Fluent](https://www.nuget.org/packages/Avalonia.Themes.Fluent) as even headless controls need a theme
+
+:::tip
+Headless platform doesn't require any specific theme, and it is possible to swap FluentTheme with any other.
+:::
+
+## Setup Application
+As in any other Avalonia app, an `Application` instance needs to be created, and themes need to be applied. When using the Headless platform, the setup is not much different from a regular Avalonia app and can mostly be reused.
+
+```xml title=App.axaml
+
+
+
+
+
+```
+
+And the code:
+
+```csharp title=App.axaml.cs
+using Avalonia;
+using Avalonia.Headless;
+
+public class App : Application
+{
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}
+```
+
+:::note
+Usually, the `BuildAvaloniaApp` method is defined in the Program.cs file, but NUnit/XUnit tests don't have it, so it is defined in the `App` file instead.
+:::
+
+## Initialize NUnit Tests
+
+The `[AvaloniaTestApplication]` attribute wires the tests in the current project with the specific application. It needs to be defined once per project in any file.
+
+```csharp
+[assembly: AvaloniaTestApplication(typeof(TestAppBuilder))]
+
+public class TestAppBuilder
+{
+ public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure()
+ .UseHeadless(new AvaloniaHeadlessPlatformOptions());
+}
+```
+
+## Test Example
+
+```csharp
+[AvaloniaTest]
+public void Should_Type_Text_Into_TextBox()
+{
+ // Setup controls:
+ var textBox = new TextBox();
+ var window = new Window { Content = textBox };
+
+ // Open window:
+ window.Show();
+
+ // Focus text box:
+ textBox.Focus();
+
+ // Simulate text input:
+ window.KeyTextInput("Hello World");
+
+ // Assert:
+ Assert.AreEqual("Hello World", textBox.Text);
+}
+```
+
+Instead of the typical `[Test]` attribute, we need to use `[AvaloniaTest]` as it sets up the UI thread. Similarly, instead of `[Theory]`, there is a `[AvaloniaTheory]` attribute.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-xunit.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-xunit.md
new file mode 100644
index 000000000..07e4859f9
--- /dev/null
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/headless-xunit.md
@@ -0,0 +1,91 @@
+---
+id: headless-xunit
+title: Headless Testing with XUnit
+---
+
+## Preparation
+
+This page assumes that XUnit project was already created.
+If not, please follow XUnit "Getting Started" and "Installation" here https://xunit.net/docs/getting-started/netfx/visual-studio.
+
+## Install packages
+
+Aside from XUnit packages, we need to install two more packages:
+- [Avalonia.Headless.XUnit](https://www.nuget.org/packages/Avalonia.Headless.XUnit) which also includes Avalonia.
+- [Avalonia.Themes.Fluent](https://www.nuget.org/packages/Avalonia.Themes.Fluent) as even headless controls need a theme
+
+:::tip
+Headless platform doesn't require any specific theme, and it is possible to swap FluentTheme with any other.
+:::
+
+## Setup Application
+As in any other Avalonia app, an `Application` instance needs to be created, and themes need to be applied. When using the Headless platform, the setup is not much different from a regular Avalonia app and can mostly be reused.
+
+```xml title=App.axaml
+
+
+
+
+
+```
+
+And the code:
+
+```csharp title=App.axaml.cs
+using Avalonia;
+using Avalonia.Headless;
+
+public class App : Application
+{
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}
+```
+
+:::note
+Usually, the `BuildAvaloniaApp` method is defined in the Program.cs file, but NUnit/XUnit tests don't have it, so it is defined in the `App` file instead.
+:::
+
+## Initialize XUnit Tests
+
+The `[AvaloniaTestApplication]` attribute wires the tests in the current project with the specific application. It needs to be defined once per project in any file.
+
+```csharp
+[assembly: AvaloniaTestApplication(typeof(TestAppBuilder))]
+
+public class TestAppBuilder
+{
+ public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure()
+ .UseHeadless(new AvaloniaHeadlessPlatformOptions());
+}
+```
+
+## Test Example
+
+```csharp
+[AvaloniaFact]
+public void Should_Type_Text_Into_TextBox()
+{
+ // Setup controls:
+ var textBox = new TextBox();
+ var window = new Window { Content = textBox };
+
+ // Open window:
+ window.Show();
+
+ // Focus text box:
+ textBox.Focus();
+
+ // Simulate text input:
+ window.KeyTextInput("Hello World");
+
+ // Assert:
+ Assert.Equal("Hello World", textBox.Text);
+}
+```
+
+Instead of the typical `[Fact]` attribute, we need to use `[AvaloniaFact]` as it sets up the UI thread. Similarly, instead of `[Theory]`, there is a `[AvaloniaTheory]` attribute.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/index.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/index.md
new file mode 100644
index 000000000..bf04e50f0
--- /dev/null
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/headless/index.md
@@ -0,0 +1,163 @@
+---
+id: index
+title: Headless Platform
+---
+
+## Introduction
+The headless platform in AvaloniaUI provides the capability to run Avalonia applications without a visible graphical user interface (GUI). This allows for testing and automation scenarios on systems that lack a graphical environment, such as servers or continuous integration/continuous deployment (CI/CD) environments.
+
+By utilizing the headless platform, you can perform UI testing, execute application scenarios, and validate functionality in a headless environment, saving time and resources compared to manual testing.
+
+## Getting Started
+
+While the Headless platform can be initialized without any dependencies, for convenience, we have created integration packages for common unit testing platforms:
+
+- [Headless Testing with XUnit](./headless-xunit)
+- [Headless Testing with NUnit](./headless-nunit)
+- If you are using another platform or need more control: [Manual setup of the Headless platform](./headless-custom)
+
+## Simulating User Input
+
+As the headless platform doesn't have any real input, every event needs to be raised from the unit test. The Avalonia.Headless package is shipped with a number of helper methods that can be used:
+
+#### `Window.KeyPress(Key key, RawInputModifiers modifiers)`
+
+Simulates a keyboard press on the headless window/toplevel.
+
+#### `Window.KeyRelease(Key key, RawInputModifiers modifiers)`
+
+Simulates a keyboard release on the headless window/toplevel.
+
+#### `Window.KeyTextInput(string text)`
+
+Simulates a text input event on the headless window/toplevel.
+
+:::note
+This event is independent of KeyPress and KeyRelease. If you need to simulate text input to a TextBox or a similar control, please use KeyTextInput.
+:::
+
+#### `Window.MouseDown(Point point, MouseButton button, RawInputModifiers modifiers)`
+
+Simulates a mouse down event on the headless window/toplevel.
+
+:::note
+In the headless platform, there is a single mouse pointer. There are no helper methods for touch or pen input.
+:::
+
+#### `Window.MouseMove(Point point, MouseButton button, RawInputModifiers modifiers)`
+
+Simulates a mouse move event on the headless window/toplevel.
+
+#### `Window.MouseUp(Point point, MouseButton button, RawInputModifiers modifiers)`
+
+Simulates a mouse up event on the headless window/toplevel.
+
+#### `Window.MouseWheel(Point point, Vector delta, RawInputModifiers modifiers)`
+
+Simulates a mouse wheel event on the headless window/toplevel.
+
+#### `Window.DragDrop(Point point, RawDragEventType type, DataObject data, DragDropEffects effects, RawInputModifiers modifiers)`
+
+Simulates a drag and drop target event on the headless window/toplevel. This event simulates a user moving files from another app to the current app.
+
+A simple button click test is a typical example where these methods can be used:
+
+```csharp
+// Create window and button:
+var button = new Button
+{
+ HorizontalAlignment = HorizontalAlignment.Stretch,
+ VerticalAlignment = VerticalAlignment.Stretch
+};
+var window = new Window
+{
+ Width = 100,
+ Height = 100,
+ Content = button
+};
+
+// Subscribe to the button click event:
+var buttonClicked = false;
+button.Click += (_, _) => buttonClicked = true;
+
+// Show the window:
+window.Show();
+
+// Simulate mouse events with a click (mouse down + up):
+window.MouseDown(new Point(50, 50), MouseButton.Left);
+window.MouseUp(new Point(50, 50), MouseButton.Left);
+
+// Assert that the button was clicked:
+Assert.True(buttonClicked);
+```
+
+:::tip
+Just like in any other Avalonia application, it's also possible to raise events directly. For example, with button click `button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent))`. This can be more convenient for most use cases but lacks some flexibility with input parameters.
+:::
+
+## Capturing the Last Rendered Frame
+
+By default, the Headless platform doesn't render anything and instead has a fake/headless drawing backend enabled. However, it is possible to enable the Skia renderer and use it to capture the last rendered frame, which can be compared with an expected image or used in another way.
+
+To enable the Skia renderer, adjust the AppBuilder code as follows:
+
+```csharp title=App.axaml.cs
+public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure()
+ .UseSkia() // enable Skia renderer
+ .UseHeadless(new AvaloniaHeadlessPlatformOptions
+ {
+ UseHeadlessDrawing = false // disable headless drawing
+ });
+```
+
+With the real renderer enabled, you can use the `Window.CaptureRenderedFrame` helper method:
+
+```csharp
+var window = new Window
+{
+ Content = new TextBlock
+ {
+ Text = "Hello World"
+ }
+};
+window.Show();
+
+var frame = window.CaptureRenderedFrame();
+frame.Save("file.png");
+```
+
+:::tip
+The `CaptureRenderedFrame` method returns a WriteableBitmap, allowing you to lock it and read pixel data that can be compared in memory.
+:::
+
+## Simulating User Delay
+
+In real UI applications, there is always some delay between user interactions, which gives the operating system time to run various tasks in the application. These tasks are often delayed and might include operations such as window resize, which on most platforms (including Headless), is asynchronous.
+
+This delay can result in unexpected behavior when some operations have not yet executed.
+
+Obvious solution would be to add `Task.Delay` between these operations, but a more efficient option in Avalonia would be to use the `Dispatcher` API, which allows flushing the jobs queue directly:
+
+```csharp
+var window = new Window();
+window.Show();
+
+window.Width = 100;
+window.Height = 100;
+
+// highlight-start
+Dispatcher.UIThread.RunJobs();
+// highlight-end
+
+Assert.AreEqual(new Size(100, 100), window.ClientSize);
+```
+
+Additionally, the headless platform provides a method to force the render timer to tick, which can be useful in some scenarios:
+
+```csharp
+AvaloniaHeadlessPlatform.ForceRenderTimerTick();
+```
+
+:::tip
+All input helper methods and `CaptureRenderedFrame` internally use these user delay methods, so there is no need to run them twice!
+:::
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/input/pointer.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/input/pointer.md
index f020f3314..12763df48 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/input/pointer.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/input/pointer.md
@@ -1,6 +1,9 @@
---
description: CONCEPTS - Input
---
+
+import PointerPressedSampleScreenshot from '/img/gitbook-import/assets/pressed.gif';
+
# 鼠标和指针设备
在_Avalonia UI_中,您可以使用'pointer'抽象来实现指针设备与应用程序的交互。这可以表示包括但不限于鼠标、触摸板和笔在内的设备。_Avalonia UI_控件具有允许您订阅指针移动、点击和滚轮移动的事件。它们如下所示:
@@ -43,7 +46,7 @@ private void PointerPressedHandler (object sender, PointerPressedEventArgs args)
```
-
+
## 指针位置
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/input/routed-events.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/input/routed-events.md
index 1bdd9fbde..064627d44 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/input/routed-events.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/input/routed-events.md
@@ -1,6 +1,9 @@
---
description: CONCEPTS - Input
---
+
+import InputEventRoutingDiagram from '/img/gitbook-import/assets/input-event-routing.png';
+
# 路由事件
Avalonia中的大多数事件都是作为路由事件实现的。路由事件是在整个树上引发的事件,而不仅仅是引发事件的控件。
@@ -218,7 +221,7 @@ Avalonia的输入事件成对出现,这样一来,用户的一个输入操作
作为输入事件处理工作原理的示例,考虑以下输入事件示例。在下面的树形图示例中,`叶子元素#2`是`PointerPressed`事件的源:
-
+
事件处理的顺序如下:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/layout/layout-zones.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/layout/layout-zones.md
index 180b08462..d192db700 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/layout/layout-zones.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/layout/layout-zones.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Layout
---
+import LayoutZonesDiagram from '/img/gitbook-import/assets/image (25) (2) (1).png';
+
# 布局区域
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/data-persistence.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/data-persistence.md
index 29f433e50..d0556ac45 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/data-persistence.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/data-persistence.md
@@ -63,7 +63,8 @@ public class MainWindow : ReactiveWindow
Watermark="请输入搜索查询"
Margin="20" />
-```"
+```
+
### 创建悬挂驱动程序
这里我们提供了使用`Newtonsoft.Json`并将应用程序状态保存到纯文本文件的实现。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/index.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/index.md
index 10173f56f..c1fb766c8 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/index.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/index.md
@@ -2,6 +2,8 @@
description: CONCEPTS
---
+import ReactiveUINuGetScreenshot from '/img/gitbook-import/assets/image (44) (1).png';
+
# ReactiveUI
:::tip
@@ -18,7 +20,7 @@ _ReactiveUI_是一个高级的、可组合的、功能反应式的模型-视图-
_Avalonia UI_附带了自己的_ReactiveUI_分支,位于`Avalonia.ReactiveUI` _NuGet_包中。
-
+
要在您的_Avalonia UI_应用程序中使用_ReactiveUI_和MVVM模式,请使用_NuGet_包管理器(如上所示)将包添加到您的项目中,或执行以下CLI命令:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/reactive-command.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/reactive-command.md
index 5572717f2..fbc9a1300 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/reactive-command.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/reactive-command.md
@@ -2,6 +2,10 @@
description: CONCEPTS - ReactiveUI
---
+import ReactiveCommandViewScreenshot from '/img/gitbook-import/assets/image (2) (1) (1) (1).png';
+import ReactiveCommandRunOutputScreenshot from '/img/gitbook-import/assets/image (6) (1) (1).png';
+import ReactiveCommandCanExecuteScreenshot from '/img/gitbook-import/assets/image (6) (1) (2).png';
+
# 响应式命令
在本页面中,您将学习如何使用_ReactiveUI_的`ReactiveCommand`和在代码中创建的`ObservableObject`来实现UI的功能逐步展示原则。
@@ -24,7 +28,7 @@ description: CONCEPTS - ReactiveUI
```
-![图片](/img/gitbook-import/assets/image (2) (1) (1) (1).png)
+
您可以添加一个相应的视图模型,如下所示:
@@ -53,7 +57,7 @@ public class MainWindowViewModel : ViewModelBase
这个视图模型还没有执行功能逐步展示。`SubmitCommand`被声明为没有参数和结果(void)。`Create`方法的同步操作参数是您在命令运行时(用户点击按钮时)执行的操作。上面的示例只是在调试窗口中报告该操作。
-![图片](/img/gitbook-import/assets/image (6) (1) (1).png)
+
## 可执行吗?
@@ -79,4 +83,6 @@ SubmitCommand = ReactiveCommand.Create(() =>
}, isInputValid);
```
-现在你会看到,只有在输入了8个字符后,按钮才会变为可用状态。
\ No newline at end of file
+现在你会看到,只有在输入了8个字符后,按钮才会变为可用状态。
+
+
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/reactive-view-model.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/reactive-view-model.md
index f44109439..15d3ee423 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/reactive-view-model.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/reactive-view-model.md
@@ -2,6 +2,8 @@
description: CONCEPTS - ReactiveUI
---
+import ReactiveObjectDiagram from '/img/gitbook-import/assets/image (4) (2).png';
+
# 响应式视图模型
本页面介绍了如何使用_ReactiveUI_的`ReactiveObject`作为视图模型的基础,以实现与_Avalonia UI_的MVVM绑定。
@@ -20,7 +22,7 @@ public class ViewModelBase : ReactiveObject
}
```
-
+
:::info
如果您使用了Avalonia MVVM应用程序解决方案模板,那么您会发现这个基类已经添加到项目的/ViewModels文件夹中。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/routing.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/routing.md
index 86a724b7f..ac91bc1b4 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/routing.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/reactiveui/routing.md
@@ -1,5 +1,7 @@
# 路由
+import ReactiveUIRoutingScreenshot from '/img/gitbook-import/assets/routing.gif';
+
[ReactiveUI 路由](https://reactiveui.net/docs/handbook/routing/)由包含当前 [RoutingState](https://reactiveui.net/api/reactiveui/routingstate/) 的 [IScreen](https://reactiveui.net/api/reactiveui/iscreen/)、多个 [IRoutableViewModel](https://reactiveui.net/api/reactiveui/iroutableviewmodel/) 和一个特定于平台的 XAML 控件 [RoutedViewHost](https://github.com/AvaloniaUI/Avalonia/blob/55458cf7af24d6c987268ab5ff8a1ead1173310b/src/Avalonia.ReactiveUI/RoutedViewHost.cs) 组成。`RoutingState` 管理视图模型导航堆栈,并允许视图模型导航到其他视图模型。`IScreen` 是导航堆栈的根;尽管名称如此,但它的视图不必占据整个屏幕。`RoutedViewHost` 监视 `RoutingState` 的实例,通过创建和嵌入适当的视图来响应导航堆栈中的任何更改。
## 路由示例
@@ -242,5 +244,5 @@ namespace RoutingExample
dotnet run --framework netcoreapp2.1
```
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/services/storage-provider/file-picker-options.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/services/storage-provider/file-picker-options.md
index 78daf4d20..9325cc732 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/services/storage-provider/file-picker-options.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/services/storage-provider/file-picker-options.md
@@ -33,6 +33,18 @@ title: 文件选择器选项 File Picker Options
获取或设置文件打开选择器显示的文件类型集合。
+为文件选择器创建文件类型列表:
+
+```cs
+//这也可以应用于SaveFilePicker。
+var files = await _target.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions()
+{
+ Title = title,
+//您可以添加自定义文件类型,也可以从内置文件类型添加。请参阅“定义自定义文件类型”,了解如何创建自定义文件类型。
+ FileTypeFilter = new[] { ImageAll, FilePickerFileTypes.TextPlain }
+});
+```
+
## FilePickerSaveOptions
### SuggestedFileName
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/content-template.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/content-template.md
index eccb9413f..1acb08ff5 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/content-template.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/content-template.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Data Templates
---
+import ContentTemplateStudentScreenshot from '/img/gitbook-import/assets/image (47).png';
+
# 内容模板
数据模板的目的是定义 _Avalonia UI_ 如何显示您所定义的类创建的对象,该对象不是控件或简单的字符串。
@@ -43,7 +45,7 @@ description: CONCEPTS - Data Templates
在上面的示例中,绑定引用了窗口内容区域中的任何类的属性。这里窗口的内容是与之前相同的学生对象,但是当您运行这段代码时,_Avalonia UI_ 现在会显示如下内容:
-![图片](/img/gitbook-import/assets/image (47).png)
+
以这种方式使用数据模板,您在同一个地方定义并选择了内容的数据模板 - 通过直接设置窗口的 `ContentTemplate` 属性。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/data-templates-collection.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/data-templates-collection.md
index dce53dea2..643430278 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/data-templates-collection.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/data-templates-collection.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Data Templates
---
+import DataTemplatesCollectionStudentScreenshot from '/img/gitbook-import/assets/image (57).png';
+
# 数据模板集合
_Avalonia UI_中的每个控件都有一个`DataTemplates`(数据模板)集合,您可以在其中放置任意数量的数据模板定义。然后,您可以根据类类型选择要用于显示的模板。
@@ -38,5 +40,5 @@ _Avalonia UI_中的每个控件都有一个`DataTemplates`(数据模板)集
这将得到与上一页完全相同的显示效果:
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/data-templates.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/data-templates.md
index 29cc113ec..979d53e4b 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/data-templates.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/data-templates.md
@@ -2,6 +2,10 @@
description: CONCEPTS - Data Templates
---
+import ControlContentButtonScreenshot from '/img/gitbook-import/assets/image (42) (1).png';
+import ControlContentStringScreenshot from '/img/gitbook-import/assets/image (51).png';
+import ControlContentTypeScreenshot from '/img/gitbook-import/assets/image (52).png';
+
# 控件内容
您可能已经看到了在将按钮控件放入_Avalonia UI_窗口的内容区域时会发生什么。
@@ -26,7 +30,7 @@ description: CONCEPTS - Data Templates
窗口会显示一个按钮 - 在此例中水平居中(指定)和垂直居中(默认情况下)。效果如下图所示:
-
+
如果您将一个字符串放入窗口的内容区域,例如:
@@ -44,7 +48,7 @@ description: CONCEPTS - Data Templates
窗口将显示该字符串:
-
+
但是如果您尝试显示在窗口中定义的类的对象会发生什么呢?
@@ -74,7 +78,7 @@ namespace MySample
但是,您将只会看到学生对象的完全限定类名:
-
+
这并不是很有帮助!这是因为_Avalonia UI_没有定义如何显示`Student`类的对象 - 它不是一个控件 - 因此它会退回到`.ToString()`方法,您所看到的只是完全限定的类名。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/reusing-data-templates.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/reusing-data-templates.md
index 4fdb88046..0dde2ace9 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/reusing-data-templates.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/templates/reusing-data-templates.md
@@ -2,6 +2,8 @@
description: CONCEPTS - Data Templates
---
+import ReuseTeacherDataTemplateScreenshot from '/img/gitbook-import/assets/image (50).png';
+
# 重复使用数据模板
如果您在`Window.DataTemplates`集合中定义了数据模板(如前一页所示),则可以在窗口中的任何位置重用它。然而,您还可以扩展数据模板的重用范围,让其在应用程序的任何窗口中都可用。
@@ -80,7 +82,7 @@ namespace MySample
尽管窗口中没有`Teacher`的数据模板,Avalonia UI 会找到您在应用程序中定义的模板,并且显示效果如预期:
-![Teacher Display](/img/gitbook-import/assets/image (50).png)
+
:::warning
请确保在每个数据模板中指定`DataType`,无论它在哪里定义,因为如果_Avalonia UI_无法找到匹配您数据的数据模板,则什么都不会显示!
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/the-mvvm-pattern/avalonia-ui-and-mvvm.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/the-mvvm-pattern/avalonia-ui-and-mvvm.md
index 58b67d29d..f193e6f57 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/the-mvvm-pattern/avalonia-ui-and-mvvm.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/the-mvvm-pattern/avalonia-ui-and-mvvm.md
@@ -2,6 +2,8 @@
description: CONCEPTS - The MVVM Pattern
---
+import MvvmDataBindingDiagram from '/img/gitbook-import/assets/mvvm.png';
+
# Avalonia UI和MVVM
在本页面中,您将了解如何在使用_Avalonia UI_时实现MVVM模式。
@@ -28,7 +30,7 @@ description: CONCEPTS - The MVVM Pattern
数据绑定是允许_Avalonia UI_ MVVM应用程序将视图与视图模型分离的关键技术。您可以将视图与视图模型之间的关系可视化为通过数据绑定连接的两个层:
-
+
请注意,其中一些数据绑定由双向箭头表示,而其他数据绑定则由单向箭头表示。例如,名称和地址输入是双向的 - 您希望将视图模型中的任何更改通知视图,并且将视图中的输入更新到视图模型。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/the-mvvm-pattern/index.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/the-mvvm-pattern/index.md
index 733b55f89..0c37936db 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/the-mvvm-pattern/index.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/the-mvvm-pattern/index.md
@@ -1,9 +1,12 @@
---
description: CONCEPTS
---
+
+import MvvmPatternDiagram from '/img/gitbook-import/assets/image (60).png';
+
# MVVM模式
-
+
Model-View-View Model(MVVM)模式是一种常见的UI应用程序结构方式。它使用数据绑定系统来帮助在视图和视图模型之间传递数据。这意味着它实现了应用程序逻辑(视图模型)与UI显示(视图)的分离。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/ui-composition.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/ui-composition.md
index bc5f7e1d1..9fa8ddc1d 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/ui-composition.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/concepts/ui-composition.md
@@ -1,6 +1,12 @@
---
description: CONCEPTS
---
+
+import CompositionBasicLayoutDiagram from '/img/gitbook-import/assets/image (10) (2).png';
+import CompositionTreesDiagram from '/img/gitbook-import/assets/image (3) (1).png';
+import CompositionUserControlsDiagram from '/img/gitbook-import/assets/image (8) (2).png';
+import CompositionCollectionControlsDiagram from '/img/gitbook-import/assets/image (8) (3).png';
+
# UI组合
UI组合是创建应用程序所需布局的过程。它允许您从组件的排列中构建复杂的视图。其优点包括:
@@ -64,7 +70,7 @@ _Avalonia UI_包含大量内置控件,可以满足大多数UI需求。
另一种UI组合的变体是需要呈现一组项目的情况。
-
+
这种情况将使用内置的重复控件之一,绑定到一个集合;以及使用数据模板来表示集合中的项目。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/macOS.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/macOS.md
index 691071fd7..948b960eb 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/macOS.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/macOS.md
@@ -326,9 +326,9 @@ xcrun altool` 时可能需要发送的更多标志的更多信息,请[查看 A
公证完成后,您应该能够分发您的应用程序!
-{% hint style="info" %}
+:::info
如果您将您的应用程序分发在 `.dmg` 文件中,您需要稍微修改步骤:
-{% endhint %}
+:::
1. 像往常一样将您的 `.app` 进行代码签名(放入 `.zip` 文件中)
2. 将已经进行了公证和附加 `xcrun stapler` 的 `.app` 放入 DMG 中(DMG 现在包含了已经进行公证和附加的 `.app` 文件)。
@@ -654,4 +654,4 @@ jobs:
要验证代码签名是否成功,您需要首先下载应用程序捆绑以触发 macOS 的隔离功能。您可以通过将其通过电子邮件发送给自己,或者使用 WeTransfer 或类似服务来实现这一点。
-一旦下载了应用程序捆绑并希望启动它,您应该会看到 macOS 弹出窗口,显示应用程序已经过扫描,并未发现恶意软件。
\ No newline at end of file
+一旦下载了应用程序捆绑并希望启动它,您应该会看到 macOS 弹出窗口,显示应用程序已经过扫描,并未发现恶意软件。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/get-started/set-up-an-editor.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/get-started/set-up-an-editor.md
index 747d0dc22..54432d693 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/get-started/set-up-an-editor.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/get-started/set-up-an-editor.md
@@ -3,6 +3,9 @@ id: set-up-an-editor
title: 设置编辑器
---
+import AvaloniaVsExtensionMarketplaceScreenshot from '/img/get-started/install-the-avalonia-extension/image (17) (2).png';
+import AvaloniaVsExtensionNuGetScreenshot from '/img/get-started/install-the-avalonia-extension/image (3) (1) (1) (1).png';
+
# 设置编辑器
您可以使用任何代码编辑器创建Avalonia应用程序,但是使用IDE将为您提供Avalonia XAML预览器和代码补全的支持。
@@ -19,9 +22,7 @@ Rider目前还没有提供可视化设计工具,但正在开发中。请参阅
如果您正在使用Visual Studio开发Avalonia,您应该安装[Avalonia for Visual Studio](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaVS)扩展。
-
+
在下一页中,您将了解如何使用代码后台在运行时读取和更改Avalonia UI控件的属性。
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/building-cross-platform-applications/dealing-with-platforms.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/building-cross-platform-applications/dealing-with-platforms.md
index b5c4d2a10..fef8bfb0d 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/building-cross-platform-applications/dealing-with-platforms.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/building-cross-platform-applications/dealing-with-platforms.md
@@ -39,6 +39,7 @@ title: 处理多个平台
* **平台抽象**:此方法利用业务外观模式,在各个平台上提供统一的访问。它将独特的平台实现抽象为一个单一的、连贯的API。其主要优点是能够编写与平台无关的代码,增强了代码的可重用性和可维护性。然而,这种方法可能无法充分利用每个平台的独特功能和能力。
+
## 平台抽象
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/custom-controls/draw-with-a-property.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/custom-controls/draw-with-a-property.md
index a9e2e38e7..557b3e5ef 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/custom-controls/draw-with-a-property.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/custom-controls/draw-with-a-property.md
@@ -3,6 +3,8 @@ id: draw-with-a-property
title: 使用属性绘制
---
+import DrawWithPropertyScreenshot from '/img/gitbook-import/assets/image (1) (2) (2).png';
+
# 使用属性进行绘制
在这个页面上,您将看到如何使用一个简单属性的值来绘制自定义控件,该属性定义了背景颜色。代码现在如下所示:
@@ -48,7 +50,7 @@ namespace AvaloniaCCExample.CustomControls
绘制代码使用_Avalonia UI_图形上下文(传递给渲染方法),绘制一个填充有背景颜色的矩形,大小与控件相同(由`Bounds.Size`对象提供)。
-
+
请注意,控件现在在运行时(如上图)和预览窗格中都显示出来。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/custom-controls/how-to-create-a-custom-controls-library.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/custom-controls/how-to-create-a-custom-controls-library.md
index a7a5d0c0e..2d9ca2254 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/custom-controls/how-to-create-a-custom-controls-library.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/custom-controls/how-to-create-a-custom-controls-library.md
@@ -3,15 +3,18 @@ id: how-to-create-a-custom-controls-library
title: 如何创建自定义控件库
---
+import CustomControlsSolutionScreenshot from '/img/gitbook-import/assets/image (22) (3).png';
+import CustomControlNuGetScreenshot from '/img/gitbook-import/assets/image (11) (2).png';
+
# 如何创建自定义控件库
本指南将向您展示如何创建自定义控件库并在_Avalonia UI_应用程序中引用它。
-
+
在此示例中,将一个自定义控件文件添加到一个.NET类库中。该库已安装了_Avalonia UI_ _NuGet_包:
-
+
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-can-execute.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-can-execute.md
index 5549be60a..1ba05ade2 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-can-execute.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-can-execute.md
@@ -3,6 +3,7 @@ id: how-to-bind-can-execute
title: 如何绑定 Can Execute
---
+import BindCanExecuteScreenshot from '/img/gitbook-import/assets/command4.gif';
# 如何绑定 Can Execute
@@ -86,4 +87,4 @@ namespace AvaloniaGuides.ViewModels
实际上,`WhenAnyValue` 方法有多个重载,最多可以接受 10 个不同的值获取器(用于验证函数参数),以及验证函数本身。
:::
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-to-a-command-with-reactiveui.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-to-a-command-with-reactiveui.md
index f7e823d4b..101d44c7b 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-to-a-command-with-reactiveui.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-to-a-command-with-reactiveui.md
@@ -3,6 +3,7 @@ id: how-to-bind-to-a-command-with-reactiveui
title: 如何使用ReactiveUI绑定命令
---
+import BindReactiveCommandScreenshot from '/img/gitbook-import/assets/command.gif';
# 如何使用ReactiveUI绑定命令
@@ -72,7 +73,7 @@ namespace AvaloniaGuides.ViewModels
当与Reactive命令绑定的控件被激活时(在本例中:当按钮被点击时),将通过Reactive命令调用执行操作的私有方法。
-
+
## 命令参数
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-to-a-command-without-reactiveui.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-to-a-command-without-reactiveui.md
index 477489287..257ecd687 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-to-a-command-without-reactiveui.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/data-binding/how-to-bind-to-a-command-without-reactiveui.md
@@ -3,6 +3,8 @@ id: how-to-bind-to-a-command-without-reactiveui
title: 如何不使用ReactiveUI绑定命令
---
+import BindCommandMethodScreenshot from '/img/gitbook-import/assets/command2.gif';
+import BindCanExecuteMethodScreenshot from '/img/gitbook-import/assets/command3.gif';
# 如何不使用ReactiveUI绑定命令
@@ -34,7 +36,7 @@ namespace AvaloniaGuides.ViewModels
{
public class MainWindowViewModel
{
- private void PerformAction(string msg)
+ public void PerformAction(object msg)
{
Debug.WriteLine($"The action was called. {msg}");
}
@@ -42,7 +44,7 @@ namespace AvaloniaGuides.ViewModels
}
```
-
+
## 能否执行?
@@ -59,12 +61,12 @@ namespace AvaloniaGuides.ViewModels
{
public class MainWindowViewModel
{
- private void PerformAction(string msg)
+ public void PerformAction(object msg)
{
Debug.WriteLine($"The action was called. {msg}");
}
- private bool CanPerformAction(object msg)
+ public bool CanPerformAction(object msg)
{
if (msg!=null) return !string.IsNullOrWhiteSpace( msg.ToString() );
return false;
@@ -92,7 +94,7 @@ namespace AvaloniaGuides.ViewModels
你会发现只有当文本框包含字符串时,按钮才会变为可用状态。
-
+
## **触发“能否执行”**
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/development-guides/accessing-the-ui-thread.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/development-guides/accessing-the-ui-thread.md
index e8974941e..24821e3a1 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/development-guides/accessing-the-ui-thread.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/development-guides/accessing-the-ui-thread.md
@@ -3,6 +3,8 @@ id: accessing-the-ui-thread
title: 如何访问UI线程
---
+import DispatchPostLongRunningScreenshot from '/img/gitbook-import/assets/long1.gif';
+import DispatchInvokeAsyncLongRunningScreenshot from '/img/gitbook-import/assets/long2.gif';
# 如何访问UI线程
@@ -64,7 +66,7 @@ private void ButtonClickHandler(object sender, RoutedEventArgs e)
}
```
-
+
请注意,由于长时间运行的任务在其自己的线程上执行,UI不会失去响应。
@@ -100,7 +102,7 @@ private async void ButtonClickHandler(object sender, RoutedEventArgs e)
}
```
-
+
## 更多信息
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md
index 0dfbe363b..19a6ab8ca 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md
@@ -3,8 +3,7 @@ id: how-to-show-and-hide-a-split-view-pane-with-mvvm
title: How To Show and Hide a Split View Pane with MVVM
---
-
-# How To Show and Hide a Split View Pane with MVVM
+import SplitViewExpanderScreenshot from '/img/gitbook-import/assets/splitview2.gif';
Content in preparation.
@@ -16,4 +15,5 @@ This technique uses a complex **binding path** to locate the parent view model f
TO DO
-
+
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/graphics-and-animations.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/graphics-and-animations.md
index 357712993..d69f64ad1 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/graphics-and-animations.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/graphics-and-animations.md
@@ -3,6 +3,7 @@ id: graphics-and-animations
title: 如何绘制图形
---
+import ShapeAndGeometrySampleScreenshot from '/img/gitbook-import/assets/shapes.png';
# 如何绘制图形
@@ -53,7 +54,7 @@ Avalonia提供了一组常见的矢量绘制2D形状,如`Ellipse`(椭圆)
```
-
+
## 添加动画
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/how-to-create-a-custom-page-transition.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/how-to-create-a-custom-page-transition.md
index 5fe088fad..58b17a401 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/how-to-create-a-custom-page-transition.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/how-to-create-a-custom-page-transition.md
@@ -3,6 +3,7 @@ id: how-to-create-a-custom-page-transition
title: 如何创建自定义页面过渡效果
---
+import CustomPageTransitionScreenshot from '/img/animations/page-transitions/TransitioningContentControl_03.webp';
# 如何创建自定义页面过渡效果
@@ -162,7 +163,7 @@ public class CustomTransition : IPageTransition
}
```
-
+
## 更多信息
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/keyframe-animations.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/keyframe-animations.md
index 4e75ed220..bf6927c98 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/keyframe-animations.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/graphics-and-animation/keyframe-animations.md
@@ -3,12 +3,17 @@ id: keyframe-animations
title: 如何使用关键帧动画
---
+import AnimationKeyframeDiagram from '/img/gitbook-import/assets/image (2) (1) (4).png';
+import KeyframeFadeScreenshot from '/img/gitbook-import/assets/anim1 (1).gif';
+import KeyframeCompositeAnimationScreenshot from '/img/gitbook-import/assets/anim2.gif';
+import LinearEasingScreenshot from '/img/gitbook-import/assets/image (72).png';
+import BounceEaseInScreenshot from '/img/gitbook-import/assets/image (76).png';
# 如何使用关键帧动画
您可以使用关键帧动画来在时间轴上更改一个或多个控件属性。关键帧在动画的 **持续时间** 内由 _Avalonia UI_ 样式中的 **提示** 点定义,并在某个时间点上设置属性的中间值。
-
+
关键帧之间的属性值根据 **缓动函数** 的曲线设置。默认的缓动函数是直线插值。
@@ -62,7 +67,7 @@ title: 如何使用关键帧动画
动画效果如下:
-
+
该动画在矩形控件加载并被样式选择时就会运行。事实上,它在预览窗格中也能运行!
@@ -75,7 +80,7 @@ title: 如何使用关键帧动画
```
-{% endcode %}
-{% code title="Styles1.axaml" %}
```markup
c
+
```
-{% endcode %}
-{% code title="App.axaml" %}
```markup
```
-{% endcode %}
在这个例子中,首先应用了来自文件 **Styles1.axaml** 的样式,所以文件 **Styles2.axaml** 中的样式设置会覆盖之前的样式。最终的 TextBlock 将具有 FontSize="16" 和 Foreground="Green"。在样式文件内部也会发生相同的优先级排序。
@@ -103,7 +97,7 @@ _Avalonia UI_ 的选择器,就像 CSS 选择器一样,当没有匹配的控
-
```
@@ -128,8 +122,6 @@ _Avalonia UI_ 的选择器,就像 CSS 选择器一样,当没有匹配的控
```
-The actual background is rendered by a `ContentPresenter`, which in the default is bound to the Buttons `Background` property. However in the pointer-over state the selector is directly applying the background to the `ContentPresenter (Button:pointerover /template/ ContentPresenter#PART_ContentPresenter`) That's why when our setter was ignored in the previous code example. The corrected code should target content presenter directly as well:
-
实际背景是由 `ContentPresenter` 渲染的,在默认情况下它与按钮的 `Background` 属性绑定。然而,在 pointerover 状态下,选择器直接将背景应用于 `ContentPresenter (Button:pointerover /template/ ContentPresenter#PART_ContentPresenter)`。这就是为什么在前一个代码示例中我们的 setter 被忽略的原因。修正后的代码应该直接针对 content presenter:
```markup
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/animation-settings.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/animation-settings.md
index 6a19553ad..24e36ba96 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/animation-settings.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/animation-settings.md
@@ -2,6 +2,8 @@
description: REFERENCE
---
+import SineEaseOutScreenshot from '/img/gitbook-import/assets/image (67).png';
+
# 动画设置
This section contains full lists of the _Avalonia UI_ animation settings:
@@ -14,7 +16,7 @@ This section contains full lists of the _Avalonia UI_ animation settings:
## 缓动函数(Easing Functions)
-
配置
设置
SineEaseOut
+
配置
设置
SineEaseOut
## 填充模式(Fill Modes)
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/autocompletebox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/autocompletebox.md
index cc7f2e3f5..7b4e263e6 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/autocompletebox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/autocompletebox.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import AutoCompleteBoxScreenshot from '/img/gitbook-import/assets/autocomplete.gif';
+
# Auto-complete Box
The auto-complete box presents a text box for user input and a drop-down that contains possible matches from an items source collection, for the text typed in. The drop-down shows when the user starts to type, and the match is updated for each character typed. The user can select from the drop-down.
@@ -55,11 +57,7 @@ namespace AvaloniaControls.Views
}
```
-
-
-
-
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/button.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/button.md
index a7296e854..a99ed0469 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/button.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/button.md
@@ -2,12 +2,20 @@
description: REFERENCE - Built-in Controls
---
+import ButtonClickHandlerScreenshot from '/img/gitbook-import/assets/button.gif';
+
# 按钮
按钮是一种对指针动作做出反应的控件(也有一些键盘等效操作)。当指针按下时,它会呈现出被按下的状态。
将指针按下到释放的序列解释为点击;此行为是可配置的。
+:::warning
+在确定按钮是否被用户按下时,请始终使用`Click`事件而不是`PointerPressed`。`Click`是`Button`特有的高级事件,表示按钮已被按下。
+
+而`PointerPressed`更像是一个低层次的输入事件:`Button`需要在内部处理这个事件,以引发`Click`事件。由于 `Button` 会处理 `PointerPressed`事件(将`IsHandled`设为 true),应用程序将永远不会像其他控件那样收到该事件。
+:::
+
:::info
点击是众多按钮事件之一,完整列表请参阅[这里](http://reference.avaloniaui.net/api/Avalonia.Controls/Button/#Events)。
:::
@@ -53,7 +61,7 @@ public partial class MainWindow : Window
}
```
-
+
## 更多信息
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/buttonspinner.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/buttonspinner.md
index 2fc0c69fa..b0988beb1 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/buttonspinner.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/buttonspinner.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import ButtonSpinnerScreenshot from '/img/gitbook-import/assets/image (3) (3).png';
+
# 按钮微调器
按钮微调器是一个包含向上和向下微调按钮的控件。该按钮的内容是灵活的,但您需要编写相当多的行为代码。
@@ -20,8 +22,9 @@ description: REFERENCE - Built-in Controls
```
-
-## 更多信息
+
+
+## More Information
:::info
有关此控件的完整API文档,请参阅 [这里](http://reference.avaloniaui.net/api/Avalonia.Controls/ButtonSpinner/).
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/radiobutton.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/radiobutton.md
index c2f6534ef..ab29e3fe5 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/radiobutton.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/radiobutton.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import RadioButtonScreenshot from '/img/gitbook-import/assets/radio.gif';
+
# 单选按钮
单选按钮控件展示了一组选项,用户一次只能选择其中一个。选中的选项以实心圆圈表示,未选中的选项以空心圆圈表示。
@@ -43,7 +45,7 @@ description: REFERENCE - Built-in Controls
```
-![示例图片](/img/gitbook-import/assets/radio.gif)
+
## 更多信息
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/repeatbutton.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/repeatbutton.md
index 3bbff5e09..337418d02 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/repeatbutton.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/repeatbutton.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import RepeatButtonScreenshot from '/img/gitbook-import/assets/repeatbutton.gif';
+
# 重复按钮
重复按钮是一种控件,其特点是在按住按钮时定期生成点击事件。
@@ -43,7 +45,7 @@ public partial class MainWindow : Window
}
```
-![示例图片](/img/gitbook-import/assets/repeatbutton.gif)
+
## 更多信息
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/togglebutton.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/togglebutton.md
index 9d9ef0d18..2ff58f357 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/togglebutton.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/togglebutton.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import ToggleButtonScreenshot from '/img/gitbook-import/assets/toggle.gif';
+
# 切换按钮
切换按钮可以通过使用样式和伪类来呈现布尔值,这些样式和伪类可以存在(true)或不存在(false)。
@@ -85,7 +87,7 @@ description: REFERENCE - Built-in Controls
路径图标的可见性由窗口样式设置,这些样式使用`:checked`伪类来确定切换按钮何时处于已选中状态。因此,当切换按钮被选中时,`audio-on`路径图标可见,而`audio-mute`路径图标隐藏。反之,当切换按钮未选中时,`audio-mute`路径图标可见,而`audio-on`路径图标隐藏。
-
+
## 更多信息
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/togglesplitbutton.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/togglesplitbutton.md
index 152ddb932..991946674 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/togglesplitbutton.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/buttons/togglesplitbutton.md
@@ -1,5 +1,10 @@
# 切换分裂按钮
+import ToggleSplitButtonClosedUncheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_closed_unchecked.png';
+import ToggleSplitButtonClosedCheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_closed_checked.png';
+import ToggleSplitButtonOpenedCheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_opened_checked.png';
+import ToggleSplitButtonTextListScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_TextListExample.png';
+
`ToggleSplitButton` 作为一个带有主要和次要部分的 [`ToggleButton`](togglebutton),每个部分都可以单独按下。主要部分的行为类似于普通的 `ToggleButton`,而次要部分会打开一个带有附加操作的 [`Flyout`](../flyouts)。
:::info
@@ -63,13 +68,16 @@
```
-
+
+
_SplitButton (Flyout closed, unchecked)_
-
+
+
_SplitButton (Flyout closed, checked)_
-
+
+
_SplitButton (Flyout opened, checked)_
### 带编号或项目符号列表的文本编辑器示例
@@ -110,5 +118,6 @@ _SplitButton (Flyout opened, checked)_
```
-
+
+
_Sample of ToggleSplitButton for toggle text lists on and off and selecting the list format_
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/canvas.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/canvas.md
index d0710e129..119af6080 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/canvas.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/canvas.md
@@ -2,13 +2,16 @@
description: REFERENCE - Built-in Controls
---
+import CanvasContentZoneScreenshot from '/img/gitbook-import/assets/image (16) (2).png';
+import CanvasChildOverlapScreenshot from '/img/gitbook-import/assets/image (9) (2).png';
+
# Canvas
The canvas control displays its child controls at specified positions (given as coordinates).
The position of each child control is defined as two distances between edge the canvas content zone, and the outer edge of the child margin zone. For example, this might be the top-left corner of the child to the top-left of canvas, as shown here:
-
+
:::info
To review the concept of layout zones, see [here](../../concepts/layout/layout-zones).
@@ -50,7 +53,7 @@ However you define the drawing sequence, the opacity of child controls is respec
The result looks like this:
-
+
:::info
Use the canvas panel with discretion. While it may be convenient to position child controls like this, your UI will no longer be adaptive to changes in the app window size.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/carousel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/carousel.md
index b1610a8c8..257fdd908 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/carousel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/carousel.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import CarouselScreenshot from '/img/gitbook-import/assets/carousel.gif';
+
# Carousel
The carousel has an items collection, and displays each item as a page, in sequence, so that it fills the control.
@@ -63,9 +65,7 @@ namespace AvaloniaControls.Views
}
```
-
-
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/checkbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/checkbox.md
index 6cbeb25ce..9b9d02baa 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/checkbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/checkbox.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Control
---
+import CheckBoxTwoStateScreenshot from '/img/gitbook-import/assets/checkbox1.gif';
+import CheckBoxThreeStateScreenshot from '/img/gitbook-import/assets/checkbox2.gif';
+
# Check Box
The check box control presents a Boolean value where the true value is represented using a check mark, and the false value is an empty box. The check box has an option to present a nullable Boolean, where the null value represents 'unknown' and is drawn as a shaded box.
@@ -38,7 +41,7 @@ This is an example of two-state check boxes:
Looks like this when running on Windows:
-
+
This is an example of a three-state checkbox:
@@ -60,7 +63,7 @@ This is an example of a three-state checkbox:
Looks like this when running on Windows:
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/colorpicker/README.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/colorpicker/README.md
new file mode 100644
index 000000000..d5a708268
--- /dev/null
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/colorpicker/README.md
@@ -0,0 +1,90 @@
+---
+description: REFERENCE - Built-in Controls
+---
+
+import ColorPaletteFluent from '/img/controls/colorpicker/color-palette-fluent.png';
+import ColorPaletteFlat from '/img/controls/colorpicker/color-palette-flat.png';
+import ColorPaletteFlatHalf from '/img/controls/colorpicker/color-palette-flat-half.png';
+import ColorPaletteMaterial from '/img/controls/colorpicker/color-palette-material.png';
+import ColorPaletteMaterialHalf from '/img/controls/colorpicker/color-palette-material-half.png';
+import ColorPaletteSixteen from '/img/controls/colorpicker/color-palette-sixteen.png';
+
+# ColorPicker
+
+The `ColorPicker` provides a highly customizable, general-purpose control that users can use to select colors in RGB or HSV color space. This implementation is just as much about providing primitive controls that developers can use to build their own color pickers as it is about providing a ready-to-use picker.
+
+The `ColorPicker` includes a family of controls (components):
+
+ * `ColorSpectrum` (primitive) : A two dimensional spectrum for color selection.
+ * `ColorSlider` (primitive) : A slider with a background that represents a single color component.
+ * `ColorPreviewer` (primitive) : Shows a preview color with optional accent colors.
+ * `ColorView` : Presents a color for user editing using a spectrum, palette and component sliders.
+ * `ColorPicker` : Presents a color for user editing using a spectrum, palette and component sliders within a drop down. Editing is available when the drop down flyout is opened; otherwise, only the preview color is shown.
+
+Each primitive component can be used on its own and mixed/matched with others. This allows significant composability that isn't possible with other color picker implementations. For example, you can quickly bind together the `ColorSpectrum`, `ColorSlider` and `ColorPreviewer` primitives to create your own color picker with a brand-new design.
+
+Note on terminology: "color picker" usually refers to the family of controls while `ColorPicker` refers to the specific control.
+
+## Is this the right control?
+
+This control is intended to be used directly to select colors in a user-friendly, developer customizable way. This can be done using either a canvas-type `ColorView` control or a compact `ColorPicker` drop down.
+
+For apps with even more special-purpose needs, each control and primitive component can be independently customized to create a new color picker without having to re-implement all the advanced rendering and color logic. This is very useful to match a specific app's design and usability requirements.
+
+Developers using this control may:
+ 1. Use `ColorView` or `ColorPicker` as-is directly in their apps
+ 2. Customize `ColorView` or `ColorPicker` using the included properties. These properties allow significant changes to the control such as disabling components sliders, showing different palettes or hiding all but the spectrum tab.
+ 3. Create a new color picker to meet a specific app's design and usability requirements using the existing primitive components.
+ 4. Re-template the existing components to create a brand-new fully customized color picker.
+
+## Using in Your App
+
+Avalonia is used in several resource-constrained environments such as embedded devices. For this and other reasons, certain larger controls such as the `ColorPicker` are not included with the main Avalonia UI Nuget packages. This means a bit of extra work is required to add the `ColorPicker` to your app:
+
+ 1. Add the `Avalonia.Controls.ColorPicker` nuget to your project. This MUST match your version of Avalonia's other packages.
+ 2. Add control themes and styles for all color picker controls in `App.axaml` by adding:
+ * `` for Fluent themes **OR**
+ * `` for Simple themes
+
+:::note
+This step is not required for some theme packages such as FluentAvalonia which include all controls by default.
+:::
+
+## Background
+
+This control originated as a re-styling of the one in UWP (later WinUI) using the basic designs implemented for the Windows Community Toolkit. The WinUI `ColorPicker` isn't conducive to smaller screen sizes and the overall design/usability of the control left something to be desired for both users and developers.
+
+With all its features, the WinUI control still wasn't as good as it should be. It couldn't be re-templated and customized without a lot of effort (partially because individual components were highly inter-dependent on each other). It also used a lot of template parts and code-behind. The Avalonia UI version of the control (a complete rewrite) attempts to fix all of these issues and become the predominant XAML color picker design.
+
+Main improvements learning from WinUI were:
+ * The `ColorPicker` is implemented as a drop-down (matching all other "pickers"). There is also a `ColorView` control for those that want the canvas-type control (similar to WinUI).
+ * The Avalonia controls attempt to do everything possible in XAML control themes keeping code-behind to an absolute minimum. This significantly increases composability and enables app developers to customize every part of these controls (and even the primitives in most cases).
+ * Primitives such as the `ColorSlider` and `ColorSpectrum` are fully self-contained and can be used separately enabling app developers to create custom color picker implementations.
+ * A new `HsvColor` struct was added to base Avalonia itself (alongside `Color` and `HslColor`) and is now used in all color picker controls. This simplified code-behind and also made binding of color properties between primitives and controls possible. Color picker controls internally work in HSV color space.
+ * `HsvColor` along with `ColorSlider` together unlock a lot of power compared to WinUI (and enable easy re-templating).
+ * Many new properties (more than in WinUI) were added to control all aspects of the `ColorView` visibility. Each tab can be separately hidden along with most individual subsections. This allows a lot of design customization without having to re-template or use complex style selectors.
+ * Color palettes were added using the `IColorPalette` interface (same as the Windows Community Toolkit). No color palettes are supported in the WinUI version of this control.
+ * New properties such as `SelectedIndex` and `ColorModel` allow customizing the color picker and putting it into a pre-defined state. For example, the WinUI ColorPicker always defaults to RGB and this cannot be changed in code or XAML. This implementation does not have such limitations.
+
+## Controls & Primitives
+
+| Control | Link |
+|---------|------|
+| `ColorPicker` | |
+| `ColorView` | See the dedicated [`ColorView`](colorview.md) page. |
+| `ColorSpectrum` | |
+| `ColorSlider` | |
+| `ColorPreviewer` | |
+
+## Color Palettes
+
+Several pre-defined color palettes implementing the `IColorPalette` interface are provided. Instances of these palettes may be set to the `Palette` property of a `ColorView` or `ColorPicker`.
+
+| Palette | Description |
+|---------|-------------|
+| | Contains the Fluent color palette found in Windows 10 and later. This is the default color palette. |
+| | Contains the full [Flat UI color palette](https://github.com/designmodo/Flat-UI). |
+| | Contains half of [Flat UI color palette](https://github.com/designmodo/Flat-UI) for improved usability especially on mobile devices. |
+| | Contains most of the [Material design color palette](https://material.io/design/color/the-color-system.html#tools-for-picking-colors). In order to make the palette uniform and rectangular the following alterations were made 1. The A100-A700 shades of each color are excluded. These shades do not exist for all colors (Brown/Gray). 2. Black/White are stand-alone colors and are also excluded. |
+| | Contains half of the [Material design color palette](https://material.io/design/color/the-color-system.html#tools-for-picking-colors) shown above for improved usability especially on mobile devices. |
+| | Contains the standard [sixteen color palette](https://en.wikipedia.org/wiki/Web_colors#HTML_color_names) from the HTML 4.01 specification. |
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/colorpicker/colorview.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/colorpicker/colorview.md
new file mode 100644
index 000000000..554799b93
--- /dev/null
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/colorpicker/colorview.md
@@ -0,0 +1,55 @@
+---
+description: REFERENCE - Built-in Controls
+---
+
+# ColorView
+
+Presents a color for user editing using a spectrum, palette and component sliders.
+
+## Common Properties
+
+| Property | Description |
+|----------|-------------|
+| `Color` | Gets or sets the currently selected color in the RGB color model. For control authors, use `HsvColor` instead to avoid loss of precision and color drifting. |
+| `ColorModel` | Gets or sets the active color model used by the sliders. This property is only applicable to the components tab. The spectrum tab must always be in HSV and the palette tab contains only pre-defined colors. |
+| `ColorSpectrumComponents` | Gets or sets the two HSV color components displayed by the spectrum. |
+| `ColorSpectrumShape` | Gets or sets the displayed shape of the spectrum. |
+| `HexInputAlphaPosition` | Gets or sets the position of the alpha component in the hexadecimal input box relative to all other color components. |
+| `HsvColor` | Gets or sets the currently selected color in the HSV color model. This should be used in all cases instead of the `Color` property. Internally, the `ColorSpectrum` uses the HSV color model and using this property will avoid loss of precision and color drifting. |
+| `IsAccentColorsVisible` | Gets or sets a value indicating whether accent colors are visible along with the preview color. |
+| `IsAlphaEnabled` | Gets or sets a value indicating whether the alpha component is enabled. When disabled (set to false) the alpha component will be fixed to maximum and editing controls disabled. |
+| `IsAlphaVisible` | Gets or sets a value indicating whether the alpha component editing controls (Slider(s) and TextBox) are visible. When hidden, the existing alpha component value is maintained. Note that `IsComponentTextInputVisible` also controls the alpha component TextBox visibility. |
+| `IsColorComponentsVisible` | Gets or sets a value indicating whether the color components tab/panel/page (subview) is visible. |
+| `IsColorModelVisible` | Gets or sets a value indicating whether the active color model indicator/selector is visible. |
+| `IsColorPaletteVisible` | Gets or sets a value indicating whether the color palette tab/panel/page (subview) is visible. |
+| `IsColorPreviewVisible` | Gets or sets a value indicating whether the color preview is visible. Note that accent color visibility is controlled separately by `IsAccentColorsVisible`. |
+| `IsColorSpectrumVisible` | Gets or sets a value indicating whether the color spectrum tab/panel/page (subview) is visible. |
+| `IsColorSpectrumSliderVisible` | Gets or sets a value indicating whether the color spectrum's third component slider is visible. |
+| `IsComponentSliderVisible` | Gets or sets a value indicating whether color component sliders are visible. All color components are controlled by this property but alpha can also be controlled with `IsAlphaVisible`. |
+| `IsComponentTextInputVisible` | Gets or sets a value indicating whether color component text inputs are visible. All color components are controlled by this property but alpha can also be controlled with `IsAlphaVisible`. |
+| `IsHexInputVisible` | Gets or sets a value indicating whether the hexadecimal color value text input is visible. |
+| `MaxHue` | Gets or sets the maximum value of the Hue component in the range from 0..359. This property must be greater than `MinHue`. |
+| `MaxSaturation` | Gets or sets the maximum value of the Saturation component in the range from 0..100. This property must be greater than `MinSaturation`. |
+| `MaxValue` | Gets or sets the maximum value of the Value component in the range from 0..100. This property must be greater than `MinValue`. |
+| `MinHue` | Gets or sets the minimum value of the Hue component in the range from 0..359. This property must be less than `MaxHue`. |
+| `MinSaturation` | Gets or sets the minimum value of the Saturation component in the range from 0..100. This property must be less than `MaxSaturation`. |
+| `MinValue` | Gets or sets the minimum value of the Value component in the range from 0..100. This property must be less than `MaxValue`. |
+| `PaletteColors` | Gets or sets the collection of individual colors in the palette. This is not commonly set manually. Instead, it should be set automatically by providing an `IColorPalette` to the `Palette` property. |
+| `PaletteColumnCount` | Gets or sets the number of colors in each row (section) of the color palette. Within a standard palette, rows are shades and columns are colors. This is not commonly set manually. Instead, it should be set automatically by providing an `IColorPalette` to the `Palette` property. |
+| `Palette` | Gets or sets the color palette. This will automatically set both `PaletteColors` and `PaletteColumnCount` overwriting any existing values. |
+| `SelectedIndex` | Gets or sets the index of the selected tab/panel/page (subview). When using the default control theme, this property is designed to be used with the `ColorViewTab` enum. The `ColorViewTab` enum defines the index values of each of the three standard tabs. Use like `SelectedIndex = (int)ColorViewTab.Palette`. |
+
+:::note
+The properties for visibility use the naming pattern "IsThingVisible" rather than "ShowThing" because some elements of the UI have the ability to control both enabled and visible status separately. Naming also matches `Control` in this case.
+:::
+
+## Pseudoclasses
+
+None
+
+## Template Parts
+
+| Name | Type | Description |
+|------|----- |-------------|
+| `PART_HexTextBox` | TextBox | Provides an input or output for hexadecimal color notation that can be parsed by the control. |
+| `PART_TabControl` | TabControl | The main control used to navigate through the spectrum, palette and components tab/panel/page (subviews). This template part is optional and is only required for some validation scenarios of the `SelectedIndex`. |
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/combobox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/combobox.md
index d09181b48..666021625 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/combobox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/combobox.md
@@ -2,6 +2,10 @@
description: REFERENCE - Built-in Control
---
+import ComboBoxMaxDropDownHeightScreenshot from '/img/gitbook-import/assets/combobox1.gif';
+import ComboBoxComplexContentScreenshot from '/img/gitbook-import/assets/combobox2.gif';
+import ComboBoxDataTemplateScreenshot from '/img/gitbook-import/assets/combobox3.gif';
+
# Combo Box
The combo box presents a selected item and a drop-down button that displays a list of options. The length and height of the combo box are determined by the selected item, unless otherwise defined.
@@ -46,7 +50,7 @@ This is basic example with text items has a limit set on the drop-down list heig
```
-
+
This example uses a composed view for each item:
@@ -78,12 +82,10 @@ This example uses a composed view for each item:
```
-
+
This example binds the items in a combo box using a data template. The C# code-behind loads the installed font family names and binds them to the items property.
-
-
```xml
```
-
```csharp title='C#'
using Avalonia.Controls;
using Avalonia.Media;
@@ -120,9 +121,7 @@ namespace AvaloniaControls.Views
}
```
-
-
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/contextmenu.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/contextmenu.md
index e674535d5..30e438d5d 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/contextmenu.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/contextmenu.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import ContextMenuScreenshot from '/img/gitbook-import/assets/contextmenu.gif';
+
# Context Menu
The context menu can be applied to any host control to implement a right-click 'context sensitive' menu. This uses an **attached property** of the host control.
@@ -25,7 +27,7 @@ This example, a context menu is attached to a multi-line text box:
```
-
+
## Context Flyout
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/datagrid/README.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/datagrid/README.md
index 36cf3a59c..d8e556c06 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/datagrid/README.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/datagrid/README.md
@@ -2,6 +2,11 @@
description: REFERENCE - Built-in Controls
---
+import DataGridNuGetScreenshot from '/img/gitbook-import/assets/image (8) (4).png';
+import DataGridSortColumnScreenshot from '/img/gitbook-import/assets/grid1.gif';
+import DataGridReorderColumnScreenshot from '/img/gitbook-import/assets/grid2.gif';
+import DataGridColumnTypesScreenshot from '/img/gitbook-import/assets/grid3.gif';
+
# 数据网格
数据网格以自定义的网格形式展示重复的数据。该控件可以进行样式定制、模板化和绑定。
@@ -20,7 +25,7 @@ description: REFERENCE - Built-in Controls
您必须安装数据网格的_NuGet_包,有几种方法可以做到这一点。您可以使用您的IDE的项目菜单中的**管理NuGet包**:
-
+
或者,您可以在命令行中运行以下指令:
@@ -31,7 +36,7 @@ dotnet add package Avalonia.Controls.DataGrid
或直接在项目(`.csproj`)文件中添加包引用:
```xml
-
+
```
:::warning
@@ -115,7 +120,7 @@ public class Person
}
```
-
+
:::info
这些示例使用了MVVM模式和数据绑定到一个`ObservableCollection`。要了解更多有关数据绑定背后的概念,请参阅[这里](../../../basics/data/data-binding)。
@@ -138,7 +143,7 @@ public class Person
```
-
+
这个示例展示了数据网格如何接受更改并更新底层集合,并使用不同的列类型来编辑数据:
@@ -195,7 +200,7 @@ public class Person
}
```
-
+
## 更多信息
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/datagrid/datagridcolumns.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/datagrid/datagridcolumns.md
index 6633f5f3f..fc89b93b1 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/datagrid/datagridcolumns.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/datagrid/datagridcolumns.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import DataGridColumnPreviewScreenshot from '/img/gitbook-import/assets/image (4) (1).png';
+
# 数据表格列
数据表格可以包含多个数据表格列,_Avalonia UI_ 提供了两种内置列类型,用于显示不同的数据类型,还有一个可以自定义列外观的模板类型。
@@ -110,7 +112,7 @@ public class Person
在预览窗格中可以看到效果,因为 `` 元素创建了绑定的视图模型:
-
+
## 更多信息
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/border.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/border.md
index d4de07860..86f87ad98 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/border.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/border.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import BorderPodLookScreenshot from '/img/gitbook-import/assets/image (8) (1).png';
+import BorderDropShadowScreenshot from '/img/gitbook-import/assets/image (24) (2).png';
+
# Border
The border control decorates a (single) child with a border and background. It can also be used to display rounded corners.
@@ -29,7 +32,7 @@ When all four values are in the list, _Avalonia UI_ will interpret them using th
`CornerRadius="TopLeft TopRight BottomRight BottomLeft"`
:::warning
-If you use the four value pattern; you must provide all four values, even if one of them is zero. Three values are not permitted in the list.
+If you use the four value pattern; you must provide all four values, even if one of them is zero. Three values are not permitted in the list.
:::
### Example
@@ -55,7 +58,7 @@ This example adds some border controls to create a 'pod' look in the layout:
```
-
+
## Box Shadows
@@ -96,7 +99,7 @@ This is an example of a drop-shadow:
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/calendar/README.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/calendar/README.md
index 5efa5ef2a..b9a386dd5 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/calendar/README.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/calendar/README.md
@@ -2,11 +2,16 @@
description: REFERENCE - Built-in Controls
---
+import CalendarBasicUsageScreenshot from '/img/gitbook-import/assets/calendar3.gif';
+import CalendarSingleSelectionScreenshot from '/img/gitbook-import/assets/calendar.gif';
+import CalendarMultipleSelectionScreenshot from '/img/gitbook-import/assets/calendar2.gif';
+import CalendarCustomRangeScreenshot from '/img/gitbook-import/assets/calendar4.gif';
+
# Calendar
The calendar is a control for users to select dates or date ranges.
-
+
## Useful Properties
@@ -26,7 +31,7 @@ This is a basic calendar allowing a single date selection. The calendar's select
```
-
+
This example allows multiple range selections:
@@ -38,7 +43,7 @@ This example allows multiple range selections:
After clicking a start date you can extend a single range by holding the shift key and clicking on the end date. You can add extra dates and ranges by holding the control key and clicking on other dates.
-
+
This example has custom start and end dates, and some dates unavailable. This uses C# code behind the window.
@@ -68,7 +73,7 @@ public partial class MainWindow : Window
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/calendar/calendar-date-picker.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/calendar/calendar-date-picker.md
index 15386ab20..ff9d76a39 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/calendar/calendar-date-picker.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/calendar/calendar-date-picker.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import CalendarDatePickerScreenshot from '/img/gitbook-import/assets/calendardatepicker.gif';
+
# Calendar Date Picker
This is an extension of the calendar control that includes a text box and button. The calendar shows when the user clicks the button (and hides on a subsequent click). The selected date shows in the text box when a date on the calendar is clicked.
@@ -22,7 +24,7 @@ This example shows a basic single date selection calendar when the button is cli
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/menu-flyout.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/menu-flyout.md
index 40e6802d9..ff4472eef 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/menu-flyout.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/menu-flyout.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import MenuFlyoutScreenshot from '/img/gitbook-import/assets/menuflyout.gif';
+
# Menu Flyout
A menu flyout allows you to host a simple menu as the flyout for a control. You might use this as an alternative to the context menu.
@@ -32,12 +34,12 @@ This is a simple example of the menu flyout:
```
:::info
-Note the `` element will not work in a menu flyout. To make a separator line, use a `` element with the header set to '-' as shown above.
+Note the `` element will not work in a menu flyout. To make a separator line, use a `` element with the header set to '-' as shown above.
:::
The resulting menu flyout looks like this:
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/path-icon.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/path-icon.md
index 6d6ea6ba2..288cb4ea9 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/path-icon.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/path-icon.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import PathIconHouseScreenshot from '/img/gitbook-import/assets/image (18).png';
+
# Path Icon
The path icon control can draw an icon graphic from a stream geometry. For example, you can use the icon geometries from the _Avalonia UI_ Fluent icons resource.
@@ -20,25 +22,20 @@ You will probably use these properties most often:
## Example
-
-
```xml
```
-
```xml title='Resources'
M17.9999 2C18.1738 2 18.3411 2.06037 18.4742 2.16902L18.5497 2.23991L21.822 5.76824L21.8527 5.80714C21.9544 5.94281 22.0003 6.09665 22.0003 6.24775L21.9988 8.16674C21.9988 9.16092 21.6202 10.0667 20.9994 10.7478L20.9986 21.25C20.9986 21.6297 20.7165 21.9435 20.3504 21.9932L20.2486 22H3.75113C3.37144 22 3.05764 21.7178 3.00798 21.3518L3.00113 21.25L3.00035 10.7478C2.42729 10.1191 2.06067 9.29893 2.00765 8.39453L2.001 8.16674L2.0008 6.29097C1.99273 6.15366 2.02238 6.01238 2.09673 5.88313L2.16199 5.78767L2.20117 5.74193L5.45006 2.23991C5.56833 2.11243 5.7264 2.03081 5.89656 2.00715L5.99989 2H17.9999ZM15.0818 10.4421L15.0699 10.4598C14.371 11.3944 13.2555 11.9993 11.9987 11.9993C10.7349 11.9993 9.61393 11.3876 8.9158 10.4441C8.21835 11.3876 7.0974 11.9993 5.83357 11.9993C5.36446 11.9993 4.91504 11.915 4.49962 11.7608L4.50089 20.499H5.99951L5.99989 13.751C5.99989 13.3713 6.28204 13.0575 6.64812 13.0079L6.74989 13.001H11.2458C11.6255 13.001 11.9393 13.2832 11.989 13.6492L11.9958 13.751L11.9955 20.499H19.4979L19.4981 11.7615C19.0833 11.9153 18.6346 11.9993 18.1662 11.9993C16.9015 11.9993 15.7799 11.3867 15.0818 10.4421ZM10.4949 14.501H7.49989V20.499H10.4949V14.501ZM17.2546 13.001C17.6343 13.001 17.9481 13.2832 17.9978 13.6492L18.0046 13.751V17.253C18.0046 17.6327 17.7225 17.9465 17.3564 17.9962L17.2546 18.003H13.7532C13.3735 18.003 13.0597 17.7209 13.01 17.3548L13.0032 17.253V13.751C13.0032 13.3713 13.2853 13.0575 13.6514 13.0079L13.7532 13.001H17.2546ZM16.5039 14.501H14.5029V16.503H16.5039V14.501ZM8.16589 7.002H3.50089L3.501 8.16674L3.50717 8.33777L3.53555 8.569L3.5683 8.72528L3.61768 8.89726L3.67203 9.0451L3.71271 9.1391C3.74388 9.20697 3.77821 9.27309 3.81551 9.33727L3.91846 9.49873L3.97274 9.57344L4.10151 9.72909L4.24329 9.87318L4.33953 9.95811L4.38162 9.99243C4.69615 10.2429 5.07686 10.4138 5.49329 10.4747L5.67387 10.4939L5.83357 10.4993C7.06813 10.4993 8.07869 9.54019 8.16076 8.32644L8.16614 8.16674L8.16589 7.002ZM14.3309 7.002H9.66589L9.66614 8.16674C9.66614 9.34763 10.5437 10.3236 11.6822 10.478L11.839 10.4939L11.9987 10.4993C13.2333 10.4993 14.2438 9.54019 14.3259 8.32644L14.3313 8.16674L14.3309 7.002ZM20.4979 7.002H15.8329L15.8336 8.16674C15.8336 9.34763 16.7112 10.3236 17.8497 10.478L18.0065 10.4939L18.1662 10.4993C18.7305 10.4993 19.248 10.2989 19.6514 9.96542L19.7412 9.88731L19.857 9.7736L20.0032 9.60441C20.0572 9.53545 20.1075 9.46337 20.1536 9.38849L20.2571 9.20179L20.32 9.06383L20.3783 8.90873L20.4081 8.81314L20.4463 8.66108L20.4747 8.50352L20.4927 8.33678L20.4988 8.16674L20.4979 7.002ZM9.06151 3.499H6.32689L4.46889 5.502H8.44551L9.06151 3.499ZM13.3685 3.499H10.6305L10.0145 5.502H13.9845L13.3685 3.499ZM17.6719 3.499H14.9375L15.5535 5.502H19.5299L17.6719 3.499Z
```
-
-
It works in the preview pane as well:
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tabcontrol.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tabcontrol.md
index 1d0e6ac31..5fc483c22 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tabcontrol.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tabcontrol.md
@@ -2,11 +2,14 @@
description: REFERENCE - Built-in Controls
---
+import TabControlZonesScreenshot from '/img/gitbook-import/assets/image (2) (4).png';
+import TabControlNavigationScreenshot from '/img/gitbook-import/assets/tabcontrol1.gif';
+
# Tab Control
The tab control allows you to sub-divide a view into tab items.
-
+
Each tab item has a header and a content zone. The headers are presented in a strip, in the sequence they occur in the XAML. When the user clicks on a tab header, its content becomes visible, and is placed below the tab strip in the content zone of the tab control.
@@ -36,7 +39,7 @@ This is simple tab example. The tab content is just some text:
The tab control even works in the preview pane!
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tabstrip.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tabstrip.md
index e6e1ed863..2e7b2cda2 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tabstrip.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tabstrip.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import TabStripNavigation from '/img/gitbook-import/assets/tabstrip.gif';
+
# Tab Strip
Displays a strip of tab headers. You can use this control as a horizontal menu.
@@ -26,7 +28,7 @@ You will probably use this property most often:
It looks like this running on Windows:
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/textblock.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/textblock.md
index 862250b87..e984f1dcc 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/textblock.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/textblock.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import TextBlockStylePreviewScreenshot from '/img/gitbook-import/assets/image (2) (5).png';
+
# Text Block
The text block is a read-only label for the display of text. It can display multiple lines, and features full control over the font used.
@@ -10,7 +12,13 @@ The text block is a read-only label for the display of text. It can display mult
You will probably use these properties most often:
-
Property
Description
FontSize
The size of the font.
FontWeight
The weight of the font. Default is normal, options include Bold'.
FontStyle
A style to apply to the lettering. Default is normal, options include Italic.
TextDecorations
A line decoration to apply to the lettering. Default is none, options include Underline, Strikethrough, Baseline and Overline. To apply more than one at the same time, list the options with spaces between.
+| Property | Description |
+| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| FontSize | The size of the font. |
+| FontWeight | The weight of the font. Default is normal, options include `Bold`. |
+| FontStyle | A style to apply to the lettering. Default is normal, options include `Italic`. |
+| TextDecorations | A line decoration to apply to the lettering. Default is none, options include `Underline`, `Strikethrough`, `Baseline` and `Overline`. To apply more than one at the same time, list the options with spaces between. |
+| xml:space | TextBlock itself would respect the line breaks and whitespace of its content as set out in XAML, but it will be filtered out by the parser without `xml:space="preserve"`. |
## Example
@@ -19,9 +27,9 @@ This example shows a text block used as a heading, single line and multi-line di
```xml
Heading
- This is a single line.
- This is a multi-line display
-that has returns in it.
+ This is a single line.
+ This is a multi-line display
+that has returns in it.
The text block repects the line breaks
as set out in XAML.
@@ -29,7 +37,7 @@ as set out in XAML.
The styling works in the preview pane:
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/textbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/textbox.md
index ea0279516..d846e36da 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/textbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/textbox.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import TextBoxSampleScreenshot from '/img/gitbook-import/assets/textbox.gif';
+
# Text Box
The text box presents an area for typed (keyboard) input. It can be for a single or multiple lines of input.
@@ -27,7 +29,7 @@ This example has a basic one line text box, a password box, and a text-wrapping
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/timepicker.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/timepicker.md
index 611795444..9b1998438 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/timepicker.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/timepicker.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import TimePickerScreenshot from '/img/gitbook-import/assets/timepicker.gif';
+
# Time Picker
The time picker has two or three 'spinner' controls to allow the user to pick a time value. The time picker can work in 24 or 12 hour formats. The picker controls display when the control is clicked.
@@ -24,7 +26,7 @@ This example shows how to create a time picker for the 24 hour clock, with 20 mi
```
-
+
## **Initializing the Time**
@@ -43,7 +45,7 @@ TimePicker timePicker = new TimePicker
};
```
-You can clear the display by resetting the selected time to null.
+You can clear the display by resetting the selected time to null.
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tooltip.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tooltip.md
index b98e4a502..c5113c4fd 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tooltip.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tooltip.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import ToolTipTextScreenshot from '/img/gitbook-import/assets/tooltip.gif';
+import ToolTipContentScreenshot from '/img/gitbook-import/assets/tooltip2.gif';
+
# Tool Tip
The tool tip is a popup that shows its content when the user hovers over the 'host' control to which it is attached.
@@ -10,7 +13,7 @@ The tool tip is a popup that shows its content when the user hovers over the 'ho
You will probably use these properties most often:
-
Property
Description
ToolTip.Tip
Attached property for the the tooltip contents.
ToolTip.Placement
Defines the placement for the tooltip relative to the host or the pointer. Choose from top, bottom, left, right, anchor and gravity, pointer. The default value is pointer which places the tip content at the position where the pointer stops moving.
ToolTip.HorizontalOffset
The tooltip horizontal offset from the placement (default 0).
ToolTip.VerticalOffset
The tooltip vertical offset from the placement (default 20).
ToolTip.ShowDelay
The the amount of time the pointer has to be still before the the tooltip appears. In microseconds (default 400).
+
Property
Description
ToolTip.Tip
Attached property for the tooltip contents.
ToolTip.Placement
Defines the placement for the tooltip relative to the host or the pointer. Choose from top, bottom, left, right, anchor and gravity, pointer. The default value is pointer which places the tip content at the position where the pointer stops moving.
ToolTip.HorizontalOffset
The tooltip horizontal offset from the placement (default 0).
ToolTip.VerticalOffset
The tooltip vertical offset from the placement (default 20).
ToolTip.ShowDelay
The amount of time the pointer has to be still before the tooltip appears. In microseconds (default 400).
## Examples
@@ -21,15 +24,15 @@ This is a simple text-based tooltip, using default values for the placement and
ToolTip.Tip="This is a rectangle" />
```
-
+
To provide a richer presentation for a tooltip, use a `` element. For example:
```markup
-
-
+
+ RectangleSome explanation here.
@@ -37,7 +40,7 @@ To provide a richer presentation for a tooltip, use a `` element. F
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/transitioningcontentcontrol.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/transitioningcontentcontrol.md
index bcab5c5fd..fb1f6ecde 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/transitioningcontentcontrol.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/transitioningcontentcontrol.md
@@ -2,9 +2,12 @@
description: REFERENCE - Built-in Controls
---
+import TransitioningContentControlFadeScreenshot from '/img/controls/transitioningcontentcontrol/TransitioningContentControl_01.webp';
+import TransitioningContentControlSlideScreenshot from '/img/controls/transitioningcontentcontrol/TransitioningContentControl_02.webp';
+
# Transitioning Content Control
-The transitioning content control can use a page transition to animate a content change on an inner control.
+The transitioning content control can use a page transition to animate a content change on an inner control.
You can use this control to display a collection of different images in a slideshow.
@@ -28,7 +31,8 @@ In this example, the view model contains a collection of different images to sho
```
-
+
+
In this example, a different page transition has been specified to slide the images horizontally:
```markup
@@ -44,7 +48,8 @@ In this example, a different page transition has been specified to slide the ima
```
-
+
+
## More Information
:::info
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tray-icon.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tray-icon.md
index 681c5c02d..c7031391f 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tray-icon.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/tray-icon.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import TrayIconScreenshot from '/img/gitbook-import/assets/tray.gif';
+
# Tray Icon
## Overview
@@ -46,7 +48,7 @@ This example defines a simple tray icon menu in the `App.xaml` file :
```
-
+
## More Information
@@ -57,6 +59,3 @@ For the complete API documentation about this control, see here.
:::info
View the source code on GitHub [`TrayIcon.cs`](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/TrayIcon.cs)
:::
-
-
-
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/README.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/README.md
index 963ef100d..ba94abb2e 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/README.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/README.md
@@ -2,6 +2,10 @@
description: REFERENCE - Built-in Controls
---
+import TreeDataGridFilesScreenshot from '/img/gitbook-import/assets/files.png';
+import TreeDataGridCountriesScreenshot from '/img/gitbook-import/assets/countries.png';
+import TreeDataGridNuGetScreenshot from '/img/gitbook-import/assets/image (4).png';
+
# Tree Data Grid
The tree data grid displays hierarchical and tabular data together in a single view. It is a combination of a tree view and data grid.
@@ -23,17 +27,19 @@ The control has two modes of operation:
This is an illustration of a tree data grid displaying hierarchical data:
-
+
+
## Flat Data
This is an illustration An example of a tree data grid displaying flat data:
-
+
+
## NuGet Package Reference
You must install the _NuGet_ package for the data grid, there are several ways of doing this. You can use **Manage NuGet Packages** from the project menu of your IDE:
-
+
Alternatively, you can run this instruction from the command line:
```bash
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/creating-a-flat-treedatagrid.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/creating-a-flat-treedatagrid.md
index 85873a7b4..e139e8440 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/creating-a-flat-treedatagrid.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/creating-a-flat-treedatagrid.md
@@ -2,19 +2,18 @@
description: REFERENCE - Built-in Controls
---
+import FlatTreeDataGridSourceScreenshot from '/img/gitbook-import/assets/treedatagrid2.gif';
+
# Flat Tree Data Grid
## Example
-In this example the view model contains an observable collection that is filled with data and then used to create a `FlatTreeDataGridSource` property to bind to the source of the tree data grid. The items of the grid are class `Person`.
-
-
+In this example the view model contains an observable collection that is filled with data and then used to create a `FlatTreeDataGridSource` property to bind to the source of the tree data grid. The items of the grid are class `Person`.
```
```
-
```csharp title='C# View Model'
using Avalonia.Controls.Models.TreeDataGrid;
using Avalonia.Controls;
@@ -58,7 +57,6 @@ namespace AvaloniaControls.ViewModels
```
-
```csharp title='C# Item Class'
public class Person
{
@@ -75,10 +73,8 @@ public class Person
}
```
-
-
The data source also defines how to map the data model to rows and columns in the tree data grid. Because this example displays flat data, the data source is using a `FlatTreeDataGridSource` property on the view model.
There are three columns defined with the `TextColumn` class. Each takes a lambda to return the column value.
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/creating-a-hierarchical-treedatagrid.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/creating-a-hierarchical-treedatagrid.md
index 9c21c01b8..2606de745 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/creating-a-hierarchical-treedatagrid.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treedatagrid/creating-a-hierarchical-treedatagrid.md
@@ -2,19 +2,18 @@
description: REFERENCE - Built-in Controls
---
+import HierarchicalTreeDataGridSourceScreenshot from '/img/gitbook-import/assets/treedatagrid1.gif';
+
# Hierarchical Tree Data Grid
## Example
-In this example the view model contains an observable collection that is filled with data and then used to create a `HierarchicalTreeDataGridSource` property to bind on to the source of the tree data grid. The items of the grid are class `Person`.
-
-
+In this example the view model contains an observable collection that is filled with data and then used to create a `HierarchicalTreeDataGridSource` property to bind on to the source of the tree data grid. The items of the grid are class `Person`.
```
```
-
```csharp title='C# View Model'
using Avalonia.Controls.Models.TreeDataGrid;
using Avalonia.Controls;
@@ -99,7 +98,6 @@ namespace AvaloniaControls.ViewModels
```
-
```csharp title='C# Item Class'
public class Person
{
@@ -110,12 +108,10 @@ public class Person
}
```
-
-
-The data source also defines how to map the data model to rows and columns in the tree data grid. Because this example displays hierarchical data, the data source is using a `HierarchicalTreeDataGridSource` property on the view model.
+The data source also defines how to map the data model to rows and columns in the tree data grid. Because this example displays hierarchical data, the data source is using a `HierarchicalTreeDataGridSource` property on the view model.
There are three columns defined:
-The first column is defined with a `HierarchicalExpanderColumn` surrounding. This element contains a `TextColumn` that takes a lambda to return the column value, and another that returns the children for the row. The column will display with a chevron button that expands or contracts the child rows (if any). The remaining columns are defined with `TextColumn` alone.
+The first column is defined with a `HierarchicalExpanderColumn` surrounding. This element contains a `TextColumn` that takes a lambda to return the column value, and another that returns the children for the row. The column will display with a chevron button that expands or contracts the child rows (if any). The remaining columns are defined with `TextColumn` alone.
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treeview-1.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treeview-1.md
index 38bd71255..c3ecdfe43 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treeview-1.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/treeview-1.md
@@ -2,17 +2,18 @@
description: REFERENCE - Built-in Controls
---
+import TreeViewAnimalHierarchyScreenshot from '/img/gitbook-import/assets/tree1.gif';
+import TreeViewEnhancedAnimalHierarchyScreenshot from '/img/gitbook-import/assets/tree2.gif';
+
# Tree View
-The tree view control can present hierarchical data and allows item selection. The items are templated so you can customise how they are displayed.
+The tree view control can present hierarchical data and allows item selection. The items are templated so you can customise how they are displayed.
-There are two data sources: the main items source for the control, this gives the root of the hierarchical data. Then then there is the items source in the item template which allows the control to list the next level in the hierarchical data.
+There are two data sources: the main items source for the control, this gives the root of the hierarchical data. Then there is the items source in the item template which allows the control to list the next level in the hierarchical data.
## Example
-This example uses a MVVM pattern view model to hold some hierarchical data based on a C# node class. In this example, there is a single root node in the `Nodes` collection of the view model:
-
-
+This example uses a MVVM pattern view model to hold some hierarchical data based on a C# node class. In this example, there is a single root node in the `Nodes` collection of the view model:
```xml
@@ -24,7 +25,6 @@ This example uses a MVVM pattern view model to hold some hierarchical data based
```
-
```csharp title='C# View Model'
using AvaloniaControls.Models;
using System.Collections.ObjectModel;
@@ -52,7 +52,6 @@ namespace AvaloniaControls.ViewModels
}
```
-
```csharp title='C# Node Class'
using System.Collections.ObjectModel;
@@ -77,16 +76,12 @@ namespace AvaloniaControls.Models
}
```
-
-
By default the root node (or nodes) is shown. The user can expand or contract each node by clicking on the adjacent arrow. Clicking on the node title selects the item.
-
+
This is a development of the previous example with multiple root nodes, a revised item template, and an initial selection made in the view model code:
-
-
```xml
```
-
```csharp title='C# View Model'
using AvaloniaControls.Models;
using System.Collections.ObjectModel;
@@ -148,7 +142,6 @@ namespace AvaloniaControls.ViewModels
}
```
-
```csharp title='C# Node Class'
using System.Collections.ObjectModel;
@@ -173,11 +166,9 @@ namespace AvaloniaControls.Models
}
```
+The tree view adds a scroll bar when it is needed. The selection can be extended by holding down the Ctrl key.
-
-The tree view adds a scroll bar when it is needed. The selection can be extended by holding down the Ctrl key.
-
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/uniform-grid.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/uniform-grid.md
index 3ab3a25f0..d55c5a3d1 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/uniform-grid.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/uniform-grid.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import UniformGridFrenchFlagScreenshot from '/img/gitbook-import/assets/image (1) (2).png';
+
# Uniform Grid
The uniform grid divides the available space evenly in both directions, into cells. You can specify how many divisions to use, and these can be different in either direction.
@@ -24,7 +26,7 @@ You will probably use these properties most often:
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/viewbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/viewbox.md
index da54e4229..e6135a410 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/viewbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/viewbox.md
@@ -2,18 +2,26 @@
description: REFERENCE - Built-in Controls
---
-# View Box
+import ViewboxScaleUniformBothScreenshot from '/img/gitbook-import/assets/scale-uniform-both.gif';
+import ViewboxScaleUniformFillBothScreenshot from '/img/gitbook-import/assets/scale-uniformtofill-both.gif';
+import ViewboxScaleFillBothScreenshot from '/img/gitbook-import/assets/scale-fill-both.gif';
+import ViewboxScaleNoneBothScreenshot from '/img/gitbook-import/assets/scale-none-both.gif';
-The view box is a container control which can scale its contents. The way in which the contents are stretched can be defined, as well as when the stretch will occur (stretch direction).
+import ViewboxScaleUniformDownOnlyScreenshot from '/img/gitbook-import/assets/scale-uniform-downonly.gif';
+import ViewboxScaleUniformUpOnlyScreenshot from '/img/gitbook-import/assets/scale-uniform-uponly.gif';
+
+# Viewbox
+
+The `Viewbox` is a container control which can scale its contents. The way in which the contents are stretched can be defined, as well as when the stretch will occur (stretch direction).
## Useful Properties
You will probably use these properties most often:
| Property | Default | Description |
-| ------------------ | ------- | ------------------------------------------------------------ |
+| ------------------ | ------- |--------------------------------------------------------------|
| `Stretch` | Uniform | Determines how contents are fitted into the available space. |
-| `StretchDirection` | Both | Determines when the scaling occurs. |
+| `StretchDirection` | Both | Determines when the scaling occurs. |
The values for the `Stretch` property are as follows:
@@ -29,9 +37,7 @@ The values for the `StretchDirecton` property are as follows:
### Example
-This simple example shows a view box scaling up a circle uniformly (both stretch and direction are default).
-
-
+This simple example shows a `Viewbox` scaling up a circle uniformly (both stretch and direction are default).
```markup
@@ -39,18 +45,15 @@ This simple example shows a view box scaling up a circle uniformly (both stretch
```
-
### Demonstrations
The following demonstrations show the different combinations of stretch and stretch direction property settings. This first set shows the effect of the stretch property:
-
Stretch Value
Demonstration
Uniform
UniformToFill
Fill
None
+
Stretch Value
Demonstration
Uniform
UniformToFill
Fill
None
This set of demonstrations shows the effect of the stretch direction property:
-
Stretch Direction
Demonstration
Both
-
-
+
Stretch Direction
Demonstration
UpOnly
DownOnly
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/wrappanel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/wrappanel.md
index aaf2544de..b95169f9d 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/wrappanel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/detailed-reference/wrappanel.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import WrapPanelHorizontalScreenshot from '/img/gitbook-import/assets/image (5) (1).png';
+import WrapPanelVerticalScreenshot from '/img/gitbook-import/assets/image (15) (1).png';
+
# Wrap Panel
The wrap panel uses a default arrangement of (multiple) child elements is in sequence from left to right, while they fit in the width. It starts a new line when there is no space left (including any margins and borders).
@@ -26,7 +29,7 @@ You will probably use these properties most often:
```
-
+
```xml
@@ -38,7 +41,7 @@ You will probably use these properties most often:
```
-
+
### More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/dockpanel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/dockpanel.md
index b7b62a0f9..8d11c97c0 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/dockpanel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/dockpanel.md
@@ -2,11 +2,14 @@
description: REFERENCE - Built-in Controls
---
+import DockPanelTopScreenshot from '/img/gitbook-import/assets/image (23).png';
+import DockPanelFillNoOverlapScreenshot from '/img/gitbook-import/assets/image (3) (2).png';
+
# Dock Panel
-The dock panel control arranges its child controls along specified 'docking edges' (top, bottom, left, and right) with the last child filling any remaining space. The dock panel can maintain the child control's dimension that is parallel to the docking edge, so that the child fills all the available space along the docking edge.
+The dock panel control arranges its child controls along specified 'docking edges' (top, bottom, left, and right) with the last child filling any remaining space. The dock panel can maintain the child control's dimension that is parallel to the docking edge, so that the child fills all the available space along the docking edge.
-For example, if the docking edge on a child control is defined as 'top' and it has a height defined, but no width, it will draw like this:
+For example, if the docking edge on a child control is defined as 'top' and it has a height defined, but no width, it will draw like this:
@@ -16,15 +19,15 @@ You must define the child control dimension perpendicular to the docking edge, o
You can optionally define the dimension that is parallel to the docking edge. In this case, the child will be drawn according to the alignment setting in the same direction. For example, a child with a defined width, docked to the top edge, will obey its horizontal alignment property (default center).
-Child controls are docked in the sequence that they are defined in the XAML. When _Avalonia UI_ is sizing a child control, the presence of any previously drawn controls is taken into account. That means there is never any overlap.
+Child controls are docked in the sequence that they are defined in the XAML. When _Avalonia UI_ is sizing a child control, the presence of any previously drawn controls is taken into account. That means there is never any overlap.
-The last child control defined will fill any remaining space.
+The last child control defined will fill any remaining space.
:::warning
You must always define a last child control (with no dock property), or the docking calculation will not perform correctly. This means that a dock panel requires a minimum of two child controls.
:::
-## Useful Properties
+## Useful Properties
You will probably use these properties most often:
@@ -44,7 +47,7 @@ Setting the opacity of the orange rectangle to 0.5 demonstrates that there are n
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/expander.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/expander.md
index f48c7fc20..f6ba9addd 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/expander.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/expander.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import ExpanderClosedScreenshot from '/img/gitbook-import/assets/image (2) (1) (1).png';
+import ExpanderOpenedScreenshot from '/img/gitbook-import/assets/image (12) (2).png';
+
# Expander
The expander control has a header area (always visible) and a collapsible content section that can contain a single child control.
@@ -16,24 +19,24 @@ You will probably use these properties most often:
```xml
-
- Hidden Search
-
-
- Search
-
- Case sensitive?
-
-
+
+ Hidden Search
+
+
+ Search
+
+ Case sensitive?
+
+
```
-
+
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/flyouts.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/flyouts.md
index 3d792649e..3f19a6158 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/flyouts.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/flyouts.md
@@ -2,11 +2,13 @@
description: REFERENCE - Built-in Controls
---
+import FlyoutAttachedScreenshot from '/img/gitbook-import/assets/flyout2.gif';
+
# Flyout
-Flyouts are dismissible containers that can be attached to some classes of 'host' control; although flyouts themselves are not controls. They show when their host control receives the focus, and are hidden again in a number of different ways.
+Flyouts are dismissible containers that can be attached to some classes of 'host' control; although flyouts themselves are not controls. They show when their host control receives the focus, and are hidden again in a number of different ways.
-A flyout can contain simple or richer, composed, UI content.
+A flyout can contain simple or richer, composed, UI content.
Flyouts can be declared as a resource and shared between two or more host controls in an _Avalonia UI_ app.
@@ -23,7 +25,7 @@ A flyout is attached to a host control using the host's `Flyout` property. For e
```
:::warning
-Only the button and split button controls support the `Flyout` property. You can attach a flyout to other _Avalonia UI_ built-in controls using the `AttachedFlyout` property instead.
+Only the button and split button controls support the `Flyout` property. You can attach a flyout to other _Avalonia UI_ built-in controls using the `AttachedFlyout` property instead.
:::
For controls that do not have the `Flyout` property, use the `AttachedFlyout` property like this:
@@ -51,7 +53,7 @@ public void Border_PointerPressed(object sender, PointerPressedEventArgs args)
}
```
-
+
## Useful Properties
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/grid.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/grid.md
index 0531ee2f5..4d875c268 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/grid.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/grid.md
@@ -2,6 +2,8 @@
description: REFERENCE - Controls
---
+import GridSpanningColumnsScreenshot from '/img/gitbook-import/assets/grid_example.png';
+
# Grid
The grid control is useful for arranging child controls in columns and rows. You can define absolute, relative, or proportional row and column geometries for the grid.
@@ -147,7 +149,7 @@ Here, after the absolute width 100 has been subtracted (for column 0), column 1
The button is drawn to fill the span from the cell (column 1, row 1) plus one column (to the right) and one row down. The result looks like this:
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/gridsplitter.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/gridsplitter.md
index 78af8112f..8e436abe9 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/gridsplitter.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/gridsplitter.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import GridSplitterColumnsScreenshot from '/img/gitbook-import/assets/gridsplitter-in-action-columns.gif';
+import GridSplitterRowsScreenshot from '/img/gitbook-import/assets/gridsplitter-in-action-rows.gif';
+
# Grid Splitter
The grid splitter control allows a user to resize the columns or rows in a grid at runtime. The splitter is drawn as a column or row (size can be specified), and has a grip that the user can manipulate at runtime.
@@ -28,7 +31,8 @@ This is a column splitter:
```
-
+
+
This is a row splitter:
```markup
@@ -39,7 +43,7 @@ This is a row splitter:
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/image.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/image.md
index 6ceada3da..3dcb408fe 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/image.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/image.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import ImageUnscaledScreenshot from '/img/gitbook-import/assets/image (6) (1).png';
+import ImageUniformToFillScreenshot from '/img/gitbook-import/assets/image (4) (1) (2).png';
+
# Image
The image can display raster images from a specified image source. The source can be:
@@ -43,7 +46,7 @@ In this next example, introducing the stretch setting `UniformToFill` fits in al
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/itemscontrol.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/itemscontrol.md
index cf4c27284..66ab42278 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/itemscontrol.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/itemscontrol.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Control
---
+import ItemsControlScreenshot from '/img/gitbook-import/assets/items.gif';
+
# Items Control
The items control is the basis for controls that display repeating data (like the list box for example). It has no built-in formatting or interactions; but you can use it with data binding, styling and data templates to create a completely custom repeating data control.
@@ -20,8 +22,6 @@ You will probably use these properties most often:
This example binds an observable collection of crockery items to an items control, where some custom layout and formatting is provided by a data template:
-
-
```xml
List of crockery:
@@ -44,7 +44,6 @@ This example binds an observable collection of crockery items to an items contro
```
-
```csharp title='C# View Model'
using AvaloniaControls.Models;
using System.Collections.Generic;
@@ -73,7 +72,6 @@ namespace AvaloniaControls.ViewModels
}
```
-
```csharp title='C# Item Class'
public class Crockery
{
@@ -88,11 +86,9 @@ public class Crockery
}
```
+The view resizes horizontally, but content is hidden when it is too high. This control does not have a built-in scrollbar (unlike `ListBox`).
-
-The view resizes horizontally, but content is hidden when it is too high. This control does not have a built-in scrollbar (unlike the list box).
-
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/itemsrepeater.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/itemsrepeater.md
index 18d55cc84..2103be749 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/itemsrepeater.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/itemsrepeater.md
@@ -2,9 +2,12 @@
description: REFERENCE - Built-in Controls
---
+import ItemsRepeaterVerticalScreenshot from '/img/gitbook-import/assets/image (2) (6).png';
+import ItemsRepeaterHorizontalScreenshot from '/img/gitbook-import/assets/repeater.gif';
+
# Items Repeater
-The items repeater can display repeating data from a bound data source. It has both a layout template and a data template.
+The items repeater can display repeating data from a bound data source. It has both a layout template and a data template.
:::info
The items repeater is a port of the UWP `ItemsRepeater` control. For further information see [here](https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/items-repeater).
@@ -18,9 +21,7 @@ The default layout template is a vertical stack layout, so that items appear in
## Example
-This example binds an observable collection of crockery items to an items repeater control, where some custom layout and formatting for each item is provided by the data template:
-
-
+This example binds an observable collection of crockery items to an items repeater control, where some custom layout and formatting for each item is provided by the data template:
```xml
@@ -44,7 +45,6 @@ This example binds an observable collection of crockery items to an items repeat
```
-
```csharp title='C# View Model'
using AvaloniaControls.Models;
using System.Collections.Generic;
@@ -73,7 +73,6 @@ namespace AvaloniaControls.ViewModels
}
```
-
```csharp title='C# Item Class'
public class Crockery
{
@@ -88,11 +87,9 @@ public class Crockery
}
```
+
-
-
-
-By default an items repeater will render the items in a vertical stack layout. You can display the items horizontally by overriding this using a `` element, which must contain a stack layout. For example:
+By default, an items repeater will render the items in a vertical stack layout. You can display the items horizontally by overriding this using a `` element, which must contain a stack layout. For example:
```xml
@@ -124,7 +121,7 @@ By default an items repeater will render the items in a vertical stack layout. Y
The items display horizontally, and those too far to the right would be hidden if it were not for the scroll viewer element added around the items repeater.
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/listbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/listbox.md
index 124e9770e..9dfedac95 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/listbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/listbox.md
@@ -2,6 +2,11 @@
description: REFERENCE - Built-in Controls
---
+import ListBoxStringScreenshot from '/img/gitbook-import/assets/listbox1.gif';
+import ListBoxDataTemplateScreenshot from '/img/gitbook-import/assets/listbox2.gif';
+import ListBoxDevToolsScreenshot from '/img/gitbook-import/assets/image (6) (1) (4).png';
+import ListBoxItemStyleScreenshot from '/img/gitbook-import/assets/listbox3.gif';
+
# List Box
The list box displays items from an items source collection, on multiple lines, and allows individual or multiple selection.
@@ -37,15 +42,13 @@ The following selection modes are available for the list box:
These values can be combined, for example:
```markup
-
```
## Example
This simple example has the `Items` property set to an array in the C# code-behind.
-
-
```xml
Choose an animal:
@@ -53,7 +56,6 @@ This simple example has the `Items` property set to an array in the C# code-behi
```
-
```csharp title='C#'
using Avalonia.Controls;
using System.Linq;
@@ -73,13 +75,11 @@ namespace AvaloniaControls.Views
}
```
-
-
-
+
## Item Template
-You can customize how an item is displayed by using an **data template** inside the list box `ItemTemplate` element.
+You can customize how an item is displayed by using an **data template** inside the list box `ItemTemplate` element.
:::info
To review the concepts behind **data template**, see [here](../../concepts/templates/).
@@ -87,8 +87,6 @@ To review the concepts behind **data template**, see [here](../../concepts/templ
This example displays each item inside a blue border with rounded corners. The C# code-behind is the same as before:
-
-
```xml
Choose an animal:
@@ -105,7 +103,6 @@ This example displays each item inside a blue border with rounded corners. The C
```
-
```csharp title='C#'
using Avalonia.Controls;
using System.Linq;
@@ -125,24 +122,20 @@ namespace AvaloniaControls.Views
}
```
+The list is the fill area of the dock panel here, so its height is set to the remaining. This shows the scrollbar in the list box.
-
-The list is the fill area of the dock panel here, so its height is set to the remaining. This shows the scrollbar in the list box.
-
-
+
## Item Styling
Each item displayed in a list box is drawn inside a `ListBoxItem` element. You can see this using the _Avalonia UI Dev Tools_ (F12), using the **Visual Tools** tab. For example:
-
+
The `ListBoxItem` element acts as a container for the content specified in a `ListBox.ItemTemplate` element; but it is not ever defined in the XAML, instead it is generated by _Avalonia UI_.
This means you can target a style to customize the `ListBoxItem` elements in a list box. For example, to give the list items a fixed width of 200 and then right-align them:
-
-
```xml
Choose an animal:
@@ -157,7 +150,6 @@ This means you can target a style to customize the `ListBoxItem` elements in a l
```
-
```csharp title='C#'
using Avalonia.Controls;
using System.Linq;
@@ -177,9 +169,7 @@ namespace AvaloniaControls.Views
}code
```
-
-
-
+
### More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/maskedtextbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/maskedtextbox.md
index 9bd466dea..aca831907 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/maskedtextbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/maskedtextbox.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import MaskedTextBoxScreenshot from '/img/gitbook-import/assets/masked.gif';
+
# Masked Text Box
The masked text box presents an area for typed (keyboard) input, but where the format and characters permitted can be constrained by a mask pattern formed from special characters.
@@ -37,7 +39,7 @@ This is a basic example:
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/menu.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/menu.md
index 345efd1d1..09ba3ea67 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/menu.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/menu.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import MenuTopDockScreenshot from '/img/gitbook-import/assets/menu.gif';
+import MenuWithIconScreenshot from '/img/gitbook-import/assets/menu2.gif';
+
# Menu
The menu control can add menu structure to an application. You will usually place a menu at the top edge of a dock panel control, so that it is drawn at the top of a window.
@@ -51,7 +54,7 @@ This example creates a menu docked at the top edge of a window.
```
-
+
## Accelerator Keys
@@ -65,7 +68,7 @@ It allows the user to access a menu item quickly. It is also sometimes called a
The user can access this feature by first pressing the Alt key, and then the accelerator key (or they can be pressed together). This is demonstrated in the second of the menu sequences in the example above.
-You will see that accelerator keys, where defined, are underlined on the menu as soon as the Alt key is pressed. Then any sub-menus are dropped down as soon as the accelerator key above is pressed.
+You will see that accelerator keys, where defined, are underlined on the menu as soon as the Alt key is pressed. Then any sub-menus are dropped down as soon as the accelerator key above is pressed.
Once keyboard interaction has been initiated with the Alt key, the user can also navigate the menus using the keyboard arrow keys. Menu items may be selected using the Enter key on the keyboard.
@@ -103,7 +106,7 @@ A menu icon can be displayed by placing an image or a path icon in the `
```
-
+
:::info
For more detailed guidance on how to add icons to your menus, see [here](../../guides/graphics-and-animation/how-to-add-menu-icons.md).
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/nativemenu.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/nativemenu.md
index a6b2cc321..bd358d89a 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/nativemenu.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/nativemenu.md
@@ -10,7 +10,7 @@ The native menu can display a menu on _macOS_ and some Linux distributions.
This control can only be used attached to a tray icon. For full details about the tray icon, see the reference [here](detailed-reference/tray-icon.md).
:::
-You can create sub-menus by nesting `` elements.
+You can create sub-menus by nesting `` elements.
You can add menu separator lines by including a `` element or by adding a menu item with its header set to the minus sign, like this:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/numericupdown.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/numericupdown.md
index 4ca8a8d88..eb397cc0f 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/numericupdown.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/numericupdown.md
@@ -2,17 +2,20 @@
description: REFERENCE - Built-in Controls
---
+import NumericUpDownBasicScreenshot from '/img/gitbook-import/assets/updown.gif';
+import NumericUpDownFormatStringScreenshot from '/img/gitbook-import/assets/updown2.gif';
+
# Numeric Up-Down
-The numeric up-down is an editable numeric input with up and down spinner buttons attached. Non-numeric characters are ignored in the input. The value can also be changed by clicking the buttons, or by using the keyboard arrow keys. The the mouse wheel (if present) will also change the value.
+The numeric up-down is an editable numeric input with up and down spinner buttons attached. Non-numeric characters are ignored in the input. The value can also be changed by clicking the buttons, or by using the keyboard arrow keys. The mouse wheel (if present) will also change the value.
## Useful Properties
You will probably use these properties most often:
| Property | Description |
-| ----------------------- | --------------------------------------------------------------------------------------------------------------------------- |
-| `Value` | The value (double). |
+|-------------------------|-----------------------------------------------------------------------------------------------------------------------------|
+| `Value` | The value (decimal?). |
| `Increment` | The increment used by the button spinner, keyboard and mouse wheel. Default increment is 1. |
| `Minimum` | The minimum value allowed. |
| `Maximum` | The maximum value allowed. |
@@ -32,9 +35,9 @@ This is a basic example of a numeric up-down control. There are no limits to the
```
-
+
-The value and other properties are doubles; so you can create a custom decimal increment/decrement and range if you need to.
+The value and other properties are nullable decimals; so you can create a custom decimal increment/decrement and range if you need to.
:::info
Remember to specify a `FormatString` property when you create a custom decimal increment and range.
@@ -51,7 +54,7 @@ For example:
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/panel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/panel.md
index 52b6e0136..5e7593e25 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/panel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/panel.md
@@ -2,9 +2,11 @@
description: REFERENCE - Built-in Controls
---
+import PanelOverlapBlendScreenshot from '/img/gitbook-import/assets/image (7) (1).png';
+
# Panel
-The panel is the most basic control that can contain multiple child controls. Child controls are drawn according to their horizontal and vertical alignment properties, and in the sequence that they appear in the XAML. Child controls will overlap if they occupy the same space.
+The panel is the most basic control that can contain multiple child controls. Child controls are drawn according to their horizontal and vertical alignment properties, and in the sequence that they appear in the XAML. Child controls will overlap if they occupy the same space.
:::info
For a discussion about using other panels, see [here](../../basics/user-interface/building-layouts/panels-overview.md).
@@ -23,7 +25,7 @@ This example uses some 50% opacities to demonstrate that child controls overlap.
```
-
+
## Other Panel Controls
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/progressbar.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/progressbar.md
index a6b4faf83..a4cc806b9 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/progressbar.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/progressbar.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import ProgressBarScreenshot from '/img/gitbook-import/assets/progressbar.png';
+
# Progress Bar
The progress bar presents a value as a proportionately filled bar, with the option to show a caption.
@@ -30,7 +32,7 @@ The progress caption always shows the value with a percentage sign. This is only
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/relativepanel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/relativepanel.md
index e8730efda..d18670791 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/relativepanel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/relativepanel.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import RelativePanelScreenshot from '/img/gitbook-import/assets/image (19) (2).png';
+
# Relative Panel
The relative panel control allows you to arrange its child controls by specifying their position relative to other (sibling) child controls, or in relation to the panel itself. Positions are calculated using the inside of the panel control (content zone) and the outer edge of the margin zone of the child controls.
@@ -19,10 +21,10 @@ You use attached relative position properties to specify the layout of child con
Where `PositionProperty` property is one of the relative position properties (see table below), and `NameOfSibling` is the name property of one of the other child controls.
:::danger
-It is an error to give the value of a relative position property as the name of the child control itself. That would be a circular reference!
+It is an error to give the value of a relative position property as the name of the child control itself. That would be a circular reference!
:::
-You can specify up to four relative position properties per child control - for how the top, bottom, left and right edges are to be calculated.
+You can specify up to four relative position properties per child control - for how the top, bottom, left and right edges are to be calculated.
:::danger
It is an error to define the same relative position property twice for the same child control.
@@ -67,7 +69,7 @@ This XAML shows how to arrange some child controls in different ways:
The result looks like this:
-
+
Here are some notes about the above example:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/scrollbar.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/scrollbar.md
index 3a0de31fe..f8b1bc0c1 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/scrollbar.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/scrollbar.md
@@ -2,26 +2,26 @@
description: REFERENCE - Built-in Controls
---
+import ScrollBarScreenshot from '/img/gitbook-import/assets/scrollbar.gif';
+
# Scroll Bar
-A scroll bar control can be displayed in a horizontal or vertical orientation. The default value (double) range for the scroll bar is 0-100.
+A scroll bar control can be displayed in a horizontal or vertical orientation. The default value (double) range for the scroll bar is 0-100.
-You can configure the range and how the value changes (small and large steps). Small steps can be controlled by the keyboard arrow keys, and large steps by mouse clicks in the scroll bar track, or by the page-up and page-down keys.
+You can configure the range and how the value changes (small and large steps). Small steps can be controlled by the keyboard arrow keys, and large steps by mouse clicks in the scroll bar track, or by the page-up and page-down keys.
-## Useful Properties
+## Useful Properties
You will probably use these properties most often:
Property
Description
Orientation
The orientation of the scroll bar.
VerticalAlignment
The vertical alignment of the scroll bar in its container. Choose from top, bottom, center and stretch.
HorizontalAlignment
The horizontal alignment of the scroll bar in its container. Choose from left, right, center and stretch.
:::warning
-To create a meaningful layout, you will need to use corresponding orientation and alignment properties. For example, a vertical orientation matches a horizontal alignment.
+To create a meaningful layout, you will need to use corresponding orientation and alignment properties. For example, a vertical orientation matches a horizontal alignment.
:::
## Example
-
-
```xml
@@ -33,7 +33,6 @@ To create a meaningful layout, you will need to use corresponding orientation an
```
-
```csharp title='C#'
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
@@ -55,11 +54,9 @@ namespace AvaloniaControls.Views
}
```
+With the example code-behind, the text block displays the value of the scrollbar.
-
-With the example code-behind, the text block displays the value of the scrollbar.
-
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/scrollviewer.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/scrollviewer.md
index c205004e6..d1571345e 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/scrollviewer.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/scrollviewer.md
@@ -2,11 +2,11 @@
description: REFERENCE - Built-in Controls
---
-# Scroll Viewer
-
-The scroll viewer control can have content that is bigger than its content zone, and will can provide scroll bars to move hidden content into view.
+import ScrollViewerScreenshot from '/img/gitbook-import/assets/scrollview.gif';
+# Scroll Viewer
+The scroll viewer control can have content that is bigger than its content zone, and will can provide scroll bars to move hidden content into view.
A `ScrollViewer` cannot be contained in a control that has infinite height or width (depending on scrolling direction) such as a `StackPanel`. To avoid it, you can either set fixed Height/Width or MaxHeight/MaxWidth or choose another container panel.
@@ -20,7 +20,7 @@ You will probably use these properties most often:
If you have a control that can itself scroll (see list below) nested inside a scroll viewer, and the user hits a limit on the control, this property sets whether the outer scroll viewer should continue scrolling or not. You enable or disable this behaviour with an attached property on the inner control, using the format:
- `ScrollViewer.IsScrollChainingEnabled=[true|false]`.
+`ScrollViewer.IsScrollChainingEnabled=[true|false]`
This attached property is available on these controls:
@@ -48,7 +48,7 @@ This example creates a stack panel that is bigger than the border it is inside.
```
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/slider.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/slider.md
index 2bb4bba5f..ae4923be4 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/slider.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/slider.md
@@ -2,9 +2,11 @@
description: REFERENCE - Built-in Controls
---
+import SliderScreenshot from '/img/gitbook-import/assets/slider.gif';
+
# Slider
-The slider control presents its numerical value as the relative position of a slider button along the length of a track. The position is relative to maximum and minimum values.
+The slider control presents its numerical value as the relative position of a slider button along the length of a track. The position is relative to maximum and minimum values.
Drag interaction on the slider button can alter the value between the maximum and minimum values. Keyboard and click interactions can also nudge the value.
@@ -34,7 +36,7 @@ Here the maximum and minimum values are default (0 and 100 respectively).
The slider looks like this on Windows:
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/splitview.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/splitview.md
index 2817b3c10..082a2a723 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/splitview.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/splitview.md
@@ -2,6 +2,9 @@
description: REFERENCE - Built-in Controls
---
+import SplitViewScreenshot from '/img/gitbook-import/assets/image (5) (5) (1).png';
+import SplitViewCompactScreenshot from '/img/gitbook-import/assets/splitview2.gif';
+
# Split View
A split view presents a container with two parts: the main content zone and a side pane. The main content zone is always visible. The pane can be expanded and collapsed. The collapsed pane can be completely hidden, or left slightly open - with enough space to host some icon buttons for example.
@@ -57,13 +60,13 @@ The display mode property controls how the pane is drawn in its open and closed
The control looks like this, running on Windows:
-
+
## Compact Display Mode
You can use the MVVM pattern with the split view control and one of the compact display mode settings to implement a 'tool pane' style UI. There is enough room on the pane when it is closed to display an icon button that opens the pane.
-
+
:::info
To learn how to use the split view control in this way, see the guide [here](../../guides/development-guides/how-to-show-and-hide-a-split-view-pane-with-mvvm.md).
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/stackpanel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/stackpanel.md
index a3c1c73f7..55b5fb89d 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/stackpanel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/stackpanel.md
@@ -2,6 +2,8 @@
description: REFERENCE - Built-in Controls
---
+import StackPanelVerticalRectanglesScreenshot from '/img/gitbook-import/assets/image (14) (2).png';
+
# Stack Panel
The stack panel arranges its child controls by stacking them horizontally or vertically. The stack panel is often used to arrange a small subsection of the UI on a page.
@@ -34,7 +36,7 @@ The following XAML shows how to create a vertical stack panel.
The result shows the child controls stretched to fit the width, and the overall height of the stack panel equal to the sum of the child control heights.
-
+
## More Information
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/jetbrains-rider-ide/jetbrains-rider-setup.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/jetbrains-rider-ide/jetbrains-rider-setup.md
index 4a23c22a4..8e826817a 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/jetbrains-rider-ide/jetbrains-rider-setup.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/jetbrains-rider-ide/jetbrains-rider-setup.md
@@ -2,6 +2,11 @@
description: REFERENCE
---
+import RiderWelcomeScreenshot from '/img/gitbook-import/assets/jetbrains-rider-setup-1-rider-welcome.png';
+import RiderConfigurePluginReposScreenshot from '/img/gitbook-import/assets/jetbrains-rider-setup-2-configure-plugin-repos.png'
+import RiderEnterPluginRepoScreenshot from '/img/gitbook-import/assets/jetbrains-rider-setup-3-enter-plugin-repo.png';
+import RiderInstallAvaloniaPluginScreenshot from '/img/gitbook-import/assets/jetbrains-rider-setup-4-plugin-install.png';
+
# JetBrains Rider 设置
要设置 _JetBrains Rider_ 以用于开发 _Avalonia UI_,请按照以下步骤进行:
@@ -50,21 +55,21 @@ Rider将为您提供 _Avalonia UI_ 最佳的开发体验。它适用于Windows
- 点击**Configure**,然后在下拉菜单中点击**Plugins**。
-
+
**Preferences** 窗口将打开。
- 点击设置(齿轮图标),然后在弹出菜单中点击**Manage Plugin Repositories...**。
-
+
- 在**Custom Plugin Repositories**对话框中,点击加号(`+`)图标,输入URL `https://plugins.jetbrains.com/plugins/dev/14839` ,然后点击**OK**。
-
+
- 回到 Preferences 窗口,点击**Marketplace**并在搜索框中输入 `Avalonia`。在搜索结果窗格中看到**AvaloniaRider**时,点击**Install**。
-
+
- 安装完成后,点击**Restart IDE**(按钮出现)。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/stay-up-to-date/upgrade-from-0.10.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/stay-up-to-date/upgrade-from-0.10.md
index e0fe5c7a9..c0580e17f 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/stay-up-to-date/upgrade-from-0.10.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/stay-up-to-date/upgrade-from-0.10.md
@@ -280,7 +280,7 @@ var focusManager = TopLevel.GetTopLevel(control).FocusManager;
此外,`IFocusManager` API 已更改。
-- 要获取当前聚焦的元素,请使用 `IFocusManager.GetFocusedEleemnt()`
+- 要获取当前聚焦的元素,请使用 `IFocusManager.GetFocusedElement()`
- 要聚焦一个控件,请使用 `control.Focus()`
目前没有监听 `IFocusManager` 的焦点更改的事件。要监听焦点更改,请添加一个监听器到 `InputElement.GotFocusEvent`:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-and-layout-controls.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-and-layout-controls.md
index a12e23629..0b6f6b896 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-and-layout-controls.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-and-layout-controls.md
@@ -2,6 +2,11 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreBuyButtonScreenshot from './images/buy-button.png';
+import MusicStoreFinishedAddButtonScreenshot from '/img/gitbook-import/assets/image (13) (2).png';
+import MusicStoreAddStylesScreenshot from './images/add-styles.png';
+import MusicStorePrettyButtonScreenshot from './images/pretty-button.png';
+
# 添加并排版控件
应用程序的主窗口最终将显示用户收藏的专辑封面列表,右上角会有一个按钮,允许用户添加新的专辑,该按钮将打开一个搜索对话框,用于查找要添加的新专辑。
@@ -34,7 +39,7 @@ description: TUTORIALS - Music Store App
- Click **Debug** to compile and run the project.
-![](images/buy-button.png)
+
您将看到按钮已经出现,但它处于默认位置,而非按照需求所属位于窗口的右上角。
@@ -58,9 +63,7 @@ description: TUTORIALS - Music Store App
点击[这里](./),回顾一下完整的应用程序的外观。
-
-
-
+
您将看到按钮显示一个图标,而不是文本(目前的情况)。这实际上是来自 Fluent Icons 集合的 Microsoft Store 图标,而 Avalonia UI 为您提供了所有这些图标的定义供您使用。
@@ -77,7 +80,7 @@ description: TUTORIALS - Music Store App
- 在 _Rider_ 解决方案资源管理器中,右键单击项目。
- 点击 **添加**,然后点击 **Avalonia Styles**。
-![](images/add-styles.png)
+
- 输入 **名称** 'Icons',然后按回车键。
- 找到并打开新创建的 **Icons.axaml** 文件。XAML 代码将如下所示:
@@ -148,6 +151,6 @@ description: TUTORIALS - Music Store App
- 点击 **调试** 以编译和运行项目。
-![](images/pretty-button.png)
+
在下一页中,您将学习如何将视图中的按钮(MVVM 模式中的视图)链接到视图模型中的命令,以便它可以在那里执行应用程序逻辑。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-content-to-dialog.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-content-to-dialog.md
index 18ebd690c..0873b23a7 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-content-to-dialog.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-content-to-dialog.md
@@ -2,15 +2,15 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreDialogContentDiagram from '/img/gitbook-import/assets/image (9) (3).png';
+
# 添加对话框内容
在这个页面上,您将学习如何向对话框窗口添加一些内容。这些内容将包括搜索控件和对话框关闭按钮,以及一个用于显示专辑封面的占位符列表。这些封面将作为搜索结果加载。
为了布局对话框控件,您将使用 _Avalonia UI_ 内置控件中的停靠面板布局控件。这将使搜索控件无论高度如何,都始终位于对话框的顶部,按钮位于底部。列表将会是停靠面板的“填充”区域,因此它将始终占据所有剩余的内容区域。
-
-
-
+
:::info
有关停靠面板控件的完整信息,请参阅[此处](../../reference/controls/dockpanel.md)的参考文档。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-items-to-users-collection.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-items-to-users-collection.md
index 8127a4ea3..43ba93391 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-items-to-users-collection.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/add-items-to-users-collection.md
@@ -2,6 +2,8 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreAddedAlbumsScreenshot from './images/image-20210310175949319.png';
+
# 将项目添加到用户的集合中
在本页中,您将实现一个包含用户使用搜索对话框和 **购买专辑** 按钮选择的专辑的集合,并在主窗口中显示它们。
@@ -78,7 +80,7 @@ xmlns:views="clr-namespace:Avalonia.MusicStore.Views"
- 点击 **购买专辑**。
- 再次重复。
-![](images/image-20210310175949319.png)
+
您将看到在搜索和选择时用户的专辑集合正在构建。但是,如果停止运行应用程序,然后再次启动它,集合将恢复为空。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/album-view.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/album-view.md
index 1dcbfa0fd..a110bef3d 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/album-view.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/album-view.md
@@ -2,6 +2,10 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreBeforeTemplateScreenshot from '/img/gitbook-import/assets/image (6) (1) (3) (1).png';
+import MusicStoreBeforeWrapPanelScreenshot from './images/image-20210310010932979.png';
+import MusicStoreWrapPanelScreenshot from './images/image-20210310011526700.png';
+
# 专辑视图
在这个页面上,您将通过用图形化的专辑磁贴替换当前显示的文本,继续开发应用程序的搜索结果列表。
@@ -58,9 +62,7 @@ description: TUTORIALS - Music Store App
正如您在上一页中看到的,此时专辑列表只显示了专辑视图模型类的(完全限定的)名称。
-
-
-
+
在这一步中,您将使用项目中由解决方案模板添加的视图定位器类(**ViewLocator.cs** 文件)。该类已经在 **App.axaml** 文件中以数据模板的形式被注册到应用程序的最高级别。数据模板的注册如下所示:
@@ -101,7 +103,7 @@ public class AlbumViewModel : ViewModelBase
- 单击 **调试** 以编译并运行项目。
- 单击图标按钮。
-![](images/image-20210310010932979.png)
+
视图定位器找到了视图 `AlbumView`,并将其用作列表项的数据模板。
@@ -134,6 +136,6 @@ public class AlbumViewModel : ViewModelBase
- 单击 **调试** 以编译并运行项目。
- 单击图标按钮。
-![](images/image-20210310011526700.png)
+
在下一页中,您将以数据服务的形式添加一些业务逻辑,以便您可以从搜索中获取真实的专辑数据。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/creating-a-modern-looking-window.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/creating-a-modern-looking-window.md
index 2bfd5d5cf..d14bf8723 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/creating-a-modern-looking-window.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/creating-a-modern-looking-window.md
@@ -2,6 +2,10 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreDarkModePreviewScreenshot from './images/dark-mode-preview.png';
+import MusicStoreAcrylicMaterialScreenshot from './images/acrylic-material.png';
+import MusicStoreFullAcrylicWindowScreenshot from './images/full-acrylic-window.png';
+
# 窗口样式
在本页中,您将通过对窗口背景应用暗色主题和亚克力模糊效果,来使主窗口看起来现代化。
@@ -27,7 +31,7 @@ description: TUTORIALS - Music Store App
预览窗格现在会切换到暗色模式。
-![](images/dark-mode-preview.png)
+
## 亚克力模糊效果
@@ -65,7 +69,7 @@ description: TUTORIALS - Music Store App
- 单击 **调试**(IDE 右上角)以编译并运行项目。
-![](images/acrylic-material.png)
+
注意,正如预期的那样,亚克力窗口效果覆盖了主窗口的内容区域,但该效果还尚未延伸到标题栏。
@@ -89,6 +93,6 @@ description: TUTORIALS - Music Store App
- 单击 **调试** 以编译并运行项目。
-![](images/full-acrylic-window.png)
+
现在,您已经将亚克力模糊效果延伸到标题栏中。在下一页中,您将学习如何在窗口中添加并排版控件。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/creating-the-project.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/creating-the-project.md
index 7fb28519b..f8e131381 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/creating-the-project.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/music-store-app/creating-the-project.md
@@ -2,6 +2,11 @@
description: TUTORIALS - Music Store App
---
+import MusicStoreCreateSolutionScreenshot from './images/CreateSolution.png';
+import MusicStoreProjectStructureScreenshot from './images/project-structure.png';
+import MusicStoreRiderDebugButtonScreenshot from './images/debug-button.png'
+import MusicStoreNewAppScreenshot from './images/image-20210310192926578.png'
+
# 创建一个新项目
在本页面上,您将学习如何为应用程序创建一个新项目。
@@ -22,15 +27,11 @@ description: TUTORIALS - Music Store App
- 向**解决方案名称**输入 “Avalonia.MusicStore”。
- 点击**创建**。
-
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/add-item-buttons.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/add-item-buttons.md
index efb3ed58c..d140d244c 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/add-item-buttons.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/add-item-buttons.md
@@ -2,6 +2,9 @@
description: TUTORIALS - To Do List App
---
+import ToDoOkDisabledScreenshot from '/img/gitbook-import/assets/image (21) (2).png';
+import ToDoOkEnabledScreenshot from '/img/gitbook-import/assets/image (41).png';
+
# 添加项目按钮
在本页面中,您将学习如何通过为添加事项视图中的按钮添加操作来完成待办事项列表应用程序。您将包括一些显示功能,该功能在用户输入后禁用 OK 按钮。
@@ -134,13 +137,8 @@ CancelCommand = ReactiveCommand.Create(() => { });
运行应用程序并点击 **Add Item**。现在您应该会看到,只有在描述输入框中输入一些文本时,OK 按钮才会启用。
-
-
-
+
-
-
-
-
+
在下一页中,您将学习如何处理新的待办事项,以便在用户点击 OK 后出现在列表中。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/adding-new-items.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/adding-new-items.md
index 7eef4dcc9..7665da099 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/adding-new-items.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/adding-new-items.md
@@ -2,6 +2,8 @@
description: TUTORIALS - To Do List App
---
+import ToDoAddNewItemsScreenshot from '/img/gitbook-import/assets/image (44).png';
+
# 添加新项目
在本教程的早期阶段,当您创建 `ToDoListView` 用户控件时,您添加了一个按钮,以便用户可以添加新项目。在本页面中,您将为按钮添加一个动作。
@@ -74,14 +76,12 @@ dotnet new avalonia.usercontrol -o Views -n AddItemView --namespace ToDoList.Vi
这样,您就得到了一个如下图所示的视图:
-
-
-
+
新视图有一个文本框控件,其中有三个属性供您查看:
* `AcceptsReturn` 创建一个多行文本框。
-* `Text` 将文本框中显示的文本绑定到视图模型上的 `Description` 属性(您还没有创建视图模型)。
+* `Text` 将文本框中显示的文本绑定到视图模型上的(您在上面创建的) `Description` 属性。
* `Watermark` 当文本框为空时显示一个占位符。
在下一页中,您将学习如何更改主窗口中的视图,以在待办事项列表视图的位置显示新项目视图。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/conclusion.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/conclusion.md
index 83545827a..0e40d5909 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/conclusion.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/conclusion.md
@@ -2,6 +2,8 @@
description: TUTORIALS - To Do List App
---
+import ToDoFinalArchitectureDiagram from '/img/gitbook-import/assets/image (2) (3).png';
+
# 结论
在本页面中,您将了解为什么以这种方式实现应用程序,并推荐一些进一步阅读。
@@ -10,9 +12,7 @@ description: TUTORIALS - To Do List App
本教程使用了一个应用程序解决方案架构,该架构采用MVVM模式,并在主窗口的内容之间进行交换以在页面之间导航,同时保留“顶层”视图模型以提供应用程序状态。页面(视图)由 _Avalonia UI_ 用户控件组成。
-
-
-
+
这个教程应用程序针对的是 `Windows` 平台,其中存在主窗口,因此可能看起来是一种过于复杂的方法。
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/creating-a-new-project.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/creating-a-new-project.md
index 1a687b814..30733756d 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/creating-a-new-project.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tutorials/todo-list-app/creating-a-new-project.md
@@ -2,9 +2,16 @@
description: TUTORIALS - To Do List App
---
+import ToDoCreateNewProjectScreenshot from '/img/gitbook-import/assets/image (43).png';
+import ToDoNewSolutionScreenshot from '/img/gitbook-import/assets/image (3) (1) (1).png';
+
# 创建新项目
-在本页中,您将学习如何为待办事项列表应用创建一个新项目。
+在本页中,您将学习如何为待办事项列表应用创建一个新项目。有两种方式可以选择:
+
+1. **Visual Studio Extension Template**: If you prefer using Visual Studio, follow the instructions below to create your project.
+
+2. **.NET Core CLI Command**: Alternatively, if you prefer command-line tools, you can use the .NET Core CLI command. Here's how:
## Visual Studio
@@ -14,9 +21,7 @@ description: TUTORIALS - To Do List App
有关扩展的完整说明,请参阅:[这里](../../get-started/install-the-avalonia-extension.md).
:::
-
-
-
+
@@ -31,9 +36,7 @@ description: TUTORIALS - To Do List App
新创建的解决方案将如下所示:
-
+
## 按钮命令
@@ -125,17 +126,9 @@ For information about the concept of binding source expressions, see [here](../.
现在,如果运行应用程序并单击 **Add Item**,您将看到新视图出现。
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/animations/page-transitions.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/animations/page-transitions.md
index 8e2b767d6..c6f7b195b 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/animations/page-transitions.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/animations/page-transitions.md
@@ -6,6 +6,8 @@ title: Page Transitions
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import CustomPageTransitionScreenshot from '/img/animations/page-transitions/TransitioningContentControl_03.webp';
+
`PageTransitions` are used to render a transition between two views, for example in a [Carousel](../controls/carousel) or [TransitioningContentControl](../controls/TransitioningContentControl)
:::warning
@@ -270,9 +272,7 @@ public class CustomTransition : IPageTransition
}
```
-
-
-
+
#### Source code
[IPageTransition.cs](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Visuals/Animation/IPageTransition.cs)
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/community.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/community.md
index 45728fe80..d79f110dd 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/community.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/community.md
@@ -1,7 +1,13 @@
# Community Support
+import TelegramLogoScreenshot from '/img/gitbook-import/assets/image (7) (1) (1).png';
+import GitterLogoScreenshot from '/img/gitbook-import/assets/image (38) (1) (1).png';
+import GitterChatScreenshot from '/img/gitbook-import/assets/image (37) (1) (1).png';
+
## Telegram
+
+
You can also access the Avalonia chat using the _Telegram_ app (recommended for the best experience).
:::info
@@ -10,15 +16,12 @@ You can access the _Telegram_ chat [here](https://t.me/Avalonia).
## Gitter
-
+
We run a chat in English on the Gitter platform.
-
+
:::info
Access the chat in your browser using Gitter [here](https://gitter.im/AvaloniaUI/Avalonia).
:::
-
-
-
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/border.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/border.md
index 9d133207e..40b96c110 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/border.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/border.md
@@ -3,6 +3,9 @@ id: border
title: Border
---
+import BorderSampleScreenshot from '/img/controls/border/image (2).png';
+import BorderBoxShadowScreenshot from '/img/controls/border/image (8).png';
+
The `Border` control decorates a child with a border and background. It can also be used to display rounded corners by setting the [`CornerRadius`](http://reference.avaloniaui.net/api/Avalonia/CornerRadius/) property.
An example of a border with a red background, 2 pixel black border, 3 pixel corner radius and a 4 pixel padding around its content:
@@ -20,9 +23,7 @@ An example of a border with a red background, 2 pixel black border, 3 pixel corn
```
-
-
-
+
## Box Shadows
@@ -61,9 +62,7 @@ To specify multiple shadows, provide a comma-separated list of shadows.
```
-
-
-
+
## Common Properties
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/button.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/button.md
index 7f6a597ee..0d659ce63 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/button.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/button.md
@@ -3,6 +3,9 @@ id: button
title: Button
---
+import ButtonBasicScreenshot from '/img/controls/buttons/button/button_basic.png';
+import ButtonColoredScreenshot from '/img/controls/buttons/button/image.png';
+
The `Button` control is a [`ContentControl`](../contentcontrol) which reacts to pointer presses.
A button notifies clicks by raising the [`Click`](http://reference.avaloniaui.net/api/Avalonia.Controls/Button/61B1E7A8) event. A click is distinct from a `PointerDown` event in that it is raised by default when the button is pressed and then released (although this behavior can be changed by setting the [`ClickMode`](http://reference.avaloniaui.net/api/Avalonia.Controls/ClickMode/) property).
@@ -55,17 +58,14 @@ The Button control's full documentation can be found [here](http://reference.ava
x:Class="AvaloniaAppTemplate.MainWindow"
Title="AvaloniaAppTemplate">
-
+
```
-produces following output with **Windows 10**\
-
-
-
-
+produces following output with **Windows 10**
+
### Colored button
@@ -83,11 +83,9 @@ produces following output with **Windows 10**\
```
-produces following output with **Windows 10**\
+produces following output with **Windows 10**
-
-
-
+
### Play button
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/splitbutton.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/splitbutton.md
index a07b62dbc..b94bccdf7 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/splitbutton.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/splitbutton.md
@@ -3,6 +3,11 @@ id: splitbutton
title: SplitButton
---
+import SplitButtonClosedScreenshot from '/img/controls/buttons/splitbutton/SplitButtonClosed.png';
+import SplitButtonOpenedScreenshot from '/img/controls/buttons/splitbutton/SplitButtonOpened.png';
+import SplitButtonColorPickerScreenshot from '/img/controls/buttons/splitbutton/SplitButton_ColorPickerSample.png';
+import SplitButtonExportButtonScreenshot from '/img/controls/buttons/splitbutton/SplitButton_ExportButtonSample.png';
+
The `SplitButton` functions as a [`Button`](button) with primary and secondary parts that can each be pressed separately. The primary part behaves like normal `Button` and the secondary part opens a [`Flyout`](../flyouts) with additional actions.
@@ -58,16 +63,11 @@ The user-selection action should be invoked immediately when pressing either the
```
-
-
-
-
+
*SplitButton (Flyout closed)*
-
-
-
+
*SplitButton (Flyout opened)*
@@ -106,9 +106,7 @@ A common use case of a `SplitButton` is for coloring text within an editor. Pres
```
-
-
-
+
*Sample of SplitButton for color selection*
@@ -133,8 +131,6 @@ Another common example of the `SplitButton` could be an export button. When the
```
-
-
-
+
*Sample of a SplitButton with different export options*
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/togglesplitbutton.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/togglesplitbutton.md
index 627be38f5..6741f1ef0 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/togglesplitbutton.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/buttons/togglesplitbutton.md
@@ -3,6 +3,11 @@ id: togglesplitbutton
title: ToggleSplitButton
---
+import ToggleSplitButtonClosedUncheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_closed_unchecked.png';
+import ToggleSplitButtonClosedCheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_closed_checked.png';
+import ToggleSplitButtonOpenedCheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_opened_checked.png';
+import ToggleSplitButtonTextListScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_TextListExample.png';
+
The `ToggleSplitButton` functions as a [`ToggleButton`](togglebutton) with primary and secondary parts that can each be pressed separately. The primary part behaves like a normal `ToggleButton` and the secondary part opens a [`Flyout`](../flyouts) with additional actions.
:::info
@@ -66,21 +71,15 @@ Pressing a configuration in the `Flyout` should either (1) turn on the feature w
```
-
-
-
+
*SplitButton (Flyout closed, unchecked)*
-
-
-
+
*SplitButton (Flyout closed, checked)*
-
-
-
+
*SplitButton (Flyout opened, checked)*
@@ -122,10 +121,6 @@ Continuing the text editor example from `SplitButton`, a common use case of the
```
-
-
-
-
+
*Sample of ToggleSplitButton for toggle text lists on and off and selecting the list format*
-
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/canvas.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/canvas.md
index 74e81cf13..761924466 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/canvas.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/canvas.md
@@ -3,6 +3,8 @@ id: canvas
title: Canvas
---
+import CanvasChildOverlapScreenshot from '/img/controls/canvas/layout-panel-canvas.png';
+
The `Canvas` control is a `Panel` which lays out its children by explicit coordinates.
You specify the positions of individual child elements by setting the `Canvas.Left` and `Canvas.Top` attached properties on each element.
@@ -24,11 +26,7 @@ Here's an example of a Canvas in XAML.
The result looks like this.
-
-
-
-
-
+
Use the Canvas panel with discretion. While it's convenient to be able to precisely control positions of elements in UI for some scenarios, a fixed positioned layout panel causes that area of your UI to be less adaptive to overall app window size changes.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/checkbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/checkbox.md
index 99a85a93b..1e7652a73 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/checkbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/checkbox.md
@@ -3,6 +3,9 @@ id: checkbox
title: CheckBox
---
+import CheckBoxTwoStateScreenshot from '/img/controls/checkbox/checkbox_basic.png';
+import CheckBoxThreeStateScreenshot from '/img/controls/checkbox/checkbox_threestate.png';
+
The `CheckBox` control is a [`ContentControl`](../controls/contentcontrol) which allows user to check an option. It is usually used to display a boolean option where selection is either _checked_ or _unchecked_. But it also supports three state mode where selection is either _checked_, _indeterminate_ or _unchecked_.
## Common Properties
@@ -39,12 +42,9 @@ The `CheckBox` control is a [`ContentControl`](../controls/contentcontrol) which
```
-produces following output with **Windows 10**\
-
-
-
-
+produces following output with **Windows 10**
+
### Three state checkbox
@@ -64,8 +64,6 @@ produces following output with **Windows 10**\
```
-produces following output with **Windows 10**\
+produces following output with **Windows 10**
-
-
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/contentcontrol.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/contentcontrol.md
index 69d58a38f..752f67a52 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/contentcontrol.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/contentcontrol.md
@@ -3,6 +3,8 @@ id: contentcontrol
title: ContentControl
---
+import ControlContentStudentScreenshot from '/img/controls/contentcontrol/student-first-last-name (1) (1) (1) (1).png';
+
## Common Properties
| Property | Description |
@@ -73,7 +75,7 @@ namespace Example
}
```
-> Note: The following examples assume an instance of `MainWindowVieModel` is assigned to the Window's `DataContext`. See [the section on `DataContext`](docs/data-binding/the-datacontext) for more information.
+> Note: The following examples assume an instance of `MainWindowVieWModel` is assigned to the Window's `DataContext`. See [the section on `DataContext`](docs/data-binding/the-datacontext) for more information.
We can display the student's first and last name in a `ContentControl` using the `ContentTemplate` property:
@@ -94,9 +96,6 @@ We can display the student's first and last name in a `ContentControl` using the
```
-
-
-
-
+
-For more information see the [data templates](docs/templates/data-templates) section.
\ No newline at end of file
+For more information see the [data templates](docs/templates/data-templates) section.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/datepicker.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/datepicker.md
index a1ffa81e5..f98635880 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/datepicker.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/datepicker.md
@@ -6,6 +6,9 @@ title: DatePicker
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import DatePickerSelectedDateScreenshot from '/img/controls/datepicker/selected-date.png';
+import DatePickerUnsetScreenshot from '/img/controls/datepicker/no-date.png';
+
The `DatePicker` control allows the user to pick a date value.
## Examples
@@ -37,9 +40,7 @@ DatePicker birthDatePicker = new DatePicker();
Use a `DatePicker` to let a user enter a date value. The user picks the date using [ComboBox](combobox.md) selection for month, day, and year values. You can customize the `DatePicker` in various ways to suit your app.
-
-
-
+
### Formatting the date picker
@@ -53,9 +54,7 @@ The date picker control has both `Date` / `DateChanged` and `SelectedDate` / `Se
The value of `SelectedDate` is used to populate the date picker and is `null` by default. If `SelectedDate` is `null`, the `Date` property is set to 12/31/1600; otherwise, the `Date` value is synchronized with the `SelectedDate` value. When `SelectedDate` is `null`, the picker is 'unset' and shows the field names instead of a date.
-
-
-
+
To use the date value in your app, you typically use a data binding to the `SelectedDate` property, or handle the `SelectedDateChanged` event.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/dockpanel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/dockpanel.md
index f1fb742cb..0cb32afb5 100644
Binary files a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/dockpanel.md and b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/dockpanel.md differ
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/flyouts.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/flyouts.md
index fcb2e2bef..295e3479c 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/flyouts.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/flyouts.md
@@ -3,6 +3,9 @@ id: flyouts
title: Flyouts
---
+import FlyoutContentScreenshot from '/img/controls/flyouts/flyoutpreview.png';
+import FlyoutMenuScreenshot from '/img/controls/flyouts/menuflyoutpreview.png';
+
## Overview
Flyouts are light dismissible containers that show arbitrary UI content. Flyouts are not controls and can be declared as a resource and shared between multiple elements within your app.
@@ -44,15 +47,11 @@ Flyouts are light dismissible containers that show arbitrary UI content. Flyouts
There are two built-in types of Flyouts: `Flyout` and `MenuFlyout`. A regular `Flyout` has no special logic and is just a simple container for any arbitrary UI content.
-
-
-
+
`MenuFlyout`, as the name implies, creates a Menu.
-
-
-
+
## Reference
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/grid.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/grid.md
index e72416ae6..7aa23e6ec 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/grid.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/grid.md
@@ -3,6 +3,12 @@ id: grid
title: Grid
---
+import GridSampleScreenshot from '/img/controls/grid/grid_example.png';
+import GridAsteriskScreenshot from '/img/controls/grid/grid_asterisk_example.png';
+import GridAsteriskButtonsScreenshot from '/img/controls/grid/grid_asterisk_example_buttons.png';
+import GridAutoButtonsScreenshot from '/img/controls/grid/grid_auto_example_buttons.png';
+import GridVerboseSampleScreenshot from '/img/controls/grid/grid_example_verbose.png';
+
The `Grid` control is a `Panel` control useful for organizing other controls in columns and rows. `ColumnDefinition` and `RowDefinition` properties are used to define absolute, relative, or proportional row and column geometries for the grid. Each control in the grid will be placed using the `Grid.Column` and `Grid.Row` additional properties. It is also possible to have controls that span multiple rows and/or columns by using the `ColumnSpan` and `RowSpan` properties.
## Reference
@@ -42,9 +48,7 @@ In the above example we have two keywords: __*__ and **Auto**. Here is explanati
The multiplier used in front of the proportional spacing value is used to figure out the relative size for the proportional columns. All proportional columns fit in the space left behind after all explicit values and "Auto" values are calculated. So for the above example the Column 1 will get 1.5 parts plus Column 2 will get 4 parts of the remainder of the space that Column 0 left. Lastly, the Button itself will fill in from the initial Cell 1,1 over one column and down one row because `Grid.RowSpan` and `Grid.ColumnSpan` are set to occupy two units instead of one.
-
-
-
+
Here is another example showing the difference between those two.
@@ -65,16 +69,11 @@ First let's create sample 2x2 grid in our View, we can achieve this simply by wr
As you can see we created equal grid, I left `ShowGridLines` parameter set to `True` for better visibility.
-
-
-
-
+
Now let's fill our grid with some elements, I will fill every field with button, you can use anything you want.
-
-
-
+
Now our View code look's like this:
@@ -98,13 +97,11 @@ Now our View code look's like this:
In this moment our **asterisk** symbols are forcing our grid to become equal, now let's see what will happen when we replace **asterisk** with the **Auto** keyword
-
-
-
+
As you can see our grid become sticky to its content, it is very useful when we have components with variable `Height` property.
-This new View code look's like this:
+This new View code looks like this:
```markup
@@ -148,9 +145,7 @@ For more complex row and column definitions it's possible to explicitly use `Gri
```
-
-
-
+
### Common Properties
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/gridsplitter.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/gridsplitter.md
index f8aabb17b..58a39eeb8 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/gridsplitter.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/gridsplitter.md
@@ -3,6 +3,9 @@ id: gridsplitter
title: GridSplitter
---
+import GridSplitterColumnsScreenshot from '/img/controls/gridsplitter/gridsplitter-in-action-columns.gif';
+import GridSplitterRowsScreenshot from '/img/controls/gridsplitter/gridsplitter-in-action-rows.gif';
+
The `GridSplitter` control is a control that allows a user to resize the space between `Grid` rows or columns.
```markup
@@ -13,9 +16,7 @@ The `GridSplitter` control is a control that allows a user to resize the space b
```
-
-
-
+
```markup
@@ -25,9 +26,7 @@ The `GridSplitter` control is a control that allows a user to resize the space b
```
-
-
-
+
### Reference
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/itemsrepeater.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/itemsrepeater.md
index 7ce7aaff0..de9523caf 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/itemsrepeater.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/itemsrepeater.md
@@ -3,6 +3,9 @@ id: itemsrepeater
title: ItemsRepeater
---
+import ItemsRepeaterVerticalScreenshot from '/img/controls/itemsrepeater/itemsrepeatervertical.png';
+import ItemsRepeaterHorizontalScreenshot from '/img/controls/itemsrepeater/itemsrepeaterhorizontal.png';
+
A data-driven collection control that incorporates a flexible layout system, custom views, and virtualization.
`ItemsRepeater` is a port of the UWP `ItemsRepeater` control. More documentation can be found at:
@@ -50,11 +53,10 @@ By default an `ItemsRepeater`, without defining a `Layout` will render them Stac
```
And they will look like so
-
-
-
+
If you want them to be rendered Horizontally, you need to specify a `Layout` property and the xaml should look a bit like so:
+
```xml
@@ -73,14 +75,12 @@ If you want them to be rendered Horizontally, you need to specify a `Layout` pro
```
-this will look like this:
-
-
-
-In the `Layout` property you can also specify `Spacing` between the items, but you cannot define `Classes` nor other complex styles, those needs to be defined on the `ItemsRepeater` if needed.
+this will look like this:
+
+In the `Layout` property you can also specify `Spacing` between the items, but you cannot define `Classes` nor other complex styles, those needs to be defined on the `ItemsRepeater` if needed.
## Reference
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/maskedtextbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/maskedtextbox.md
index 1ce9874f2..c9d536a22 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/maskedtextbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/maskedtextbox.md
@@ -3,6 +3,9 @@ id: maskedtextbox
title: MaskedTextBox
---
+import MaskedTextBoxEmptyScreenshot from '/img/controls/maskedtextbox/maskedtextboxexample1.png';
+import MaskedTextBoxTextEntryScreenshot from '/img/controls/maskedtextbox/maskedtextexample.gif';
+
The `MaskedTextBox` control is an editable text field where a user can input text.
## Source code
@@ -27,15 +30,11 @@ The `MaskedTextBox` control is an editable text field where a user can input tex
produces the following output in **Ubuntu**
-
-
-
+
and it behaves like so when filled in by user input
-
-
-
+
### Supported Masks
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/numericupdown.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/numericupdown.md
index 3538e14ca..8dbe0c8e0 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/numericupdown.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/numericupdown.md
@@ -3,6 +3,8 @@ id: numericupdown
title: NumericUpDown
---
+import NumericUpDownBasicScreenshot from '/img/controls/numericupdown/numericupdown_basic.png';
+
The `NumericUpDown` is an editable numeric input field.
The control has a up and down button spinner attached, used to increment and decrement the value in the input field. The value can also be incremented or decremented using the arrow keys or the mouse wheel when the control is selected.
@@ -25,11 +27,9 @@ The value stored in the `NumericUpDown` is a double.
```
-produces the following output on **Linux**\
+produces the following output on **Linux**
-
-
-
+
### NumericUpDown with a changed increment and bounds
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/panel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/panel.md
index 703ebe742..72c4309f4 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/panel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/panel.md
@@ -3,6 +3,8 @@ id: panel
title: Panel
---
+import PanelRectangleLayoutScreenshot from '/img/controls/panel/image (7).png';
+
The `Panel` is the base class for controls that can contain multiple children like `DockPanel` or `StackPanel`.
The `Panel` class can be useful on its own for very basic layouts, or simply to allow multiple controls to be to be contained.
@@ -16,9 +18,7 @@ The `Panel` class can be useful on its own for very basic layouts, or simply to
```
-
-
-
+
There are other more useful panels that derive from `Panel`, these include:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/progressbar.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/progressbar.md
index e8a8e1e08..426dac3d8 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/progressbar.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/progressbar.md
@@ -3,15 +3,15 @@ id: progressbar
title: ProgressBar
---
+import ProgressBarScreenshot from '/img/controls/progressbar/progressbar (1).png';
+
The `ProgressBar` control allow for showing dynamic progress status.
### Customizing the progress text
When [`ShowProgressText`](http://reference.avaloniaui.net/api/Avalonia.Controls/ProgressBar/590A8B3E) is `true`, text on the progress bar will be displayed.
-
-
-
+
By default this text shows the percentage completion, according to the [`Value`](http://reference.avaloniaui.net/api/Avalonia.Controls.Primitives/RangeBase/E111DF5B), [`Minimum`](http://reference.avaloniaui.net/api/Avalonia.Controls.Primitives/RangeBase/8F9BD1EA) and [`Maximum`](http://reference.avaloniaui.net/api/Avalonia.Controls.Primitives/RangeBase/C07B22E9). The format of this text can be customised by using the `ProgressTextFormat` property. This expects a string which will be passed to a [`string.Format`](https://docs.microsoft.com/en-us/dotnet/api/system.string.format#system-string-format(system-string-system-object())) call with the value of `ProgressTextFormat` as the format string. The following format items are available at the given indices:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/relativepanel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/relativepanel.md
index eafae4f45..1df65a7c9 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/relativepanel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/relativepanel.md
@@ -3,6 +3,8 @@ id: relativepanel
title: RelativePanel
---
+import RelativePanelScreenshot from '/img/controls/relativepanel/layout-panel-relative-panel.png';
+
The `RelativePanel` control is a `Panel` which lets you layout elements by specifying where they go in relation to other elements and in relation to the panel.
By default, an element is positioned in the upper left corner of the panel.
@@ -42,9 +44,7 @@ This XAML shows how to arrange elements in a RelativePanel.
The result looks like this.
-
-
-
+
Here are a few things to note about the sizing of the rectangles:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/splitview.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/splitview.md
index 62bad1996..4a3d46841 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/splitview.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/splitview.md
@@ -3,6 +3,8 @@ id: splitview
title: SplitView
---
+import SplitViewScreenshot from '/img/controls/splitview/image (9).png';
+
Represents a container with two views; one view for the main content and another view that is typically used for navigation commands.
```markup
@@ -25,9 +27,7 @@ Represents a container with two views; one view for the main content and another
```
-
-
-
+
A split view's content area is always visible. The pane can expand and collapse or remain in an open state, and can present itself from either the left side or right side of an app window. The pane has four modes:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/stackpanel.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/stackpanel.md
index 2ffb1185d..ab9bab10b 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/stackpanel.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/stackpanel.md
@@ -3,6 +3,9 @@ id: stackpanel
title: StackPanel
---
+import StackPanelRectangleScreenshot from '/img/controls/stackpanel/layout-panel-stack-panel.png';
+import StackPanelRectangleSpacingScreenshot from '/img/controls/stackpanel/image (12).png';
+
The `StackPanel` control is a `Panel` which lays out its children by stacking them horizontally or vertically. StackPanel is typically used to arrange a small subsection of the UI on a page.
You can use the [**Orientation**](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.stackpanel.orientation) property to specify the direction of the child elements. The default orientation is [**Vertical**](https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.Orientation).
@@ -20,9 +23,7 @@ The following XAML shows how to create a vertical StackPanel of items.
The result looks like this.
-
-
-
+
In a StackPanel, if a child element's size is not set explicitly, it stretches to fill the available width \(or height if the Orientation is **Horizontal**\). In this example, the width of the rectangles is not set. The rectangles expand to fill the entire width of the StackPanel.
@@ -37,10 +38,7 @@ StackPanel has a `Spacing` property to allow an even spacing between items.
```
-
-
-
-
+
### Reference
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/tabcontrol.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/tabcontrol.md
index 48263c57b..26b004a22 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/tabcontrol.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/tabcontrol.md
@@ -3,13 +3,14 @@ id: tabcontrol
title: TabControl
---
+import TabControlRibbonScreenshot from '/img/controls/tabcontrol/tabcontrol.gif';
+import TabControlStyledRibbonScreenshot from '/img/controls/tabcontrol/customizedtabcontrol.gif';
+
The `TabControl` allows us to switch between different pages by means of tabs like the tabs in web navigators or the ribbon menu \(which uses tabs\) in Word Office for instance.
Here is an animation of what you can achieve :
-
-
-
+
To create this, we'll describe the entire control \(TabControl\) and each individual tab+page \(TabItem\). Here is an example :
@@ -43,9 +44,7 @@ To create this, we'll describe the entire control \(TabControl\) and each indivi
Let's have a look at a customized `TabControl` :
-
-
-
+
The grey part is the `TabItem`... Yes, the `TabItem` includes the tab **AND** the page associated to the tab. The tab is called the `header`of the `TabItem`. Moreover, given the way `TabControl` has been implemented, tabs are in a `WrapPanel`. Thus, if you want to color in blue \(like this is done above\) the empty bar of the tabbed bar, you must change the background color of the `WrapPanel` of the `TabControl`. Here is the code used to obtain the result above \(_Note the workaround used to color some tabs : this is due to the way the control is implemented. It might change in the future._\)
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/textbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/textbox.md
index 0998dd5ee..b465bf104 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/textbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/textbox.md
@@ -3,6 +3,11 @@ id: textbox
title: TextBox
---
+import TextBoxSingleLineScreenshot from '/img/controls/textbox/textbox_basic.png';
+import TextBoxPasswordScreenshot from '/img/controls/textbox/textbox_password.png';
+import TextBoxWatermarkScreenshot from '/img/controls/textbox/textbox_watermark.png';
+import TextBoxMultilineScreenshot from '/img/controls/textbox/textbox_multiline.png';
+
The `TextBox` control is an editable text field where a user can input text.
## Reference
@@ -33,10 +38,7 @@ The `TextBox` control is an editable text field where a user can input text.
produces the following output in **Windows 10**
-
-
-
-
+
### Password input TextBox
@@ -56,9 +58,7 @@ produces the following output in **Windows 10**
produces the following output in **Windows 10** when text is input
-
-
-
+
When using the Fluent theme, you can apply the style class, `revealPasswordButton`, and the TextBox will provide an eye 👁 glyph for the user to show the plane text temporally. Please note, the `TextBox` may be written to but not copied from.
@@ -86,10 +86,7 @@ Avalonia can show a "watermark" in a `TextBox`, which is a piece of text that is
produces the following output in **Windows 10**
-
-
-
-
+
### Multiline TextBox
@@ -109,9 +106,7 @@ produces the following output in **Windows 10**
produces the following output in **Windows 10** when text is input
-
-
-
+
### TextInput Event Handling
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/timepicker.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/timepicker.md
index 0b7d24fbe..2ef09e149 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/timepicker.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/timepicker.md
@@ -6,6 +6,11 @@ title: TimePicker
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import TimePickerSingleValueScreenshot from '/img/controls/timepicker/image (22) (1).png';
+import TimePickerClockIdentifierScreenshot from '/img/controls/timepicker/image (19).png';
+import TimePickerMinuteIncrementScreenshot from '/img/controls/timepicker/image (10).png';
+import TimePickerUnsetScreenshot from '/img/controls/timepicker/image (20).png';
+
The `TimePicker` control allows the user to pick a time value.
## Examples
@@ -39,9 +44,7 @@ TimePicker arrivalTimePicker = new TimePicker();
Use a `TimePicker` to let a user enter a single time value. You can customize the `DatePicker` to use a 12-hour or 24-hour clock.
-
-
-
+
## 12-hour and 24-hour clocks
@@ -52,10 +55,7 @@ By default, the time picker shows a 12-hour clock with an AM/PM selector. You ca
```
-
-
-
-
+
### Minute increment
@@ -65,9 +65,7 @@ You can set the [MinuteIncrement](https://docs.microsoft.com/en-us/uwp/api/windo
```
-
-
-
+
### Time values
@@ -75,9 +73,7 @@ The time picker control has both Time / TimeChanged and SelectedTime / SelectedT
The value of `SelectedTime` is used to populate the time picker and is `null` by default. If `SelectedTime` is `null`, the `Time` property is set to a [TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/system.timespan?view=dotnet-uwp-10.0\&preserve-view=true) of 0; otherwise, the `Time` value is synchronized with the `SelectedTime` value. When `SelectedTime` is `null`, the picker is 'unset' and shows the field names instead of a time.
-
-
-
+
**Initializing a time value**
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/transitioningcontentcontrol.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/transitioningcontentcontrol.md
index 4793bca3f..eb531776b 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/transitioningcontentcontrol.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/transitioningcontentcontrol.md
@@ -3,6 +3,9 @@ id: transitioningcontentcontrol
title: TransitioningContentControl
---
+import TransitioningContentControlFadeScreenshot from '/img/controls/transitioningcontentcontrol/TransitioningContentControl_01.webp';
+import TransitioningContentControlSlideScreenshot from '/img/controls/transitioningcontentcontrol/TransitioningContentControl_02.webp';
+
## Common Properties
| Property | Description |
@@ -33,10 +36,7 @@ Let's assume we have a collection of different images and we want to show them i
```
-
-
-
-
+
## Changing the PageTransition
@@ -57,9 +57,7 @@ In the sample below we will change the [PageTransition](../animations/page-trans
```
-
-
-
+
## Disable the PageTransition
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/creating-a-flat-treedatagrid.md.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/creating-a-flat-treedatagrid.md.md
index 2593e7f52..b7c11e015 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/creating-a-flat-treedatagrid.md.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/creating-a-flat-treedatagrid.md.md
@@ -3,6 +3,8 @@ id: creating-a-flat-treedatagrid
title: Creating a Flat TreeDataGrid
---
+import FlatTreeDataGridSourceScreenshot from '/img/controls/treedatagrid/get-started-flat-1.png';
+
There are two parts to any `TreeDataGrid`:
* The "Source" which is defined in code and describes how your data model will map to the rows and columns of the `TreeDataGrid`
@@ -98,6 +100,4 @@ It's now time to add the `TreeDataGrid` control to a window and bind it to the s
Run the application and you should see the data appear:
-
-
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/creating-a-hierarchical-treedatagrid.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/creating-a-hierarchical-treedatagrid.md
index 3ea30ddb1..6a9a280a1 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/creating-a-hierarchical-treedatagrid.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/creating-a-hierarchical-treedatagrid.md
@@ -3,6 +3,8 @@ id: creating-a-hierarchical-treedatagrid
title: Creating a Hierarchical TreeDataGrid
---
+import HierarchicalTreeDataGridSourceScreenshot from '/img/controls/treedatagrid/get-started-hierarchical-1.png';
+
There are two parts to any `TreeDataGrid`:
* The "Source" which is defined in code and describes how your data model will map to the rows and columns of the `TreeDataGrid`
@@ -129,6 +131,4 @@ It's now time to add the `TreeDataGrid` control to a window and bind it to the s
Run the application and you should see the data appear:
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/treedatagrid-column-types.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/treedatagrid-column-types.md
index d46695d49..07cb852b5 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/treedatagrid-column-types.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/treedatagrid/treedatagrid-column-types.md
@@ -19,14 +19,11 @@ new TextColumn("First Name", x => x.FirstName)
The first generic parameter here is your model type basically, the place where you want to grab data from. Person in this case. The second generic parameter here is the type of the property where you want to grab data from. In this case, it is a string, it will be used to know exactly which type your property has.
-
-
-
-
+![](https://user-images.githubusercontent.com/53405089/157456551-dd394781-903a-4c7b-8874-e631e21534a1.png)
This is the signature of the `TextColumn` constructor. There are two most important parameters. The first one will be used to define the column header, usually, it would be a string. In the sample above it is _"First Name"_. The second parameter is an expression to get the value of the property. In the sample above it is _x => x.FirstName_.
-**Note**:\
+**Note**:
The sample above is taken from [this article](https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/blob/master/docs/get-started-flat.md). If you feel like you need more examples feel free to check it, there is a sample that shows how to use TextColumns and how to run a whole `TreeDataGrid` using them.
### HierarchicalExpanderColumn
@@ -41,15 +38,13 @@ new HierarchicalExpanderColumn(new TextColumn("First Nam
`HierarchicalExpanderColumn` has only one generic parameter, it is your model type, same as in `TextColumn`, Person in this case.
-Let's take a look at the `HierarchicalExpanderColumn` constructor.
+Let's take a look at the `HierarchicalExpanderColumn` constructor.
-
-
-
+![](https://user-images.githubusercontent.com/53405089/157536079-fd14f1ed-0a7d-438a-abba-fd56766709a9.png)
The first parameter in the constructor is a nested column, you would usually want to display something besides the expander and that's why you need this parameter. In the sample above, we want to display text and we use `TextColumn` for that. The second parameter is a selector of the child elements, stuff that will be displayed when `Expander` is in the expanded state below the parent element.
-**Note**:\
+**Note**:
The sample above is taken from [this article](https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/blob/master/docs/get-started-hierarchical.md). If you feel like you need more examples feel free to check it, there is a sample that shows how to use `HierarchicalExpanderColumn` and how to run a whole `TreeDataGrid` using it.
### TemplateColumn
@@ -66,8 +61,6 @@ new TemplateColumn(
`TemplateColumn` has only one generic parameter, it is your model type, same as in `TextColumn`, Person in this case. Code above will create a column with header _"Selected"_ and `CheckBox` in each cell.
-
-
-
+![](https://user-images.githubusercontent.com/53405089/157664231-8653bce9-f8d6-4fbc-8e78-e3ff93f1ace2.png)
`TemplateColumn` has only two required parameters. The first one is the column header as everywhere. The second is `IDataTemplate` basically, a template that contains stuff that you want to be displayed in the cells of this column.
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/viewbox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/viewbox.md
index 29872697a..0137b6922 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/viewbox.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/controls/viewbox.md
@@ -1,11 +1,19 @@
---
id: viewbox
-title: ViewBox
+title: Viewbox
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import ViewboxScaleUniformBothScreenshot from '/img/controls/viewbox/scale-uniform-both.gif';
+import ViewboxScaleUniformFillBothScreenshot from '/img/controls/viewbox/scale-uniformtofill-both.gif';
+import ViewboxScaleFillBothScreenshot from '/img/controls/viewbox/scale-fill-both.gif';
+import ViewboxScaleNoneBothScreenshot from '/img/controls/viewbox/scale-none-both.gif';
+
+import ViewboxScaleUniformUpOnlyScreenshot from '/img/controls/viewbox/scale-uniform-uponly.gif';
+import ViewboxScaleUniformDownOnlyScreenshot from '/img/controls/viewbox/scale-uniform-downonly.gif';
+
The `Viewbox` is a decorator control which scales its child. It can be used to scale its child to fit the available space.
The `Viewbox` gives its child infinite space in the measure phase. It will constrain either or both sides when arranging it. This depends on the value of the `Stretch`.
@@ -85,7 +93,7 @@ new Viewbox
-
+
@@ -95,7 +103,7 @@ new Viewbox
-
+
@@ -105,7 +113,7 @@ new Viewbox
-
+
@@ -115,7 +123,7 @@ new Viewbox
-
+
@@ -135,7 +143,7 @@ new Viewbox
Both
-
+
@@ -144,7 +152,7 @@ new Viewbox
-
+
@@ -154,7 +162,7 @@ new Viewbox
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/data-binding/data-validation.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/data-binding/data-validation.md
index 550a80a7f..a5e0009a4 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/data-binding/data-validation.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/data-binding/data-validation.md
@@ -3,6 +3,8 @@ id: data-validation
title: Data Validation
---
+import CustomValidationTooltipScreenshot from '/img/data-binding/data-validation/CustomValidationTooltip.png';
+
Avalonia offers different data validation options. In this section we will show you how you can validate the `Properties` of your `ViewModel` and how you can style the displayed error message.
## Validating a property
@@ -122,10 +124,7 @@ To display the validation messages, Avalonia has a control called [`DataValidati
```
-
-
-
-
+
**Custom validation style**
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/developer-tools.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/developer-tools.md
index 9ddfb1332..0729c042f 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/developer-tools.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/developer-tools.md
@@ -3,6 +3,16 @@ id: developer-tools
title: Developer Tools
---
+import DevToolsOverviewScreenshot from '/img/getting-started/developer-tools/image (23).png';
+import DevToolsPropertiesScreenshot from '/img/getting-started/developer-tools/image (26).png';
+import DevToolsLayoutScreenshot from '/img/getting-started/developer-tools/image (24) (1) (1).png';
+import DevToolsStylesScreenshot from '/img/getting-started/developer-tools/image (27).png';
+import DevToolsOverriddenStylesScreenshot from '/img/getting-started/developer-tools/image (28).png';
+import DevToolsSetterContextMenuScreenshot from '/img/getting-started/developer-tools/image (25).png';
+import DevToolsEventsScreenshot from '/img/getting-started/developer-tools/image (29).png';
+import DevToolsChangePropertyScreenshot from '/img/getting-started/developer-tools/devtools-change-property.gif';
+import DevToolsChangeLayoutScreenshot from '/img/getting-started/developer-tools/devtools-change-layout.gif';
+
# Developer Tools
Avalonia has an inbuilt DevTools window which is enabled by calling the attached `AttachDevTools()` method in a `Window` constructor. The default templates have this enabled when the program is compiled in `DEBUG` mode:
@@ -45,9 +55,7 @@ dotnet add package Avalonia.Diagnostics --version 0.10.0
:::
-
-
-
+
There is a known issue when running under .NET core 2.1 that pressing F12 will cause the program to quit. In this case, either switch to .NET core 2.0 or 3.0+ or change the open gesture to something different, such as `Ctrl+F12`.
@@ -66,9 +74,7 @@ Allows for quickly checking and editing properties of the control. One can also
| Type | Type of the current value |
| Priority | Priority of the value |
-
-
-
+
### Layout
@@ -79,9 +85,7 @@ Control size and size constraints are also shown.
If `Width` or `Height` are underlined that means there is an active constraint. Hover over the value to see a tooltip containing relevant information.
:::
-
-
-
+
### Styles
@@ -96,24 +100,18 @@ If setter value is bound to a resource it will be indicated by a circle followed
:::
-
-
-
+
:::info
If given value has a strikethrough it means that it is being overridden by a value in style with higher priority.
:::
-
-
-
+
Setters have a context menu that allows for quickly copying names and values to the clipboard.
-
-
-
+
## Events
@@ -126,9 +124,7 @@ Dotted underline under event name or control type indicates that quick navigatio
* Double clicking a control type (and/or name) will navigate to the visual tree tab and select said control.
:::
-
-
-
+
## Console
@@ -151,12 +147,8 @@ The console can be shown using the "View" → "Console" menu. The console implem
### Changing a property value
-
-
-
+
### Changing layout properties
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/ide-support.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/ide-support.md
index 8a343bf83..90c9f16ca 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/ide-support.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/ide-support.md
@@ -2,6 +2,10 @@
id: ide-support
title: IDE Support
---
+
+import VsXamlPreviewerScreenshot from '/img/getting-started/vs-designer.png';
+import VsSelectProjectPreviewScreenshot from '/img/getting-started/VisualStudioPreviewer_SelectProjectForPreview.png';
+
## JetBrains Rider
The [JetBrains Rider](https://www.jetbrains.com/rider/) IDE has built-in support for Avalonia XAML [starting in 2020.3](https://www.jetbrains.com/rider/whatsnew/2020-3/#version-2020-3-avalonia-support) including first-class support for Avalonia-specific XAML features and custom code inspections.
@@ -24,9 +28,7 @@ If you're using VS2019 or VS2017 you need to install [the extension for older ve
For Visual Studio and ReSharper users, [ReSharper 2020.3 introduces](https://www.jetbrains.com/resharper/whatsnew/2020-3/#version-2020-3-avalonia-support) built-in code analysis, code completion, navigation, and find usages.
-
-
-
+
If your XAML is in a library, Avalonia needs an executable application in order to be able to preview it. Select an executable project from the dropdown on the top right of the designer. Once your project is built, editing the XAML in the editor will cause the preview to update automatically.
@@ -127,7 +129,4 @@ If your preview is not shown correctly try to (re-)build the project or solution
Moreover if you have more than one project in your solution, you may need to select the project which should be used to render the preview. This can be done with the drop-down shown below.
-
-
-
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/jetbrains-rider-setup.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/jetbrains-rider-setup.md
index f462da4b8..7e4e00f0a 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/jetbrains-rider-setup.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/getting-started/jetbrains-rider-setup.md
@@ -3,6 +3,10 @@ id: jetbrains-rider-setup
title: JetBrains Rider Setup
---
+ import RiderWelcomePluginsScreenshot from '/img/getting-started/jetbrains-rider-setup/jetbrains-rider-setup-1-rider-welcome.webp';
+ import RiderConfigurePluginsScreenshot from '/img/getting-started/jetbrains-rider-setup/rider-setup-2-configure-plugin-repos.webp';
+ import RiderPluginInstallScreenshot from '/img/getting-started/jetbrains-rider-setup/jetbrains-rider-setup-4-plugin-install.webp';
+
# JetBrains Rider Setup
1. Download and install the .NET SDK of your choice [Download .NET \(Linux, macOS, and Windows\) \(microsoft.com\)](https://dotnet.microsoft.com/download)
@@ -45,21 +49,14 @@ title: JetBrains Rider Setup
Once Rider loads you will see the Welcome Screen. Click the `Configure` dropdown and select `Plugins`.
-
-
-
+
A new Preferences Screen will open up. Click the `Settings` icon as shown and select `Manage Plugin Repositories...`
-
-
-
-
+
Now click on the `Marketplace` tab and search for `Avalonia`. Select `AvaloniaRider` and click `Install`; accept the warning about Third-Party Plugins; once that's done, click the `Restart IDE` button that appears.
-
-
-
+
Now Rider should be ready to develop Avalonia applications.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/basics/code-behind.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/basics/code-behind.md
index 33bfb872a..1b0b68df3 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/basics/code-behind.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/basics/code-behind.md
@@ -3,11 +3,11 @@ id: code-behind
title: Code Behind
---
+import VsCodeBehindScreenshot from '/img/guides/basics/code-behind/codebehind-vs.png';
+
[Window](../../controls/window) and [UserControl](../../controls/usercontrol) files also have an associated _code-behind_ file which usually has the extension `.xaml.cs` or `.axaml.cs` and may be displayed collapsed under the XAML file in your editor. Below you can see a `MainWindow.xaml` file along with its markdown file `MainWindow.xaml.cs` in Visual Studio:
-
-
-
+
The code-behind file by default defines a .NET class with the same name as your XAML file, e.g.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/basics/mvvm.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/basics/mvvm.md
index db1622680..c0591ddc7 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/basics/mvvm.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/basics/mvvm.md
@@ -3,6 +3,8 @@ id: mvvm
title: MVVM Architecture
---
+import MvvmArchitectureDiagram from '/img/guides/basics/mvvm/mvvm.png';
+
The Model-View-ViewModel pattern (MVVM) is a common way of structuring a UI application. It takes advantage of Avalonia's [binding](../../data-binding) system to separate the logic of the application from the display of the application.
MVVM might be overkill for a simple application, but as applications grow over time, they usually reach a point where tracking logic in [code-behind](code-behind) becomes problematic for two main reasons:
@@ -28,9 +30,7 @@ When we talk about the MVVM pattern, the most important parts are the **View** l
One way to imagine an MVVM application is to imagine these two layers as hovering over one another, connected by bindings:
-
-
-
+
The above example has, at the View layer:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/deep-dives/reactiveui/routing.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/deep-dives/reactiveui/routing.md
index f8d4054fc..8dfc52447 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/deep-dives/reactiveui/routing.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/deep-dives/reactiveui/routing.md
@@ -3,6 +3,8 @@ id: routing
title: Routing
---
+import ReactiveUIRoutingScreenshot from '/img/guides/deep-dives/reactiveui/routing/routing.gif';
+
[ReactiveUI routing](https://reactiveui.net/docs/handbook/routing/) consists of an [IScreen](https://reactiveui.net/api/reactiveui/iscreen/) that contains current [RoutingState](https://reactiveui.net/api/reactiveui/routingstate/), several [IRoutableViewModel](https://reactiveui.net/api/reactiveui/iroutableviewmodel/)s, and a platform-specific XAML control called [RoutedViewHost](https://github.com/AvaloniaUI/Avalonia/blob/55458cf7af24d6c987268ab5ff8a1ead1173310b/src/Avalonia.ReactiveUI/RoutedViewHost.cs). `RoutingState` manages the view model navigation stack and allows view models to navigate to other view models. `IScreen` is the root of a navigation stack; despite the name, its views don't have to occupy the whole screen. `RoutedViewHost` monitors an instance of `RoutingState`, responding to any changes in the navigation stack by creating and embedding the appropriate view.
## Routing Example
@@ -248,6 +250,4 @@ Now, you can run the app and see routing in action!
dotnet run --framework netcoreapp2.1
```
-
-
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/deep-dives/running-on-raspbian-lite-via-drm.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/deep-dives/running-on-raspbian-lite-via-drm.md
index a0bad17f3..152dc82b4 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/deep-dives/running-on-raspbian-lite-via-drm.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/deep-dives/running-on-raspbian-lite-via-drm.md
@@ -3,6 +3,10 @@ id: running-on-raspbian-lite-via-drm
title: Running your Avalonia app on a Raspberry Pi with Raspbian Lite
---
+import RaspbianLiteDrmKmsCubeScreenshot from '/img/guides/deep-dives/running-on-raspbian-lite-via-drm/avalonia-raspbian-lite-drm-kmscube.gif';
+import RaspbianLiteDrmDesktopScreenshot from '/img/guides/deep-dives/running-on-raspbian-lite-via-drm/avalonia-raspbian-lite-drm-desktop.jpg';
+import RaspianLiteRaspberryScreenshot from '/img/guides/deep-dives/running-on-raspbian-lite-via-drm/avalonia-raspbian-lite-drm-run-on-raspberry.jpg';
+
# Running your Avalonia app on a Raspberry Pi with Raspbian Lite
This tutorial shows you how to run your Avalonia app on a Raspberry Pi with Raspbian Lite
@@ -69,9 +73,7 @@ sudo kmscube
````
You should see the spinning cube on your Raspberry pi screen now:
-
-
-
+
### Step 2 - Prepare Avalonia App
@@ -193,9 +195,7 @@ public override void OnFrameworkInitializationCompleted()
Now you can run/debug your app on desktop as usual.
When you start your app you should see this:
-
-
-
+
### Step 3 - Deploy and run on Raspberry
@@ -221,8 +221,6 @@ sudo ./path/to/app/AvaloniaRaspbianLiteDrm --drm
You should see the app running on your Raspberry Pi now:
-
-
-
+
If you have a touch display installed, try to slide the slider control :)
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/debugging-previewer.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/debugging-previewer.md
index 36a313b67..248bf26e2 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/debugging-previewer.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/debugging-previewer.md
@@ -3,6 +3,8 @@ id: debugging-previewer
title: Debugging Previewer
---
+import VsAttachDebuggerScreenshot from '/img/guides/developer-guides/debugging-previewer/132686320-958f30a6-49f8-498f-853c-b9dd17262b54.png';
+
By default, even if you would put a breakpoint in Avalonia main repo directly it would not be hit when Previewer executes this code. This is because Previewer is a completely different process usually run by IDE.
**Debugging with JetBrains Rider**
@@ -45,6 +47,4 @@ But if you need to place breakpoints in the previewer code you may need to use [
You should see a window like this.
-
-
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/debugging-xamlil.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/debugging-xamlil.md
index 43e3a3fec..9f3ac7280 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/debugging-xamlil.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/debugging-xamlil.md
@@ -3,7 +3,9 @@ id: debugging-xamlil
title: Debugging the XAML compiler
---
-You can debug the XAML compiler adding at your's csproj AvaloniaXamlIlDebuggerLaunch property like this:
+import VsAttachDebuggerScreenshot from '/img/guides/developer-guides/debugging-xamlil/132686320-958f30a6-49f8-498f-853c-b9dd17262b54.png';
+
+You can debug the XAML compiler by adding the `AvaloniaXamlIlDebuggerLaunch` property to your .csproj like this:
```xml
@@ -16,8 +18,6 @@ You can debug the XAML compiler adding at your's csproj AvaloniaXamlIlDebuggerLa
If build the project in Visual Studio you should see a window like this:
-
-
-
+
-on other IDEs, a message will appear in the build output window indicating the PID of the process to attach the debugger to and the elapsed time. If within one minute of starting the build no debugger is attacked to the process, a timeout message will be reported and the build will continue as normal.
\ No newline at end of file
+On other IDEs, a message will appear in the build output window indicating the PID of the process to attach the debugger to and the elapsed time. If within one minute of starting the build no debugger is attacked to the process, a timeout message will be reported and the build will continue as normal.
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/maintaining-stable-branch-pr-merge-process.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/maintaining-stable-branch-pr-merge-process.md
index 84690649b..3d961f225 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/maintaining-stable-branch-pr-merge-process.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/maintaining-stable-branch-pr-merge-process.md
@@ -3,6 +3,9 @@ id: maintaining-stable-branch-pr-merge-process
title: Maintaining Stable Branch
---
+import NewFeatureMasterMergeScreenshot from '/img/guides/developer-guides/maintaining-stable-branch-pr-merge-process/image (6).png';
+import NewFeatureBackportScreenshot from '/img/guides/developer-guides/maintaining-stable-branch-pr-merge-process/image (13).png';
+
:::warning
This Process MUST be followed during any period that `master` branch is allowing breaking changes.
:::
@@ -24,9 +27,7 @@ Provided the criteria are met:
At this point the git tree should look similar to this.
-
-
-
+
Now we need to get the new PR merged into the stable branch.
@@ -39,8 +40,6 @@ Pay careful attention here, we don't just merge into the stable branch!
The git tree should look like this now.
-
-
-
+
Please also use the `backport-candidate` and `backported 0.10.x` labels on the PRs themselves.
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/release-process.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/release-process.md
index a09fe799a..ff90ee1a3 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/release-process.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/guides/developer-guides/release-process.md
@@ -3,6 +3,12 @@ id: release-process
title: Release Process
---
+import ReleaseGitTreeScreenshot from '/img/guides/developer-guides/release-process/image (4).png';
+import ReleasePipelineScreenshot from '/img/guides/developer-guides/release-process/image (1).png';
+import ReleaseBranchScreenshot from '/img/guides/developer-guides/release-process/image (11).png';
+import ReleaseNugetBadgeScreenshot from '/img/guides/developer-guides/release-process/image (17) (1) (1) (1).png';
+import ReleaseDeployScreenshot from '/img/guides/developer-guides/release-process/image (16).png';
+
* Create a branch named `release/0.10.2` for example. This branch should be level with the `master` commit that the release will be based on.
* Update the version number in the file `SharedVersion.props` i.e. `0.10.2`.
* Push the release branch.
@@ -11,10 +17,7 @@ If this is the first release of a major version change, i.e. `0.9.0` or `0.10.0`
The git tree should now look like this:
-
-
-
-
+
* Now login at `dev.azure.com` to access the azure pipelines. Wait for the CI to finish the build.
* The package for `0.10.2` should now be on the `avalonia-all` nuget feed. You should run a due diligence test on this build to ensure you are happy with the release and the packages work.
@@ -25,25 +28,17 @@ Don't assume the Nuget packages will work just because master was working. In th
* Now click on "Releases" and select "Avalonia (master / release)" pipeline as shown below.
-
-
-
+
* On the release for your release branch `release/0.10.2` click on the badge for "Nuget Release"
-
-
-
+
-
-
-
+
* Then click on `Deploy`.
-
-
-
+
:::info
At this point the packages will deploy to Nuget, it can take between 10 and 20 minutes for them to be indexed and publicly available. [https://www.nuget.org/packages/Avalonia/](https://www.nuget.org/packages/Avalonia/)
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/input/routed-events.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/input/routed-events.md
index 34fe929b3..979a1e4bc 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/input/routed-events.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/input/routed-events.md
@@ -3,6 +3,8 @@ id: routed-events
title: Routed Events
---
+import InputEventRoutingScreenshot from '/img/input/routed-events/input-event-routing.png';
+
Most events in Avalonia are implemented as Routed Events. Routed events are events that are raised on the whole tree rather than just the control that raised the event.
## What Is a Routed Event
@@ -220,10 +222,7 @@ Avalonia input events that come in pairs are implemented so that a single user a
As an illustration of how input event processing works, consider the following input event example. In the following tree illustration, `leaf element #2` is the source of a `PointerPressed` event:
-
-
-
-
+
The order of event processing is as follows:
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/layout/alignment-margins-and-padding.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/layout/alignment-margins-and-padding.md
index 55628c326..d7c1631a2 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/layout/alignment-margins-and-padding.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/layout/alignment-margins-and-padding.md
@@ -3,6 +3,12 @@ id: alignment-margins-and-padding
title: Alignment, Margins and Padding
---
+import LayoutMarginsPaddingAlignmentBasicScreenshot from '/img/layout/alignment-margins-and-padding/layout-margins-padding-alignment-graphic1.png';
+import LayoutMarginsPaddingAlignmentBasicAnnotatedScreenshot from '/img/layout/alignment-margins-and-padding/layout-margins-padding-alignment-graphic2.png';
+import LayoutHorizontalAlignmentScreenshot from '/img/layout/alignment-margins-and-padding/layout-horizontal-alignment-graphic.png';
+import LayoutVerticalAlignmentScreenshot from '/img/layout/alignment-margins-and-padding/layout-vertical-alignment-graphic.png';
+import LayoutMarginsPaddingAlignmentComplexAnnotatedScreenshot from '/img/layout/alignment-margins-and-padding/layout-margins-padding-aligment-graphic3.png';
+
An Avalonia control exposes several properties that are used to precisely position child elements. This topic discusses four of the most important properties: `HorizontalAlignment`, `Margin`, `Padding`, and `VerticalAlignment`. The effects of these properties are important to understand, because they provide the basis for controlling the position of elements in Avalonia applications.
### Introduction to Element Positioning
@@ -11,9 +17,7 @@ There are numerous ways to position elements using Avalonia. However, achieving
The following illustration shows a layout scenario that utilizes several positioning properties.
-
-
-
+
At first glance, the `Button` elements in this illustration may appear to be placed randomly. However, their positions are actually precisely controlled by using a combination of margins, alignments, and padding.
@@ -47,9 +51,7 @@ The following example describes how to create the layout in the preceding illust
The following diagram provides a close-up view of the various positioning properties that are used in the preceding sample. Subsequent sections in this topic describe in greater detail how to use each positioning property.
-
-
-
+
### Understanding Alignment Properties
@@ -79,9 +81,7 @@ The following example shows how to apply the `HorizontalAlignment` property to `
The preceding code yields a layout similar to the following image. The positioning effects of each `HorizontalAlignment` value are visible in the illustration.
-
-
-
+
#### VerticalAlignment Property
@@ -121,9 +121,7 @@ The following example shows how to apply the `VerticalAlignment` property to `Bu
The preceding code yields a layout similar to the following image. The positioning effects of each `VerticalAlignment` value are visible in the illustration.
-
-
-
+
### Understanding Margin Properties
@@ -231,6 +229,4 @@ The following example demonstrates each of the concepts that are detailed in thi
When compiled, the preceding application yields a UI that looks like the following illustration. The effects of the various property values are evident in the spacing between elements, and significant property values for elements in each column are shown within `TextBlock` elements.
-
-
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/styling/troubleshooting.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/styling/troubleshooting.md
index 109ef2743..5db2ddce7 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/styling/troubleshooting.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/styling/troubleshooting.md
@@ -85,7 +85,7 @@ The following code example of styles that can be expected to work on top of defa
-
```
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/templates/data-templates.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/templates/data-templates.md
index dc1ed9b48..bb7fa48b0 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/templates/data-templates.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/templates/data-templates.md
@@ -3,6 +3,11 @@ id: data-templates
title: Data Templates
---
+import ControlContentButtonScreenshot from '/img/templates/data-templates/hello-world-button.png';
+import ControlContentStringScreenshot from '/img/templates/data-templates/hello-world-string.png';
+import ControlContentStudentNoTemplateScreenshot from '/img/templates/data-templates/student-no-datatemplate.png';
+import ControlContentStudentScreenshot from '/img/templates/data-templates/student-first-last-name (1) (1) (1) (1) (1).png';
+
Many controls have a `Content` property, such as [`ContentControl.Content`](http://reference.avaloniaui.net/api/Avalonia.Controls/ContentControl/4B02A756). `Window` inherits from [`ContentControl`](../controls/contentcontrol), so lets use that as an example. You're probably familiar with what happens when you put a control in the `Window.Content` property - the window displays the control:
```markup
@@ -15,10 +20,7 @@ Many controls have a `Content` property, such as [`ContentControl.Content`](http
```
-
-
-
-
+
Similarly if you put a string as the window content, the window will display the string:
@@ -29,9 +31,7 @@ Similarly if you put a string as the window content, the window will display the
```
-
-
-
+
But what happens if you try to display an object as the window content?
@@ -60,9 +60,7 @@ namespace Example
```
-
-
-
+
Not very helpful. That's because Avalonia doesn't know _how_ to display an object of type `Student` - because it's not a control it falls back to just calling `.ToString()` on the object. We can tell Avalonia how to display non-control objects by defining a data template.
@@ -89,10 +87,7 @@ The easiest way to do this on `Window` (and any control that inherits from `Cont
```
-
-
-
-
+
The data template for the window content doesn't only come from the `ContentTemplate` property. Every control also has a `DataTemplates` collection into which any number of data templates can be placed. If a control doesn't have a template set locally (e.g. in `ContentTemplate`) then it will look in its `DataTemplates` collection for a matching template. If a match isn't found there it will then go on to search its parent's `DataTemplates`, then its grandparent's, and so on until it reaches the `Window`. If it _still_ hasn't found a match it will then look in `App.xaml`/`App.axaml` for a matching `DataTemplate` and finally when all those options have been exhausted it will simply call `.ToString()` on the object.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/android/build-and-run-your-application-on-a-simulator.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/android/build-and-run-your-application-on-a-simulator.md
index e39f4c946..5d95dd9f4 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/android/build-and-run-your-application-on-a-simulator.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/android/build-and-run-your-application-on-a-simulator.md
@@ -5,7 +5,7 @@ title: Build and run your Application on a Simulator
Please ensure you have followed the guide [create-a-cross-platform-solution.md](../create-a-cross-platform-solution.md "mention").
-Assuming you have created a project called `HelloWord`. Enter the directory `HelloWorld.Android` from the command line.
+Assuming you have created a project called `HelloWorld`. Enter the directory `HelloWorld.Android` from the command line.
To build the project for Android run the following command.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/android/setting-up-your-developer-environment-for-android.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/android/setting-up-your-developer-environment-for-android.md
index 57b04dcdd..4ca93bcfb 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/android/setting-up-your-developer-environment-for-android.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/android/setting-up-your-developer-environment-for-android.md
@@ -14,8 +14,8 @@ dotnet workload install android
```
:::info
-You may need to run the command with `sudo`\
-\
+You may need to run the command with `sudo`
+
You may also need to uninstall old versions. `dotnet workload remove android`
:::
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator.md
index 856c10bd1..51958852c 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator.md
@@ -3,9 +3,11 @@ info: build-and-run-your-application-on-a-simulator
title: Build and run your application on a Simulator
---
+import SimulatoriPadScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator/image (34).png';
+
Please ensure you have followed the guide [create-a-cross-platform-solution.md](../create-a-cross-platform-solution.md "mention").
-Assuming you have created a project called `HelloWord`. Enter the directory `HelloWorld.iOS` from the command line.
+Assuming you have created a project called `HelloWorld`. Enter the directory `HelloWorld.iOS` from the command line.
To build the project for iOS run the following command.
@@ -19,8 +21,6 @@ To run the project in a simulator, run the following command.
dotnet run
```
-
-
-
+
If you use `JetBrains Rider` or `Visual Studio for Mac` you can open the solution and run, build and debug your program inside the simulator.
\ No newline at end of file
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad.md
index 8ddfd7cd8..23d0a2c08 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad.md
@@ -3,72 +3,65 @@ info: build-and-run-your-application-on-your-iphone-or-ipad
title: Build and Run your Application on your iPhone or iPad
---
+import BuildiOSOpenXcodeScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/Screenshot 2022-03-17 at 12.09.54.png';
+import BuildiOSCreateXcodeProjectScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (36).png';
+import BuildiOSSelectProjectOptionsScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (30).png';
+import BuildiOSSelectAnyDeviceScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (35).png';
+import BuildiOSAddAdditionalSimulatorsScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (32).png';
+import BuildiOSProvisionPhoneScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/Screenshot 2022-03-17 at 12.19.06.png';
+import BuildiOSSelectDeviceScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (24).png';
+import BuildiOSChangeBundleIdentifierScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (18).png';
+import BuildiOSCertScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (33).png';
+
In order to allow dotnet to sideload your application to your iphone or ipad you must first use Xcode to provision your device.
Before continuing follow this guide to create a free Apple developer signing certificate.
-[Free Provisiong for Xamarin.iOS Applications](https://docs.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/free-provisioning)
+[Free Provisioning for Xamarin.iOS Applications](https://docs.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/free-provisioning)
This has to be done by creating an Xcode app project that has the same `bundle identifier` that you will use in your application.
1. Open Xcode
-
-
-
-
+
-2\. Select Create a new Xcode project
+2. Select Create a new Xcode project
-
-
-
+
-3\. Select iOS and App and click Next.
+3. Select iOS and App and click Next.
-
-
-
+
-4\. Type in a name for your project and Organisation. Keep all the rest of the information the same.
+4. Type in a name for your project and Organisation. Keep all the rest of the information the same.
-5\. Choose a directory to save the project. You will not need to keep the project so don't worry too much about where.
+5. Choose a directory to save the project. You will not need to keep the project so don't worry too much about where.
-6\. In the status bar at the top click on the "Any device (arm64)"
+6. In the status bar at the top click on the "Any device (arm64)"
-
-
-
+
-7\. At the bottom of the list click "Add Additional Simulators..."
+7. At the bottom of the list click "Add Additional Simulators..."
-
-
-
+
-8\. Click on devices and connect your iPhone or iPad with the USB cable. Xcode will start to provision your phone for development.
+8. Click on devices and connect your iPhone or iPad with the USB cable. Xcode will start to provision your phone for development.
-
-
-
+
-9\. Select you iPhone or iPad from the device list.
+9. Select you iPhone or iPad from the device list.
-
-
-
+
-10\. Click the play button and the app will be installed and run on your phone.
+10. Click the play button and the app will be installed and run on your phone.
If successful you may return to your IDE of choice and open the `info.plist` file from the iOS project.
-11\. Change the bundle identifier to the same as the one you choose in Xcode in step 3.
+11. Change the bundle identifier to the same as the one you choose in Xcode in step 3.
-
-
-
+
-12\. Now edit the `.iOS.csproj` file.
+12. Now edit the `.iOS.csproj` file.
```xml
ios-arm64
@@ -85,9 +78,7 @@ Add a `` tag.
To find the value for this open the application `KeyChain Access`. In the search box search for development.
-
-
-
+
Set the value exactly as the bold text at the top of the window on your selected development certificate.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/setting-up-your-developer-environment-for-ios.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/setting-up-your-developer-environment-for-ios.md
index 5629430b6..5a3534715 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/setting-up-your-developer-environment-for-ios.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/developing-for-mobile/ios/setting-up-your-developer-environment-for-ios.md
@@ -18,8 +18,8 @@ dotnet workload install ios
```
:::info
-You may need to run the command with `sudo`\
-\
+You may need to run the command with `sudo`
+
You may also need to uninstall old versions. `dotnet workload remove ios`
:::
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-and-layout-controls.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-and-layout-controls.md
index 2322210c6..ed4885fd5 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-and-layout-controls.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-and-layout-controls.md
@@ -3,6 +3,10 @@ id: add-and-layout-controls
title: Add and Layout Controls
---
+import MusicStoreBuyButtonScreenshot from '/img/tutorials/music-store-app/add-and-layout-controls/buy-button.png';
+import MusicStoreAddStylesScreenshot from '/img/tutorials/music-store-app/add-and-layout-controls/add-styles.png';
+import MusicStorePrettyButtonScreenshot from '/img/tutorials/music-store-app/add-and-layout-controls/pretty-button.png';
+
## Add and Layout some Controls
Let's start by adding a `Button` to the `MainWindow`. The button will allow the `user` to purchase music in order to add to their collection.
@@ -60,9 +64,7 @@ public class MainWindowViewModel : ViewModelBase
Pressing the `Debug Button` again to run the program we can see we have a button and when clicked setting a breakpoint inside the `BuyMusicCommand` code we can see that the code is executed when it's hit.
-
-
-
+
Let's position the button to the top right of the screen and make it look a bit nicer.
@@ -94,9 +96,7 @@ Let's create a file just for Icons.
In Rider right click on the project and select `Add` → `Avalonia Styles`
-
-
-
+
Enter the name `Icons` when prompted and press `Enter`.
@@ -156,6 +156,4 @@ Return to `MainWindow.axaml`, we can add the Icon to the Button like so...
Running the application we now have a nice button.
-
-
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-content-to-dialog.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-content-to-dialog.md
index 13ebde540..d1d4fb6dd 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-content-to-dialog.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-content-to-dialog.md
@@ -3,6 +3,10 @@ id: add-content-to-dialog
title: Add Content to Dialog
---
+import MusicStoreMockSearchScreenshot from '/img/tutorials/music-store-app/add-content-to-dialog/text-list.png';
+import MusicStoreBeforeWrapPanelScreenshot from '/img/tutorials/music-store-app/add-content-to-dialog/image-20210310010932979.png';
+import MusicStoreWrapPanelScreenshot from '/img/tutorials/music-store-app/add-content-to-dialog/image-20210310011526700.png';
+
## Adding Content to the Dialog
Inside the dialog we would like the user to search for albums, and then select an album to buy.
@@ -275,10 +279,7 @@ Your `MusicStoreWindow.axaml` should look like this.
Run the application:
-
-
-
-
+
Our items are showing in the List... but not very visual.
@@ -333,9 +334,7 @@ We shall come back to the `Bindings` in a moment, for now lets run the applicati
As can be seen the albums are displayed vertically. However it would be nice to have them horizontally and wrap around.
-
-
-
+
Luckily `ListBox` provides a solution to this with something called `ItemsPanelTemplate`. By default the `ListBox` has its `ItemPanel` property set to an `ItemsPanelTemplate` which contains a `StackPanel`, we can change this to a `WrapPanel` like so.
@@ -351,9 +350,7 @@ Luckily `ListBox` provides a solution to this with something called `ItemsPanelT
Now when we run the application we get:
-
-
-
+
As our list gets more items, that will wrap around onto the next line, and the user will be able to scroll.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-items-to-users-collection.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-items-to-users-collection.md
index 23ce7a6ab..83df24ebd 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-items-to-users-collection.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/add-items-to-users-collection.md
@@ -3,6 +3,8 @@ id: add-items-to-users-collection
title: Add Items to User Collection
---
+import MusicStoreAddedAlbumsScreenshot from '/img/tutorials/music-store-app/add-items-to-users-collection/image-20210310175949319.png';
+
## Adding Albums to the Users Collection
Ok so now the user can find albums to purchase, it would be nice if the user could see which albums are in their collection. To do this we can add a similar UI to the MainWindow.
@@ -112,8 +114,6 @@ Notice we check the result for `null`, this is because the `user` may have cance
Lets run the program and see if it works.
-
-
-
+
For the finishing touch we simply need to add persistence to the application.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/creating-a-modern-looking-window.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/creating-a-modern-looking-window.md
index 9d8d85c8f..e365f2484 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/creating-a-modern-looking-window.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/creating-a-modern-looking-window.md
@@ -3,6 +3,10 @@ info: creating-a-modern-looking-window
title: Creating a Modern looking Window
---
+import MusicStoreDarkModePreviewScreenshot from '/img/tutorials/music-store-app/creating-a-modern-looking-window/dark-mode-preview.png';
+import MusicStoreAcrylicMaterialScreenshot from '/img/tutorials/music-store-app/creating-a-modern-looking-window/acrylic-material.png';
+import MusicStoreFullAcrylicWindowScreenshot from '/img/tutorials/music-store-app/creating-a-modern-looking-window/full-acrylic-window.png';
+
## Use Dark Mode and Add a little Acrylic
Let's try and make this look a little more modern by applying `Dark` mode and some `Acrylic` styling to the Window.
@@ -30,9 +34,7 @@ Let's try and make this look a little more modern by applying `Dark` mode and so
The previewer knows about changes you make to the file your editing, but it doesn't know about changes in other files. This is why you need to build the project if another file was changed.
-
-
-
+
1. After where it says `Title="Avalonia.MusicStore"` add the following code:
@@ -90,11 +92,9 @@ Now click the `Debug` `Button` to run the application again.
Notice we have a nice acrylic window effect. Shame about the titlebar, though. Let's see how we can make that blend in a bit more.
-
-
-
+
-\*Note, Linux users can not yet take advantage of this due to limitations of X11. The code will run and the window will still work on Linux, but the full effect will not be realised.
+*Note, Linux users can not yet take advantage of this due to limitations of X11. The code will run and the window will still work on Linux, but the full effect will not be realised.
1. It is possible to have Avalonia render into the `titlebar`, allowing us to create a more blended look. Modern web browsers tend to render tabs into the titlebar with this technique.
@@ -120,9 +120,6 @@ Notice we have a nice acrylic window effect. Shame about the titlebar, though. L
Press the `Debug` button again to run.
-
-
-
-
+
Perfect, a modern looking Window, Avalonia is able to render every pixel.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/creating-the-project.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/creating-the-project.md
index 8f40bcf7d..92d67f8fe 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/creating-the-project.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/creating-the-project.md
@@ -3,6 +3,11 @@ id: creating-the-project
title: Create the Project
---
+import MusicStoreCreateSolutionScreenshot from '/img/tutorials/music-store-app/creating-the-project/CreateSolution.png';
+import MusicStoreProjectStructureScreenshot from '/img/tutorials/music-store-app/creating-the-project/project-structure.png';
+import MusicStoreRiderDebugButtonScreenshot from '/img/tutorials/music-store-app/creating-the-project/debug-button.png';
+import MusicStoreNewAppScreenshot from '/img/tutorials/music-store-app/creating-the-project/image-20210310192926578.png';
+
### Creating a New Project
From the Rider Welcome Screen, click on `New Solution`. This will open a dialog with Project Types on the left and some input fields on the right.
@@ -11,15 +16,11 @@ At the bottom on the left hand side under the heading `Other` you will see `Aval
Click the `Create` button.
-
-
-
+
A new project will be created with the following structure.
-
-
-
+
The folders are:
@@ -45,14 +46,10 @@ Some of the important files are:
Press the debug button top right of the IDE to compile and run the project.
-
-
-
+
This will show a Window that looks like:
-
-
-
+
A little plain but we now have a running application, and a blank canvas to start from.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/displaying-images.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/displaying-images.md
index a1e7e32e8..dcc33f1bf 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/displaying-images.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/displaying-images.md
@@ -3,6 +3,8 @@ info: displaying-images
title: Displaying Images
---
+import MusicStoreDisplayingImagesScreenshot from '/img/tutorials/music-store-app/displaying-images/image-20210310173858088.png';
+
## Displaying Album Cover Images
So we have the Albums showing with the Artist name and Title, however, if we can download the Album art and display it, this will really bring the app alive.
@@ -162,6 +164,4 @@ Now run the application and search for your favourite artist.
Notice how the Albums covers load one by one, but that the UI remains responsive.
-
-
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/index.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/index.md
index c179a34e1..c78b0e770 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/index.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/index.md
@@ -1,5 +1,8 @@
# Music Store App
+import MusicStoreFinishedAppScreenshot from '/img/tutorials/music-store-app/image-20210310184538120.png';
+import MusicStoreMvvmDiagram from '/img/tutorials/music-store-app/mvvm.png';
+
:::info
The completed project can be found at [https://github.com/AvaloniaUI/Avalonia.MusicStore](https://github.com/AvaloniaUI/Avalonia.MusicStore).
@@ -12,10 +15,7 @@ This guide has instructions for Rider on macOS, however the steps will be almost
Our livestream assumes some knowledge of [XAML](../../guides/basics/introduction-to-xaml.md), [MVVM ](../../guides/basics/mvvm.md)development, however this guide should fill in the gaps for beginners.
-
-
-
-
+
## A little background to Avalonia
@@ -39,9 +39,7 @@ MVVM is simply a way to enforce [Separation of concerns](https://en.wikipedia.or
Following the MVVM approach will alleviate these difficulties and help keep your UI code scalable.
-
-
-
+
**How does MVVM work?**
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/load-data-at-startup.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/load-data-at-startup.md
index 9e8e3fcaf..d145a5746 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/load-data-at-startup.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/load-data-at-startup.md
@@ -3,6 +3,8 @@ info: load-data-at-startup
title: Load data at Startup
---
+import MusicStoreLoadedDataStartScreenshot from '/img/tutorials/music-store-app/load-data-at-startup/image-20210310184202271.png';
+
## Loading Albums on Startup
Our backend code provides a nice way to load the users collection from disk.
@@ -38,6 +40,4 @@ As you can see it firstly uses the business logic apis to load the list of `Albu
Note we then re-iterate over the `Albums` and asynchronously load each cover. Note that we do this after adding all the albums to the list, as its more important to quickly show the user all the albums available and then load the images.
-
-
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/opening-a-dialog.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/opening-a-dialog.md
index 2730f6567..8a8b60a00 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/opening-a-dialog.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/opening-a-dialog.md
@@ -3,6 +3,9 @@ id: opening-a-dialog
title: Opening a Dialog
---
+import MusicStoreAddWindowScreenshot from '/img/tutorials/music-store-app/opening-a-dialog/add-window.png';
+import MusicStoreDialogOpenedScreenshot from '/img/tutorials/music-store-app/opening-a-dialog/dialog-opened.png';
+
## Opening a Dialog
Opening a dialog is an advanced topic, if you are very new to Avalonia, try not to get too stuck on this section, you may want to just copy in the code and move on. Then come back once you have a better understanding of some of the basics.
@@ -13,9 +16,7 @@ First we need to add a Window to the project, right click on the `Views` folder
When prompted name this MusicStoreWindow and press the `Enter` key.
-
-
-
+
This will add the following code:
@@ -196,8 +197,6 @@ Also set `Width` and `Height` properties of the `MusicStoreWindows` `` e
Now run the application and click the Store button.
-
-
-
+
As you can see the dialog window is opened perfectly centered inside the MainWindow.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/searching-for-albums.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/searching-for-albums.md
index 88923c2b3..91b24e8d1 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/searching-for-albums.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/searching-for-albums.md
@@ -3,6 +3,9 @@ info: searching-for-albums
title: Searching for Albums
---
+import MusicStoreiTunesSearchNugetScreenshot from '/img/tutorials/music-store-app/searching-for-albums/image-20210310013703557.png';
+import MusicStoreAlbumViewScreenshot from '/img/tutorials/music-store-app/searching-for-albums/image-20210310110401944.png';
+
## Searching For Albums
In order for our application to work we are going to need some business logic. This code is not relevant to the tutorial, except for the fact that it will provide the following services:
@@ -19,9 +22,7 @@ This will open the `Packages` tool at the bottom of the IDE, like so.
Search for `ItunesSearch` and press the green `+` button on the right hand side to install it.
-
-
-
+
1. In the `Models` folder add a new class called `Album` and paste in the following code.
@@ -211,6 +212,4 @@ SearchResults.Add(new AlbumViewModel());
Now run the application and click the store button, then search for an artist or album name. If all has gone to plan you should see the progressbar animating whilst the server is busy processing the request and then you should see some results appear in the list.
-
-
-
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/setup-development-environment.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/setup-development-environment.md
index 15b31b7f9..e3bcf78f8 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/setup-development-environment.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/music-store-app/setup-development-environment.md
@@ -3,6 +3,11 @@ id: setup-development-environment
title: Setup Development Environment
---
+import MusicStoreRiderWelcomeScreenshot from '/img/tutorials/music-store-app/setup-development-environment/rider-welcome.png';
+import MusicStoreConfigurePluginReposScreenshot from '/img/tutorials/music-store-app/setup-development-environment/configure-plugin-repos.png';
+import MusicStoreEnterPluginRepoScreenshot from '/img/tutorials/music-store-app/setup-development-environment/enter-plugin-repo.png';
+import MusicStorePluginInstallScreenshot from '/img/tutorials/music-store-app/setup-development-environment/plugin-install.png';
+
### Setting up your development environment
1. Download and install .NET 5 SDK [Download .NET \(Linux, macOS, and Windows\) \(microsoft.com\)](https://dotnet.microsoft.com/download)
@@ -41,27 +46,18 @@ Examples:
Once Rider loads you will see the Welcome Screen. Click the `Configure` dropdown and select `Plugins`.
-
-
-
+
A new Preferences Screen will open up. Click the `Settings` icon as shown and select `Manage Plugin Repositories...`
-
-
-
+
Click the `+` icon and enter the URL `https://plugins.jetbrains.com/plugins/dev/14839`then click `OK`
-
-
-
+
Now click on the `Marketplace` tab and search for `Avalonia`. Select `AvaloniaRider` and click `Install` then once that's done, click the `Restart IDE` button that will appear.
-
-
-
-
+
Now Rider should be ready to develop Avalonia applications.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/running-in-the-browser.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/running-in-the-browser.md
index ecf19c0d2..c0c18966e 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/running-in-the-browser.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/running-in-the-browser.md
@@ -32,7 +32,7 @@ dotnet new avalonia.xplat
5. In order to run simply do:
```bash
-cd WebTest.Web
+cd WebTest.Browser
dotnet run
```
@@ -50,4 +50,4 @@ Legacy Blazor backend is still available for compatability and can be referenced
## Troubleshooting
-If you have not performed the step to install required workloads, you will encounter errors when running the app in your browser later (e.g. `System.DllNotFoundException: libSkiaSharp`) and you will need to rebuild again before the app will run.
\ No newline at end of file
+If you have not performed the step to install required workloads, you will encounter errors when running the app in your browser later (e.g. `System.DllNotFoundException: libSkiaSharp`) and you will need to rebuild again before the app will run.
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/adding-new-items.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/adding-new-items.md
index c4649787a..e5c6f180f 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/adding-new-items.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/adding-new-items.md
@@ -3,6 +3,10 @@ id: adding-new-items
title: Adding new Items
---
+import ToDoAddNewItemsEmptyScreenshot from '/img/tutorials/todo-list-app/adding-new-items/adding-new-items-view.png';
+import ToDoAddNewItemNavigationScreenshot from '/img/tutorials/todo-list-app/adding-new-items/adding-new-item-run.gif';
+import ToDoAddNewItemResultScreenshot from '/img/tutorials/todo-list-app/adding-new-items/adding-new-items-2-run.gif';
+
When we originally created the `TodoListView` we added an "Add an item" button. It's time now to make that button do something. When the button is clicked we want to replace the list of items with a new view which will allow the user to enter the description of a new item.
### Create the view
@@ -30,9 +34,7 @@ Views/AddItemView.axaml
This gives us a view which looks like this:
-
-
-
+
The only new thing here is the `` control which is a control that allows a user to input text. We set three properties on it:
@@ -164,9 +166,7 @@ If you're familiar with WPF or UWP you may think it strange that we're binding `
If you now run the application and click the "Add an item" button you should see the new view appear.
-
-
-
+
Now we have the "Add new item" view appearing we need to make it work. In particular we need to enable/disable the OK button depending on whether the user has typed anything in the `Description`.
@@ -369,7 +369,4 @@ Finally we subscribe to the result of the observable sequence. If the command re
### Run the application
-
-
-
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/creating-a-new-project.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/creating-a-new-project.md
index af74ff5ab..1e00973cf 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/creating-a-new-project.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/creating-a-new-project.md
@@ -3,13 +3,13 @@ id: creating-a-new-project
title: Creating a new project
---
+import ToDoVsCreateNewProjectScreenshot from '/img/tutorials/todo-list-app/creating-a-new-project/image (5).png';
+
## Visual Studio
The easiest way to get started with Avalonia from Visual Studio is to [install the extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) from the Visual Studio Marketplace. Once that is installed, you can create an Avalonia MVVM application:
-
-
-
+
- Start Visual Studio
- Select "Create a new project" from the start window or `File -> New -> Project` from the main menu
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/creating-a-view.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/creating-a-view.md
index b1e584ab5..9639f7025 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/creating-a-view.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/creating-a-view.md
@@ -3,6 +3,9 @@ id: creating-a-view
title: Creating a View
---
+import ToDoViewPreviewerScreenshot from '/img/tutorials/todo-list-app/creating-a-view/creating-a-view-todolistview.png';
+import ToDoViewScreenshot from '/img/tutorials/todo-list-app/creating-a-view/creating-a-view-run.png';
+
Let's first create a view to display a list of TODO items together with a button to add a new item.
Because this is a first tutorial, we're going to first just populate the view with some hard-coded data. In later steps we'll use the MVVM pattern to populate this view.
@@ -93,9 +96,7 @@ Edit the contents of `Views/TodoListView.axaml` to contain the following:
If you're using the Visual Studio extension you should see the contents of the control displayed in the previewer after completing a build:
-
-
-
+
### What does it all mean?
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/index.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/index.md
index a0dfe4086..2d4ef6641 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/index.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/index.md
@@ -1,14 +1,14 @@
# ToDo List App
+import ToDoFinishedAppScreenshot from '/img/tutorials/todo-list-app/image (14).png';
+
In this tutorial we're going to be creating a simple TODO application in Avalonia using the Model-View-ViewModel \(MVVM\) pattern.
:::info
You can find the code for the completed application [here](https://github.com/grokys/todo-tutorial).
:::
-
-
-
+
## Model-View-ViewModel \(MVVM\)
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/wiring-up-the-views.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/wiring-up-the-views.md
index 454da9c6f..155469eba 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/wiring-up-the-views.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/tutorials/todo-list-app/wiring-up-the-views.md
@@ -3,6 +3,8 @@ id: wiring-up-the-views
title: Wiring up the Views
---
+import ToDoWiredViewScreenshot from '/img/tutorials/todo-list-app/wiring-up-the-views/wiring-up-views-run.png';
+
Now that we've got the view models set up, we need to make our views use these view models. We do this by making use of Avalonia's [data binding](../../getting-started/programming-with-avalonia/data-binding) feature.
## Update MainWindow
@@ -97,6 +99,4 @@ How each item is displayed is controlled by the `ItemTemplate`. The `ItemTemplat
If you now run the application you will see the items in the \(fake\) database displayed.
-
-
-
\ No newline at end of file
+
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/wpf-developer-tips/datatemplates.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/wpf-developer-tips/datatemplates.md
index e0a317e97..6a72f8960 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/wpf-developer-tips/datatemplates.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/wpf-developer-tips/datatemplates.md
@@ -1,6 +1,6 @@
---
info: datatemplates
-title: DataTempaltes
+title: DataTemplates
---
As styles aren't stored in `Resources`, neither are `DataTemplates`. Instead, `DataTemplates` are placed in a `DataTemplates` collection on each control \(and on `Application`\):
@@ -25,4 +25,4 @@ Data templates in Avalonia can also target interfaces and derived classes \(whic
## DataTemplateSelector
-In WPF you can create a `DataTemplateSelector` to select or create a `DataTemplate` based on the provided data. In Avalonia you cannot do this, but you can implement `IDataTemplate` which can be seen as a good replacement for the `DataTemplateSelector`. Please find a sample [here](https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/DataTemplates/IDataTemplateSample).
\ No newline at end of file
+In WPF you can create a `DataTemplateSelector` to select or create a `DataTemplate` based on the provided data. In Avalonia you cannot do this, but you can implement `IDataTemplate` which can be seen as a good replacement for the `DataTemplateSelector`. Please find a sample [here](https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/DataTemplates/IDataTemplateSample).
diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/wpf-developer-tips/index.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/wpf-developer-tips/index.md
index edfe2a77b..65c700f41 100644
--- a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/wpf-developer-tips/index.md
+++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.10.x/wpf-developer-tips/index.md
@@ -86,7 +86,7 @@ private void OnControl_Unloaded(object sender, RoutedEventArgs e)
**Avalonia**
```
TemplateApplied += OnControl_Loaded;
-private void BuildControl_Loaded(object sender, RoutedEventArgs e)
+private void OnControl_Loaded(object sender, RoutedEventArgs e)
{
}
@@ -129,4 +129,4 @@ TextRunProperties.SetTextDecorations(TextDecorations.Underline);
**Avalonia**
```csharp
TextRunProperties.Underline = true;
-```
\ No newline at end of file
+```
diff --git a/sidebars.js b/sidebars.js
index a327acec6..378c463c5 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -16,9 +16,13 @@ const sidebars = {
'get-started/install',
'get-started/set-up-an-editor',
{
- type: 'category',
- label: 'Test Drive',
- items: [
+ 'type': 'category',
+ 'label': 'Test Drive',
+ 'link' : {
+ 'type' : 'doc',
+ 'id': 'get-started/test-drive/index'
+ },
+ 'items': [
'get-started/test-drive/introduction',
'get-started/test-drive/create-a-project',
'get-started/test-drive/main-window',
diff --git a/src/css/custom.css b/src/css/custom.css
index b4684da4d..9057f189c 100644
--- a/src/css/custom.css
+++ b/src/css/custom.css
@@ -115,6 +115,13 @@ img.rounded-corners {
border-radius: 50px;
}
+img.center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ padding-bottom: 1rem;
+}
+
.docusaurus-highlight-code-line {
background-color: rgb(72, 77, 91);
display: block;
diff --git a/static/img/controls/colorpicker/color-palette-flat-half.png b/static/img/controls/colorpicker/color-palette-flat-half.png
new file mode 100644
index 000000000..aa1c9091c
Binary files /dev/null and b/static/img/controls/colorpicker/color-palette-flat-half.png differ
diff --git a/static/img/controls/colorpicker/color-palette-flat.png b/static/img/controls/colorpicker/color-palette-flat.png
new file mode 100644
index 000000000..acd3253fd
Binary files /dev/null and b/static/img/controls/colorpicker/color-palette-flat.png differ
diff --git a/static/img/controls/colorpicker/color-palette-fluent.png b/static/img/controls/colorpicker/color-palette-fluent.png
new file mode 100644
index 000000000..3218a10c5
Binary files /dev/null and b/static/img/controls/colorpicker/color-palette-fluent.png differ
diff --git a/static/img/controls/colorpicker/color-palette-material-half.png b/static/img/controls/colorpicker/color-palette-material-half.png
new file mode 100644
index 000000000..332011747
Binary files /dev/null and b/static/img/controls/colorpicker/color-palette-material-half.png differ
diff --git a/static/img/controls/colorpicker/color-palette-material.png b/static/img/controls/colorpicker/color-palette-material.png
new file mode 100644
index 000000000..b5ea07ece
Binary files /dev/null and b/static/img/controls/colorpicker/color-palette-material.png differ
diff --git a/static/img/controls/colorpicker/color-palette-sixteen.png b/static/img/controls/colorpicker/color-palette-sixteen.png
new file mode 100644
index 000000000..22bbd838e
Binary files /dev/null and b/static/img/controls/colorpicker/color-palette-sixteen.png differ
diff --git a/static/img/gitbook-import/assets/progressbar.PNG b/static/img/gitbook-import/assets/progressbar.png
similarity index 100%
rename from static/img/gitbook-import/assets/progressbar.PNG
rename to static/img/gitbook-import/assets/progressbar.png
diff --git a/versioned_docs/version-0.10.x/animations/page-transitions.md b/versioned_docs/version-0.10.x/animations/page-transitions.md
index 8e2b767d6..c6f7b195b 100644
--- a/versioned_docs/version-0.10.x/animations/page-transitions.md
+++ b/versioned_docs/version-0.10.x/animations/page-transitions.md
@@ -6,6 +6,8 @@ title: Page Transitions
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import CustomPageTransitionScreenshot from '/img/animations/page-transitions/TransitioningContentControl_03.webp';
+
`PageTransitions` are used to render a transition between two views, for example in a [Carousel](../controls/carousel) or [TransitioningContentControl](../controls/TransitioningContentControl)
:::warning
@@ -270,9 +272,7 @@ public class CustomTransition : IPageTransition
}
```
-
-
-
+
#### Source code
[IPageTransition.cs](https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Visuals/Animation/IPageTransition.cs)
diff --git a/versioned_docs/version-0.10.x/community.md b/versioned_docs/version-0.10.x/community.md
index 45728fe80..d79f110dd 100644
--- a/versioned_docs/version-0.10.x/community.md
+++ b/versioned_docs/version-0.10.x/community.md
@@ -1,7 +1,13 @@
# Community Support
+import TelegramLogoScreenshot from '/img/gitbook-import/assets/image (7) (1) (1).png';
+import GitterLogoScreenshot from '/img/gitbook-import/assets/image (38) (1) (1).png';
+import GitterChatScreenshot from '/img/gitbook-import/assets/image (37) (1) (1).png';
+
## Telegram
+
+
You can also access the Avalonia chat using the _Telegram_ app (recommended for the best experience).
:::info
@@ -10,15 +16,12 @@ You can access the _Telegram_ chat [here](https://t.me/Avalonia).
## Gitter
-
+
We run a chat in English on the Gitter platform.
-
+
:::info
Access the chat in your browser using Gitter [here](https://gitter.im/AvaloniaUI/Avalonia).
:::
-
-
-
diff --git a/versioned_docs/version-0.10.x/controls/border.md b/versioned_docs/version-0.10.x/controls/border.md
index 9d133207e..40b96c110 100644
--- a/versioned_docs/version-0.10.x/controls/border.md
+++ b/versioned_docs/version-0.10.x/controls/border.md
@@ -3,6 +3,9 @@ id: border
title: Border
---
+import BorderSampleScreenshot from '/img/controls/border/image (2).png';
+import BorderBoxShadowScreenshot from '/img/controls/border/image (8).png';
+
The `Border` control decorates a child with a border and background. It can also be used to display rounded corners by setting the [`CornerRadius`](http://reference.avaloniaui.net/api/Avalonia/CornerRadius/) property.
An example of a border with a red background, 2 pixel black border, 3 pixel corner radius and a 4 pixel padding around its content:
@@ -20,9 +23,7 @@ An example of a border with a red background, 2 pixel black border, 3 pixel corn
```
-
-
-
+
## Box Shadows
@@ -61,9 +62,7 @@ To specify multiple shadows, provide a comma-separated list of shadows.
```
-
-
-
+
## Common Properties
diff --git a/versioned_docs/version-0.10.x/controls/buttons/button.md b/versioned_docs/version-0.10.x/controls/buttons/button.md
index 7f6a597ee..0d659ce63 100644
--- a/versioned_docs/version-0.10.x/controls/buttons/button.md
+++ b/versioned_docs/version-0.10.x/controls/buttons/button.md
@@ -3,6 +3,9 @@ id: button
title: Button
---
+import ButtonBasicScreenshot from '/img/controls/buttons/button/button_basic.png';
+import ButtonColoredScreenshot from '/img/controls/buttons/button/image.png';
+
The `Button` control is a [`ContentControl`](../contentcontrol) which reacts to pointer presses.
A button notifies clicks by raising the [`Click`](http://reference.avaloniaui.net/api/Avalonia.Controls/Button/61B1E7A8) event. A click is distinct from a `PointerDown` event in that it is raised by default when the button is pressed and then released (although this behavior can be changed by setting the [`ClickMode`](http://reference.avaloniaui.net/api/Avalonia.Controls/ClickMode/) property).
@@ -55,17 +58,14 @@ The Button control's full documentation can be found [here](http://reference.ava
x:Class="AvaloniaAppTemplate.MainWindow"
Title="AvaloniaAppTemplate">
-
+
```
-produces following output with **Windows 10**\
-
-
-
-
+produces following output with **Windows 10**
+
### Colored button
@@ -83,11 +83,9 @@ produces following output with **Windows 10**\
```
-produces following output with **Windows 10**\
+produces following output with **Windows 10**
-
-
-
+
### Play button
diff --git a/versioned_docs/version-0.10.x/controls/buttons/splitbutton.md b/versioned_docs/version-0.10.x/controls/buttons/splitbutton.md
index a07b62dbc..b94bccdf7 100644
--- a/versioned_docs/version-0.10.x/controls/buttons/splitbutton.md
+++ b/versioned_docs/version-0.10.x/controls/buttons/splitbutton.md
@@ -3,6 +3,11 @@ id: splitbutton
title: SplitButton
---
+import SplitButtonClosedScreenshot from '/img/controls/buttons/splitbutton/SplitButtonClosed.png';
+import SplitButtonOpenedScreenshot from '/img/controls/buttons/splitbutton/SplitButtonOpened.png';
+import SplitButtonColorPickerScreenshot from '/img/controls/buttons/splitbutton/SplitButton_ColorPickerSample.png';
+import SplitButtonExportButtonScreenshot from '/img/controls/buttons/splitbutton/SplitButton_ExportButtonSample.png';
+
The `SplitButton` functions as a [`Button`](button) with primary and secondary parts that can each be pressed separately. The primary part behaves like normal `Button` and the secondary part opens a [`Flyout`](../flyouts) with additional actions.
@@ -58,16 +63,11 @@ The user-selection action should be invoked immediately when pressing either the
```
-
-
-
-
+
*SplitButton (Flyout closed)*
-
-
-
+
*SplitButton (Flyout opened)*
@@ -106,9 +106,7 @@ A common use case of a `SplitButton` is for coloring text within an editor. Pres
```
-
-
-
+
*Sample of SplitButton for color selection*
@@ -133,8 +131,6 @@ Another common example of the `SplitButton` could be an export button. When the
```
-
-
-
+
*Sample of a SplitButton with different export options*
diff --git a/versioned_docs/version-0.10.x/controls/buttons/togglesplitbutton.md b/versioned_docs/version-0.10.x/controls/buttons/togglesplitbutton.md
index 627be38f5..6741f1ef0 100644
--- a/versioned_docs/version-0.10.x/controls/buttons/togglesplitbutton.md
+++ b/versioned_docs/version-0.10.x/controls/buttons/togglesplitbutton.md
@@ -3,6 +3,11 @@ id: togglesplitbutton
title: ToggleSplitButton
---
+import ToggleSplitButtonClosedUncheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_closed_unchecked.png';
+import ToggleSplitButtonClosedCheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_closed_checked.png';
+import ToggleSplitButtonOpenedCheckedScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_opened_checked.png';
+import ToggleSplitButtonTextListScreenshot from '/img/controls/buttons/togglesplitbutton/ToggleSplitButton_TextListExample.png';
+
The `ToggleSplitButton` functions as a [`ToggleButton`](togglebutton) with primary and secondary parts that can each be pressed separately. The primary part behaves like a normal `ToggleButton` and the secondary part opens a [`Flyout`](../flyouts) with additional actions.
:::info
@@ -66,21 +71,15 @@ Pressing a configuration in the `Flyout` should either (1) turn on the feature w
```
-
-
-
+
*SplitButton (Flyout closed, unchecked)*
-
-
-
+
*SplitButton (Flyout closed, checked)*
-
-
-
+
*SplitButton (Flyout opened, checked)*
@@ -122,10 +121,6 @@ Continuing the text editor example from `SplitButton`, a common use case of the
```
-
-
-
-
+
*Sample of ToggleSplitButton for toggle text lists on and off and selecting the list format*
-
diff --git a/versioned_docs/version-0.10.x/controls/canvas.md b/versioned_docs/version-0.10.x/controls/canvas.md
index 74e81cf13..761924466 100644
--- a/versioned_docs/version-0.10.x/controls/canvas.md
+++ b/versioned_docs/version-0.10.x/controls/canvas.md
@@ -3,6 +3,8 @@ id: canvas
title: Canvas
---
+import CanvasChildOverlapScreenshot from '/img/controls/canvas/layout-panel-canvas.png';
+
The `Canvas` control is a `Panel` which lays out its children by explicit coordinates.
You specify the positions of individual child elements by setting the `Canvas.Left` and `Canvas.Top` attached properties on each element.
@@ -24,11 +26,7 @@ Here's an example of a Canvas in XAML.
The result looks like this.
-
-
-
-
-
+
Use the Canvas panel with discretion. While it's convenient to be able to precisely control positions of elements in UI for some scenarios, a fixed positioned layout panel causes that area of your UI to be less adaptive to overall app window size changes.
diff --git a/versioned_docs/version-0.10.x/controls/checkbox.md b/versioned_docs/version-0.10.x/controls/checkbox.md
index 99a85a93b..1e7652a73 100644
--- a/versioned_docs/version-0.10.x/controls/checkbox.md
+++ b/versioned_docs/version-0.10.x/controls/checkbox.md
@@ -3,6 +3,9 @@ id: checkbox
title: CheckBox
---
+import CheckBoxTwoStateScreenshot from '/img/controls/checkbox/checkbox_basic.png';
+import CheckBoxThreeStateScreenshot from '/img/controls/checkbox/checkbox_threestate.png';
+
The `CheckBox` control is a [`ContentControl`](../controls/contentcontrol) which allows user to check an option. It is usually used to display a boolean option where selection is either _checked_ or _unchecked_. But it also supports three state mode where selection is either _checked_, _indeterminate_ or _unchecked_.
## Common Properties
@@ -39,12 +42,9 @@ The `CheckBox` control is a [`ContentControl`](../controls/contentcontrol) which
```
-produces following output with **Windows 10**\
-
-
-
-
+produces following output with **Windows 10**
+
### Three state checkbox
@@ -64,8 +64,6 @@ produces following output with **Windows 10**\
```
-produces following output with **Windows 10**\
+produces following output with **Windows 10**
-
-
-
\ No newline at end of file
+
diff --git a/versioned_docs/version-0.10.x/controls/contentcontrol.md b/versioned_docs/version-0.10.x/controls/contentcontrol.md
index 69d58a38f..c3a4d6db7 100644
--- a/versioned_docs/version-0.10.x/controls/contentcontrol.md
+++ b/versioned_docs/version-0.10.x/controls/contentcontrol.md
@@ -3,6 +3,8 @@ id: contentcontrol
title: ContentControl
---
+import ControlContentStudentScreenshot from '/img/controls/contentcontrol/student-first-last-name (1) (1) (1) (1).png';
+
## Common Properties
| Property | Description |
@@ -73,7 +75,7 @@ namespace Example
}
```
-> Note: The following examples assume an instance of `MainWindowVieModel` is assigned to the Window's `DataContext`. See [the section on `DataContext`](docs/data-binding/the-datacontext) for more information.
+> Note: The following examples assume an instance of `MainWindowViewModel` is assigned to the Window's `DataContext`. See [the section on `DataContext`](docs/data-binding/the-datacontext) for more information.
We can display the student's first and last name in a `ContentControl` using the `ContentTemplate` property:
@@ -94,9 +96,6 @@ We can display the student's first and last name in a `ContentControl` using the
```
-
-
-
-
+
-For more information see the [data templates](docs/templates/data-templates) section.
\ No newline at end of file
+For more information see the [data templates](docs/templates/data-templates) section.
diff --git a/versioned_docs/version-0.10.x/controls/datepicker.md b/versioned_docs/version-0.10.x/controls/datepicker.md
index a1ffa81e5..f98635880 100644
--- a/versioned_docs/version-0.10.x/controls/datepicker.md
+++ b/versioned_docs/version-0.10.x/controls/datepicker.md
@@ -6,6 +6,9 @@ title: DatePicker
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import DatePickerSelectedDateScreenshot from '/img/controls/datepicker/selected-date.png';
+import DatePickerUnsetScreenshot from '/img/controls/datepicker/no-date.png';
+
The `DatePicker` control allows the user to pick a date value.
## Examples
@@ -37,9 +40,7 @@ DatePicker birthDatePicker = new DatePicker();
Use a `DatePicker` to let a user enter a date value. The user picks the date using [ComboBox](combobox.md) selection for month, day, and year values. You can customize the `DatePicker` in various ways to suit your app.
-
-
-
+
### Formatting the date picker
@@ -53,9 +54,7 @@ The date picker control has both `Date` / `DateChanged` and `SelectedDate` / `Se
The value of `SelectedDate` is used to populate the date picker and is `null` by default. If `SelectedDate` is `null`, the `Date` property is set to 12/31/1600; otherwise, the `Date` value is synchronized with the `SelectedDate` value. When `SelectedDate` is `null`, the picker is 'unset' and shows the field names instead of a date.
-
-
-
+
To use the date value in your app, you typically use a data binding to the `SelectedDate` property, or handle the `SelectedDateChanged` event.
diff --git a/versioned_docs/version-0.10.x/controls/dockpanel.md b/versioned_docs/version-0.10.x/controls/dockpanel.md
index f1fb742cb..0cb32afb5 100644
Binary files a/versioned_docs/version-0.10.x/controls/dockpanel.md and b/versioned_docs/version-0.10.x/controls/dockpanel.md differ
diff --git a/versioned_docs/version-0.10.x/controls/flyouts.md b/versioned_docs/version-0.10.x/controls/flyouts.md
index fcb2e2bef..295e3479c 100644
--- a/versioned_docs/version-0.10.x/controls/flyouts.md
+++ b/versioned_docs/version-0.10.x/controls/flyouts.md
@@ -3,6 +3,9 @@ id: flyouts
title: Flyouts
---
+import FlyoutContentScreenshot from '/img/controls/flyouts/flyoutpreview.png';
+import FlyoutMenuScreenshot from '/img/controls/flyouts/menuflyoutpreview.png';
+
## Overview
Flyouts are light dismissible containers that show arbitrary UI content. Flyouts are not controls and can be declared as a resource and shared between multiple elements within your app.
@@ -44,15 +47,11 @@ Flyouts are light dismissible containers that show arbitrary UI content. Flyouts
There are two built-in types of Flyouts: `Flyout` and `MenuFlyout`. A regular `Flyout` has no special logic and is just a simple container for any arbitrary UI content.
-
-
-
+
`MenuFlyout`, as the name implies, creates a Menu.
-
-
-
+
## Reference
diff --git a/versioned_docs/version-0.10.x/controls/grid.md b/versioned_docs/version-0.10.x/controls/grid.md
index e72416ae6..7aa23e6ec 100644
--- a/versioned_docs/version-0.10.x/controls/grid.md
+++ b/versioned_docs/version-0.10.x/controls/grid.md
@@ -3,6 +3,12 @@ id: grid
title: Grid
---
+import GridSampleScreenshot from '/img/controls/grid/grid_example.png';
+import GridAsteriskScreenshot from '/img/controls/grid/grid_asterisk_example.png';
+import GridAsteriskButtonsScreenshot from '/img/controls/grid/grid_asterisk_example_buttons.png';
+import GridAutoButtonsScreenshot from '/img/controls/grid/grid_auto_example_buttons.png';
+import GridVerboseSampleScreenshot from '/img/controls/grid/grid_example_verbose.png';
+
The `Grid` control is a `Panel` control useful for organizing other controls in columns and rows. `ColumnDefinition` and `RowDefinition` properties are used to define absolute, relative, or proportional row and column geometries for the grid. Each control in the grid will be placed using the `Grid.Column` and `Grid.Row` additional properties. It is also possible to have controls that span multiple rows and/or columns by using the `ColumnSpan` and `RowSpan` properties.
## Reference
@@ -42,9 +48,7 @@ In the above example we have two keywords: __*__ and **Auto**. Here is explanati
The multiplier used in front of the proportional spacing value is used to figure out the relative size for the proportional columns. All proportional columns fit in the space left behind after all explicit values and "Auto" values are calculated. So for the above example the Column 1 will get 1.5 parts plus Column 2 will get 4 parts of the remainder of the space that Column 0 left. Lastly, the Button itself will fill in from the initial Cell 1,1 over one column and down one row because `Grid.RowSpan` and `Grid.ColumnSpan` are set to occupy two units instead of one.
-
-
-
+
Here is another example showing the difference between those two.
@@ -65,16 +69,11 @@ First let's create sample 2x2 grid in our View, we can achieve this simply by wr
As you can see we created equal grid, I left `ShowGridLines` parameter set to `True` for better visibility.
-
-
-
-
+
Now let's fill our grid with some elements, I will fill every field with button, you can use anything you want.
-
-
-
+
Now our View code look's like this:
@@ -98,13 +97,11 @@ Now our View code look's like this:
In this moment our **asterisk** symbols are forcing our grid to become equal, now let's see what will happen when we replace **asterisk** with the **Auto** keyword
-
-
-
+
As you can see our grid become sticky to its content, it is very useful when we have components with variable `Height` property.
-This new View code look's like this:
+This new View code looks like this:
```markup
@@ -148,9 +145,7 @@ For more complex row and column definitions it's possible to explicitly use `Gri
```
-
-
-
+
### Common Properties
diff --git a/versioned_docs/version-0.10.x/controls/gridsplitter.md b/versioned_docs/version-0.10.x/controls/gridsplitter.md
index f8aabb17b..58a39eeb8 100644
--- a/versioned_docs/version-0.10.x/controls/gridsplitter.md
+++ b/versioned_docs/version-0.10.x/controls/gridsplitter.md
@@ -3,6 +3,9 @@ id: gridsplitter
title: GridSplitter
---
+import GridSplitterColumnsScreenshot from '/img/controls/gridsplitter/gridsplitter-in-action-columns.gif';
+import GridSplitterRowsScreenshot from '/img/controls/gridsplitter/gridsplitter-in-action-rows.gif';
+
The `GridSplitter` control is a control that allows a user to resize the space between `Grid` rows or columns.
```markup
@@ -13,9 +16,7 @@ The `GridSplitter` control is a control that allows a user to resize the space b
```
-
-
-
+
```markup
@@ -25,9 +26,7 @@ The `GridSplitter` control is a control that allows a user to resize the space b
```
-
-
-
+
### Reference
diff --git a/versioned_docs/version-0.10.x/controls/itemsrepeater.md b/versioned_docs/version-0.10.x/controls/itemsrepeater.md
index 7ce7aaff0..de9523caf 100644
--- a/versioned_docs/version-0.10.x/controls/itemsrepeater.md
+++ b/versioned_docs/version-0.10.x/controls/itemsrepeater.md
@@ -3,6 +3,9 @@ id: itemsrepeater
title: ItemsRepeater
---
+import ItemsRepeaterVerticalScreenshot from '/img/controls/itemsrepeater/itemsrepeatervertical.png';
+import ItemsRepeaterHorizontalScreenshot from '/img/controls/itemsrepeater/itemsrepeaterhorizontal.png';
+
A data-driven collection control that incorporates a flexible layout system, custom views, and virtualization.
`ItemsRepeater` is a port of the UWP `ItemsRepeater` control. More documentation can be found at:
@@ -50,11 +53,10 @@ By default an `ItemsRepeater`, without defining a `Layout` will render them Stac
```
And they will look like so
-
-
-
+
If you want them to be rendered Horizontally, you need to specify a `Layout` property and the xaml should look a bit like so:
+
```xml
@@ -73,14 +75,12 @@ If you want them to be rendered Horizontally, you need to specify a `Layout` pro
```
-this will look like this:
-
-
-
-In the `Layout` property you can also specify `Spacing` between the items, but you cannot define `Classes` nor other complex styles, those needs to be defined on the `ItemsRepeater` if needed.
+this will look like this:
+
+In the `Layout` property you can also specify `Spacing` between the items, but you cannot define `Classes` nor other complex styles, those needs to be defined on the `ItemsRepeater` if needed.
## Reference
diff --git a/versioned_docs/version-0.10.x/controls/maskedtextbox.md b/versioned_docs/version-0.10.x/controls/maskedtextbox.md
index 1ce9874f2..c9d536a22 100644
--- a/versioned_docs/version-0.10.x/controls/maskedtextbox.md
+++ b/versioned_docs/version-0.10.x/controls/maskedtextbox.md
@@ -3,6 +3,9 @@ id: maskedtextbox
title: MaskedTextBox
---
+import MaskedTextBoxEmptyScreenshot from '/img/controls/maskedtextbox/maskedtextboxexample1.png';
+import MaskedTextBoxTextEntryScreenshot from '/img/controls/maskedtextbox/maskedtextexample.gif';
+
The `MaskedTextBox` control is an editable text field where a user can input text.
## Source code
@@ -27,15 +30,11 @@ The `MaskedTextBox` control is an editable text field where a user can input tex
produces the following output in **Ubuntu**
-
-
-
+
and it behaves like so when filled in by user input
-
-
-
+
### Supported Masks
diff --git a/versioned_docs/version-0.10.x/controls/numericupdown.md b/versioned_docs/version-0.10.x/controls/numericupdown.md
index 3538e14ca..8dbe0c8e0 100644
--- a/versioned_docs/version-0.10.x/controls/numericupdown.md
+++ b/versioned_docs/version-0.10.x/controls/numericupdown.md
@@ -3,6 +3,8 @@ id: numericupdown
title: NumericUpDown
---
+import NumericUpDownBasicScreenshot from '/img/controls/numericupdown/numericupdown_basic.png';
+
The `NumericUpDown` is an editable numeric input field.
The control has a up and down button spinner attached, used to increment and decrement the value in the input field. The value can also be incremented or decremented using the arrow keys or the mouse wheel when the control is selected.
@@ -25,11 +27,9 @@ The value stored in the `NumericUpDown` is a double.
```
-produces the following output on **Linux**\
+produces the following output on **Linux**
-
-
-
+
### NumericUpDown with a changed increment and bounds
diff --git a/versioned_docs/version-0.10.x/controls/panel.md b/versioned_docs/version-0.10.x/controls/panel.md
index 703ebe742..72c4309f4 100644
--- a/versioned_docs/version-0.10.x/controls/panel.md
+++ b/versioned_docs/version-0.10.x/controls/panel.md
@@ -3,6 +3,8 @@ id: panel
title: Panel
---
+import PanelRectangleLayoutScreenshot from '/img/controls/panel/image (7).png';
+
The `Panel` is the base class for controls that can contain multiple children like `DockPanel` or `StackPanel`.
The `Panel` class can be useful on its own for very basic layouts, or simply to allow multiple controls to be to be contained.
@@ -16,9 +18,7 @@ The `Panel` class can be useful on its own for very basic layouts, or simply to
```
-
-
-
+
There are other more useful panels that derive from `Panel`, these include:
diff --git a/versioned_docs/version-0.10.x/controls/progressbar.md b/versioned_docs/version-0.10.x/controls/progressbar.md
index e8a8e1e08..426dac3d8 100644
--- a/versioned_docs/version-0.10.x/controls/progressbar.md
+++ b/versioned_docs/version-0.10.x/controls/progressbar.md
@@ -3,15 +3,15 @@ id: progressbar
title: ProgressBar
---
+import ProgressBarScreenshot from '/img/controls/progressbar/progressbar (1).png';
+
The `ProgressBar` control allow for showing dynamic progress status.
### Customizing the progress text
When [`ShowProgressText`](http://reference.avaloniaui.net/api/Avalonia.Controls/ProgressBar/590A8B3E) is `true`, text on the progress bar will be displayed.
-
-
-
+
By default this text shows the percentage completion, according to the [`Value`](http://reference.avaloniaui.net/api/Avalonia.Controls.Primitives/RangeBase/E111DF5B), [`Minimum`](http://reference.avaloniaui.net/api/Avalonia.Controls.Primitives/RangeBase/8F9BD1EA) and [`Maximum`](http://reference.avaloniaui.net/api/Avalonia.Controls.Primitives/RangeBase/C07B22E9). The format of this text can be customised by using the `ProgressTextFormat` property. This expects a string which will be passed to a [`string.Format`](https://docs.microsoft.com/en-us/dotnet/api/system.string.format#system-string-format(system-string-system-object())) call with the value of `ProgressTextFormat` as the format string. The following format items are available at the given indices:
diff --git a/versioned_docs/version-0.10.x/controls/relativepanel.md b/versioned_docs/version-0.10.x/controls/relativepanel.md
index eafae4f45..1df65a7c9 100644
--- a/versioned_docs/version-0.10.x/controls/relativepanel.md
+++ b/versioned_docs/version-0.10.x/controls/relativepanel.md
@@ -3,6 +3,8 @@ id: relativepanel
title: RelativePanel
---
+import RelativePanelScreenshot from '/img/controls/relativepanel/layout-panel-relative-panel.png';
+
The `RelativePanel` control is a `Panel` which lets you layout elements by specifying where they go in relation to other elements and in relation to the panel.
By default, an element is positioned in the upper left corner of the panel.
@@ -42,9 +44,7 @@ This XAML shows how to arrange elements in a RelativePanel.
The result looks like this.
-
-
-
+
Here are a few things to note about the sizing of the rectangles:
diff --git a/versioned_docs/version-0.10.x/controls/splitview.md b/versioned_docs/version-0.10.x/controls/splitview.md
index 62bad1996..4a3d46841 100644
--- a/versioned_docs/version-0.10.x/controls/splitview.md
+++ b/versioned_docs/version-0.10.x/controls/splitview.md
@@ -3,6 +3,8 @@ id: splitview
title: SplitView
---
+import SplitViewScreenshot from '/img/controls/splitview/image (9).png';
+
Represents a container with two views; one view for the main content and another view that is typically used for navigation commands.
```markup
@@ -25,9 +27,7 @@ Represents a container with two views; one view for the main content and another
```
-
-
-
+
A split view's content area is always visible. The pane can expand and collapse or remain in an open state, and can present itself from either the left side or right side of an app window. The pane has four modes:
diff --git a/versioned_docs/version-0.10.x/controls/stackpanel.md b/versioned_docs/version-0.10.x/controls/stackpanel.md
index 2ffb1185d..ab9bab10b 100644
--- a/versioned_docs/version-0.10.x/controls/stackpanel.md
+++ b/versioned_docs/version-0.10.x/controls/stackpanel.md
@@ -3,6 +3,9 @@ id: stackpanel
title: StackPanel
---
+import StackPanelRectangleScreenshot from '/img/controls/stackpanel/layout-panel-stack-panel.png';
+import StackPanelRectangleSpacingScreenshot from '/img/controls/stackpanel/image (12).png';
+
The `StackPanel` control is a `Panel` which lays out its children by stacking them horizontally or vertically. StackPanel is typically used to arrange a small subsection of the UI on a page.
You can use the [**Orientation**](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.stackpanel.orientation) property to specify the direction of the child elements. The default orientation is [**Vertical**](https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.Orientation).
@@ -20,9 +23,7 @@ The following XAML shows how to create a vertical StackPanel of items.
The result looks like this.
-
-
-
+
In a StackPanel, if a child element's size is not set explicitly, it stretches to fill the available width \(or height if the Orientation is **Horizontal**\). In this example, the width of the rectangles is not set. The rectangles expand to fill the entire width of the StackPanel.
@@ -37,10 +38,7 @@ StackPanel has a `Spacing` property to allow an even spacing between items.
```
-
-
-
-
+
### Reference
diff --git a/versioned_docs/version-0.10.x/controls/tabcontrol.md b/versioned_docs/version-0.10.x/controls/tabcontrol.md
index 48263c57b..26b004a22 100644
--- a/versioned_docs/version-0.10.x/controls/tabcontrol.md
+++ b/versioned_docs/version-0.10.x/controls/tabcontrol.md
@@ -3,13 +3,14 @@ id: tabcontrol
title: TabControl
---
+import TabControlRibbonScreenshot from '/img/controls/tabcontrol/tabcontrol.gif';
+import TabControlStyledRibbonScreenshot from '/img/controls/tabcontrol/customizedtabcontrol.gif';
+
The `TabControl` allows us to switch between different pages by means of tabs like the tabs in web navigators or the ribbon menu \(which uses tabs\) in Word Office for instance.
Here is an animation of what you can achieve :
-
-
-
+
To create this, we'll describe the entire control \(TabControl\) and each individual tab+page \(TabItem\). Here is an example :
@@ -43,9 +44,7 @@ To create this, we'll describe the entire control \(TabControl\) and each indivi
Let's have a look at a customized `TabControl` :
-
-
-
+
The grey part is the `TabItem`... Yes, the `TabItem` includes the tab **AND** the page associated to the tab. The tab is called the `header`of the `TabItem`. Moreover, given the way `TabControl` has been implemented, tabs are in a `WrapPanel`. Thus, if you want to color in blue \(like this is done above\) the empty bar of the tabbed bar, you must change the background color of the `WrapPanel` of the `TabControl`. Here is the code used to obtain the result above \(_Note the workaround used to color some tabs : this is due to the way the control is implemented. It might change in the future._\)
diff --git a/versioned_docs/version-0.10.x/controls/textbox.md b/versioned_docs/version-0.10.x/controls/textbox.md
index 0998dd5ee..b465bf104 100644
--- a/versioned_docs/version-0.10.x/controls/textbox.md
+++ b/versioned_docs/version-0.10.x/controls/textbox.md
@@ -3,6 +3,11 @@ id: textbox
title: TextBox
---
+import TextBoxSingleLineScreenshot from '/img/controls/textbox/textbox_basic.png';
+import TextBoxPasswordScreenshot from '/img/controls/textbox/textbox_password.png';
+import TextBoxWatermarkScreenshot from '/img/controls/textbox/textbox_watermark.png';
+import TextBoxMultilineScreenshot from '/img/controls/textbox/textbox_multiline.png';
+
The `TextBox` control is an editable text field where a user can input text.
## Reference
@@ -33,10 +38,7 @@ The `TextBox` control is an editable text field where a user can input text.
produces the following output in **Windows 10**
-
-
-
-
+
### Password input TextBox
@@ -56,9 +58,7 @@ produces the following output in **Windows 10**
produces the following output in **Windows 10** when text is input
-
-
-
+
When using the Fluent theme, you can apply the style class, `revealPasswordButton`, and the TextBox will provide an eye 👁 glyph for the user to show the plane text temporally. Please note, the `TextBox` may be written to but not copied from.
@@ -86,10 +86,7 @@ Avalonia can show a "watermark" in a `TextBox`, which is a piece of text that is
produces the following output in **Windows 10**
-
-
-
-
+
### Multiline TextBox
@@ -109,9 +106,7 @@ produces the following output in **Windows 10**
produces the following output in **Windows 10** when text is input
-
-
-
+
### TextInput Event Handling
diff --git a/versioned_docs/version-0.10.x/controls/timepicker.md b/versioned_docs/version-0.10.x/controls/timepicker.md
index 0b7d24fbe..2ef09e149 100644
--- a/versioned_docs/version-0.10.x/controls/timepicker.md
+++ b/versioned_docs/version-0.10.x/controls/timepicker.md
@@ -6,6 +6,11 @@ title: TimePicker
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import TimePickerSingleValueScreenshot from '/img/controls/timepicker/image (22) (1).png';
+import TimePickerClockIdentifierScreenshot from '/img/controls/timepicker/image (19).png';
+import TimePickerMinuteIncrementScreenshot from '/img/controls/timepicker/image (10).png';
+import TimePickerUnsetScreenshot from '/img/controls/timepicker/image (20).png';
+
The `TimePicker` control allows the user to pick a time value.
## Examples
@@ -39,9 +44,7 @@ TimePicker arrivalTimePicker = new TimePicker();
Use a `TimePicker` to let a user enter a single time value. You can customize the `DatePicker` to use a 12-hour or 24-hour clock.
-
-
-
+
## 12-hour and 24-hour clocks
@@ -52,10 +55,7 @@ By default, the time picker shows a 12-hour clock with an AM/PM selector. You ca
```
-
-
-
-
+
### Minute increment
@@ -65,9 +65,7 @@ You can set the [MinuteIncrement](https://docs.microsoft.com/en-us/uwp/api/windo
```
-
-
-
+
### Time values
@@ -75,9 +73,7 @@ The time picker control has both Time / TimeChanged and SelectedTime / SelectedT
The value of `SelectedTime` is used to populate the time picker and is `null` by default. If `SelectedTime` is `null`, the `Time` property is set to a [TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/system.timespan?view=dotnet-uwp-10.0\&preserve-view=true) of 0; otherwise, the `Time` value is synchronized with the `SelectedTime` value. When `SelectedTime` is `null`, the picker is 'unset' and shows the field names instead of a time.
-
-
-
+
**Initializing a time value**
diff --git a/versioned_docs/version-0.10.x/controls/transitioningcontentcontrol.md b/versioned_docs/version-0.10.x/controls/transitioningcontentcontrol.md
index 4793bca3f..eb531776b 100644
--- a/versioned_docs/version-0.10.x/controls/transitioningcontentcontrol.md
+++ b/versioned_docs/version-0.10.x/controls/transitioningcontentcontrol.md
@@ -3,6 +3,9 @@ id: transitioningcontentcontrol
title: TransitioningContentControl
---
+import TransitioningContentControlFadeScreenshot from '/img/controls/transitioningcontentcontrol/TransitioningContentControl_01.webp';
+import TransitioningContentControlSlideScreenshot from '/img/controls/transitioningcontentcontrol/TransitioningContentControl_02.webp';
+
## Common Properties
| Property | Description |
@@ -33,10 +36,7 @@ Let's assume we have a collection of different images and we want to show them i
```
-
-
-
-
+
## Changing the PageTransition
@@ -57,9 +57,7 @@ In the sample below we will change the [PageTransition](../animations/page-trans
```
-
-
-
+
## Disable the PageTransition
diff --git a/versioned_docs/version-0.10.x/controls/treedatagrid/creating-a-flat-treedatagrid.md.md b/versioned_docs/version-0.10.x/controls/treedatagrid/creating-a-flat-treedatagrid.md.md
index 2593e7f52..b7c11e015 100644
--- a/versioned_docs/version-0.10.x/controls/treedatagrid/creating-a-flat-treedatagrid.md.md
+++ b/versioned_docs/version-0.10.x/controls/treedatagrid/creating-a-flat-treedatagrid.md.md
@@ -3,6 +3,8 @@ id: creating-a-flat-treedatagrid
title: Creating a Flat TreeDataGrid
---
+import FlatTreeDataGridSourceScreenshot from '/img/controls/treedatagrid/get-started-flat-1.png';
+
There are two parts to any `TreeDataGrid`:
* The "Source" which is defined in code and describes how your data model will map to the rows and columns of the `TreeDataGrid`
@@ -98,6 +100,4 @@ It's now time to add the `TreeDataGrid` control to a window and bind it to the s
Run the application and you should see the data appear:
-
-
-
+
diff --git a/versioned_docs/version-0.10.x/controls/treedatagrid/creating-a-hierarchical-treedatagrid.md b/versioned_docs/version-0.10.x/controls/treedatagrid/creating-a-hierarchical-treedatagrid.md
index 3ea30ddb1..6a9a280a1 100644
--- a/versioned_docs/version-0.10.x/controls/treedatagrid/creating-a-hierarchical-treedatagrid.md
+++ b/versioned_docs/version-0.10.x/controls/treedatagrid/creating-a-hierarchical-treedatagrid.md
@@ -3,6 +3,8 @@ id: creating-a-hierarchical-treedatagrid
title: Creating a Hierarchical TreeDataGrid
---
+import HierarchicalTreeDataGridSourceScreenshot from '/img/controls/treedatagrid/get-started-hierarchical-1.png';
+
There are two parts to any `TreeDataGrid`:
* The "Source" which is defined in code and describes how your data model will map to the rows and columns of the `TreeDataGrid`
@@ -129,6 +131,4 @@ It's now time to add the `TreeDataGrid` control to a window and bind it to the s
Run the application and you should see the data appear:
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/versioned_docs/version-0.10.x/controls/treedatagrid/treedatagrid-column-types.md b/versioned_docs/version-0.10.x/controls/treedatagrid/treedatagrid-column-types.md
index d46695d49..07cb852b5 100644
--- a/versioned_docs/version-0.10.x/controls/treedatagrid/treedatagrid-column-types.md
+++ b/versioned_docs/version-0.10.x/controls/treedatagrid/treedatagrid-column-types.md
@@ -19,14 +19,11 @@ new TextColumn("First Name", x => x.FirstName)
The first generic parameter here is your model type basically, the place where you want to grab data from. Person in this case. The second generic parameter here is the type of the property where you want to grab data from. In this case, it is a string, it will be used to know exactly which type your property has.
-
-
-
-
+![](https://user-images.githubusercontent.com/53405089/157456551-dd394781-903a-4c7b-8874-e631e21534a1.png)
This is the signature of the `TextColumn` constructor. There are two most important parameters. The first one will be used to define the column header, usually, it would be a string. In the sample above it is _"First Name"_. The second parameter is an expression to get the value of the property. In the sample above it is _x => x.FirstName_.
-**Note**:\
+**Note**:
The sample above is taken from [this article](https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/blob/master/docs/get-started-flat.md). If you feel like you need more examples feel free to check it, there is a sample that shows how to use TextColumns and how to run a whole `TreeDataGrid` using them.
### HierarchicalExpanderColumn
@@ -41,15 +38,13 @@ new HierarchicalExpanderColumn(new TextColumn("First Nam
`HierarchicalExpanderColumn` has only one generic parameter, it is your model type, same as in `TextColumn`, Person in this case.
-Let's take a look at the `HierarchicalExpanderColumn` constructor.
+Let's take a look at the `HierarchicalExpanderColumn` constructor.
-
-
-
+![](https://user-images.githubusercontent.com/53405089/157536079-fd14f1ed-0a7d-438a-abba-fd56766709a9.png)
The first parameter in the constructor is a nested column, you would usually want to display something besides the expander and that's why you need this parameter. In the sample above, we want to display text and we use `TextColumn` for that. The second parameter is a selector of the child elements, stuff that will be displayed when `Expander` is in the expanded state below the parent element.
-**Note**:\
+**Note**:
The sample above is taken from [this article](https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid/blob/master/docs/get-started-hierarchical.md). If you feel like you need more examples feel free to check it, there is a sample that shows how to use `HierarchicalExpanderColumn` and how to run a whole `TreeDataGrid` using it.
### TemplateColumn
@@ -66,8 +61,6 @@ new TemplateColumn(
`TemplateColumn` has only one generic parameter, it is your model type, same as in `TextColumn`, Person in this case. Code above will create a column with header _"Selected"_ and `CheckBox` in each cell.
-
-
-
+![](https://user-images.githubusercontent.com/53405089/157664231-8653bce9-f8d6-4fbc-8e78-e3ff93f1ace2.png)
`TemplateColumn` has only two required parameters. The first one is the column header as everywhere. The second is `IDataTemplate` basically, a template that contains stuff that you want to be displayed in the cells of this column.
\ No newline at end of file
diff --git a/versioned_docs/version-0.10.x/controls/viewbox.md b/versioned_docs/version-0.10.x/controls/viewbox.md
index 29872697a..0137b6922 100644
--- a/versioned_docs/version-0.10.x/controls/viewbox.md
+++ b/versioned_docs/version-0.10.x/controls/viewbox.md
@@ -1,11 +1,19 @@
---
id: viewbox
-title: ViewBox
+title: Viewbox
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
+import ViewboxScaleUniformBothScreenshot from '/img/controls/viewbox/scale-uniform-both.gif';
+import ViewboxScaleUniformFillBothScreenshot from '/img/controls/viewbox/scale-uniformtofill-both.gif';
+import ViewboxScaleFillBothScreenshot from '/img/controls/viewbox/scale-fill-both.gif';
+import ViewboxScaleNoneBothScreenshot from '/img/controls/viewbox/scale-none-both.gif';
+
+import ViewboxScaleUniformUpOnlyScreenshot from '/img/controls/viewbox/scale-uniform-uponly.gif';
+import ViewboxScaleUniformDownOnlyScreenshot from '/img/controls/viewbox/scale-uniform-downonly.gif';
+
The `Viewbox` is a decorator control which scales its child. It can be used to scale its child to fit the available space.
The `Viewbox` gives its child infinite space in the measure phase. It will constrain either or both sides when arranging it. This depends on the value of the `Stretch`.
@@ -85,7 +93,7 @@ new Viewbox
-
+
@@ -95,7 +103,7 @@ new Viewbox
-
+
@@ -105,7 +113,7 @@ new Viewbox
-
+
@@ -115,7 +123,7 @@ new Viewbox
-
+
@@ -135,7 +143,7 @@ new Viewbox
Both
-
+
@@ -144,7 +152,7 @@ new Viewbox
-
+
@@ -154,7 +162,7 @@ new Viewbox
-
+
diff --git a/versioned_docs/version-0.10.x/data-binding/data-validation.md b/versioned_docs/version-0.10.x/data-binding/data-validation.md
index 550a80a7f..a5e0009a4 100644
--- a/versioned_docs/version-0.10.x/data-binding/data-validation.md
+++ b/versioned_docs/version-0.10.x/data-binding/data-validation.md
@@ -3,6 +3,8 @@ id: data-validation
title: Data Validation
---
+import CustomValidationTooltipScreenshot from '/img/data-binding/data-validation/CustomValidationTooltip.png';
+
Avalonia offers different data validation options. In this section we will show you how you can validate the `Properties` of your `ViewModel` and how you can style the displayed error message.
## Validating a property
@@ -122,10 +124,7 @@ To display the validation messages, Avalonia has a control called [`DataValidati
```
-
-
-
-
+
**Custom validation style**
diff --git a/versioned_docs/version-0.10.x/getting-started/developer-tools.md b/versioned_docs/version-0.10.x/getting-started/developer-tools.md
index 9ddfb1332..0729c042f 100644
--- a/versioned_docs/version-0.10.x/getting-started/developer-tools.md
+++ b/versioned_docs/version-0.10.x/getting-started/developer-tools.md
@@ -3,6 +3,16 @@ id: developer-tools
title: Developer Tools
---
+import DevToolsOverviewScreenshot from '/img/getting-started/developer-tools/image (23).png';
+import DevToolsPropertiesScreenshot from '/img/getting-started/developer-tools/image (26).png';
+import DevToolsLayoutScreenshot from '/img/getting-started/developer-tools/image (24) (1) (1).png';
+import DevToolsStylesScreenshot from '/img/getting-started/developer-tools/image (27).png';
+import DevToolsOverriddenStylesScreenshot from '/img/getting-started/developer-tools/image (28).png';
+import DevToolsSetterContextMenuScreenshot from '/img/getting-started/developer-tools/image (25).png';
+import DevToolsEventsScreenshot from '/img/getting-started/developer-tools/image (29).png';
+import DevToolsChangePropertyScreenshot from '/img/getting-started/developer-tools/devtools-change-property.gif';
+import DevToolsChangeLayoutScreenshot from '/img/getting-started/developer-tools/devtools-change-layout.gif';
+
# Developer Tools
Avalonia has an inbuilt DevTools window which is enabled by calling the attached `AttachDevTools()` method in a `Window` constructor. The default templates have this enabled when the program is compiled in `DEBUG` mode:
@@ -45,9 +55,7 @@ dotnet add package Avalonia.Diagnostics --version 0.10.0
:::
-
-
-
+
There is a known issue when running under .NET core 2.1 that pressing F12 will cause the program to quit. In this case, either switch to .NET core 2.0 or 3.0+ or change the open gesture to something different, such as `Ctrl+F12`.
@@ -66,9 +74,7 @@ Allows for quickly checking and editing properties of the control. One can also
| Type | Type of the current value |
| Priority | Priority of the value |
-
-
-
+
### Layout
@@ -79,9 +85,7 @@ Control size and size constraints are also shown.
If `Width` or `Height` are underlined that means there is an active constraint. Hover over the value to see a tooltip containing relevant information.
:::
-
-
-
+
### Styles
@@ -96,24 +100,18 @@ If setter value is bound to a resource it will be indicated by a circle followed
:::
-
-
-
+
:::info
If given value has a strikethrough it means that it is being overridden by a value in style with higher priority.
:::
-
-
-
+
Setters have a context menu that allows for quickly copying names and values to the clipboard.
-
-
-
+
## Events
@@ -126,9 +124,7 @@ Dotted underline under event name or control type indicates that quick navigatio
* Double clicking a control type (and/or name) will navigate to the visual tree tab and select said control.
:::
-
-
-
+
## Console
@@ -151,12 +147,8 @@ The console can be shown using the "View" → "Console" menu. The console implem
### Changing a property value
-
-
-
+
### Changing layout properties
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/versioned_docs/version-0.10.x/getting-started/ide-support.md b/versioned_docs/version-0.10.x/getting-started/ide-support.md
index 8a343bf83..90c9f16ca 100644
--- a/versioned_docs/version-0.10.x/getting-started/ide-support.md
+++ b/versioned_docs/version-0.10.x/getting-started/ide-support.md
@@ -2,6 +2,10 @@
id: ide-support
title: IDE Support
---
+
+import VsXamlPreviewerScreenshot from '/img/getting-started/vs-designer.png';
+import VsSelectProjectPreviewScreenshot from '/img/getting-started/VisualStudioPreviewer_SelectProjectForPreview.png';
+
## JetBrains Rider
The [JetBrains Rider](https://www.jetbrains.com/rider/) IDE has built-in support for Avalonia XAML [starting in 2020.3](https://www.jetbrains.com/rider/whatsnew/2020-3/#version-2020-3-avalonia-support) including first-class support for Avalonia-specific XAML features and custom code inspections.
@@ -24,9 +28,7 @@ If you're using VS2019 or VS2017 you need to install [the extension for older ve
For Visual Studio and ReSharper users, [ReSharper 2020.3 introduces](https://www.jetbrains.com/resharper/whatsnew/2020-3/#version-2020-3-avalonia-support) built-in code analysis, code completion, navigation, and find usages.
-
-
-
+
If your XAML is in a library, Avalonia needs an executable application in order to be able to preview it. Select an executable project from the dropdown on the top right of the designer. Once your project is built, editing the XAML in the editor will cause the preview to update automatically.
@@ -127,7 +129,4 @@ If your preview is not shown correctly try to (re-)build the project or solution
Moreover if you have more than one project in your solution, you may need to select the project which should be used to render the preview. This can be done with the drop-down shown below.
-
-
-
-
\ No newline at end of file
+
diff --git a/versioned_docs/version-0.10.x/getting-started/jetbrains-rider-setup.md b/versioned_docs/version-0.10.x/getting-started/jetbrains-rider-setup.md
index f462da4b8..7e4e00f0a 100644
--- a/versioned_docs/version-0.10.x/getting-started/jetbrains-rider-setup.md
+++ b/versioned_docs/version-0.10.x/getting-started/jetbrains-rider-setup.md
@@ -3,6 +3,10 @@ id: jetbrains-rider-setup
title: JetBrains Rider Setup
---
+ import RiderWelcomePluginsScreenshot from '/img/getting-started/jetbrains-rider-setup/jetbrains-rider-setup-1-rider-welcome.webp';
+ import RiderConfigurePluginsScreenshot from '/img/getting-started/jetbrains-rider-setup/rider-setup-2-configure-plugin-repos.webp';
+ import RiderPluginInstallScreenshot from '/img/getting-started/jetbrains-rider-setup/jetbrains-rider-setup-4-plugin-install.webp';
+
# JetBrains Rider Setup
1. Download and install the .NET SDK of your choice [Download .NET \(Linux, macOS, and Windows\) \(microsoft.com\)](https://dotnet.microsoft.com/download)
@@ -45,21 +49,14 @@ title: JetBrains Rider Setup
Once Rider loads you will see the Welcome Screen. Click the `Configure` dropdown and select `Plugins`.
-
-
-
+
A new Preferences Screen will open up. Click the `Settings` icon as shown and select `Manage Plugin Repositories...`
-
-
-
-
+
Now click on the `Marketplace` tab and search for `Avalonia`. Select `AvaloniaRider` and click `Install`; accept the warning about Third-Party Plugins; once that's done, click the `Restart IDE` button that appears.
-
-
-
+
Now Rider should be ready to develop Avalonia applications.
diff --git a/versioned_docs/version-0.10.x/guides/basics/code-behind.md b/versioned_docs/version-0.10.x/guides/basics/code-behind.md
index 33bfb872a..1b0b68df3 100644
--- a/versioned_docs/version-0.10.x/guides/basics/code-behind.md
+++ b/versioned_docs/version-0.10.x/guides/basics/code-behind.md
@@ -3,11 +3,11 @@ id: code-behind
title: Code Behind
---
+import VsCodeBehindScreenshot from '/img/guides/basics/code-behind/codebehind-vs.png';
+
[Window](../../controls/window) and [UserControl](../../controls/usercontrol) files also have an associated _code-behind_ file which usually has the extension `.xaml.cs` or `.axaml.cs` and may be displayed collapsed under the XAML file in your editor. Below you can see a `MainWindow.xaml` file along with its markdown file `MainWindow.xaml.cs` in Visual Studio:
-
-
-
+
The code-behind file by default defines a .NET class with the same name as your XAML file, e.g.
diff --git a/versioned_docs/version-0.10.x/guides/basics/mvvm.md b/versioned_docs/version-0.10.x/guides/basics/mvvm.md
index db1622680..c0591ddc7 100644
--- a/versioned_docs/version-0.10.x/guides/basics/mvvm.md
+++ b/versioned_docs/version-0.10.x/guides/basics/mvvm.md
@@ -3,6 +3,8 @@ id: mvvm
title: MVVM Architecture
---
+import MvvmArchitectureDiagram from '/img/guides/basics/mvvm/mvvm.png';
+
The Model-View-ViewModel pattern (MVVM) is a common way of structuring a UI application. It takes advantage of Avalonia's [binding](../../data-binding) system to separate the logic of the application from the display of the application.
MVVM might be overkill for a simple application, but as applications grow over time, they usually reach a point where tracking logic in [code-behind](code-behind) becomes problematic for two main reasons:
@@ -28,9 +30,7 @@ When we talk about the MVVM pattern, the most important parts are the **View** l
One way to imagine an MVVM application is to imagine these two layers as hovering over one another, connected by bindings:
-
-
-
+
The above example has, at the View layer:
diff --git a/versioned_docs/version-0.10.x/guides/deep-dives/reactiveui/routing.md b/versioned_docs/version-0.10.x/guides/deep-dives/reactiveui/routing.md
index f8d4054fc..8dfc52447 100644
--- a/versioned_docs/version-0.10.x/guides/deep-dives/reactiveui/routing.md
+++ b/versioned_docs/version-0.10.x/guides/deep-dives/reactiveui/routing.md
@@ -3,6 +3,8 @@ id: routing
title: Routing
---
+import ReactiveUIRoutingScreenshot from '/img/guides/deep-dives/reactiveui/routing/routing.gif';
+
[ReactiveUI routing](https://reactiveui.net/docs/handbook/routing/) consists of an [IScreen](https://reactiveui.net/api/reactiveui/iscreen/) that contains current [RoutingState](https://reactiveui.net/api/reactiveui/routingstate/), several [IRoutableViewModel](https://reactiveui.net/api/reactiveui/iroutableviewmodel/)s, and a platform-specific XAML control called [RoutedViewHost](https://github.com/AvaloniaUI/Avalonia/blob/55458cf7af24d6c987268ab5ff8a1ead1173310b/src/Avalonia.ReactiveUI/RoutedViewHost.cs). `RoutingState` manages the view model navigation stack and allows view models to navigate to other view models. `IScreen` is the root of a navigation stack; despite the name, its views don't have to occupy the whole screen. `RoutedViewHost` monitors an instance of `RoutingState`, responding to any changes in the navigation stack by creating and embedding the appropriate view.
## Routing Example
@@ -248,6 +250,4 @@ Now, you can run the app and see routing in action!
dotnet run --framework netcoreapp2.1
```
-
-
-
+
diff --git a/versioned_docs/version-0.10.x/guides/deep-dives/running-on-raspbian-lite-via-drm.md b/versioned_docs/version-0.10.x/guides/deep-dives/running-on-raspbian-lite-via-drm.md
index a0bad17f3..152dc82b4 100644
--- a/versioned_docs/version-0.10.x/guides/deep-dives/running-on-raspbian-lite-via-drm.md
+++ b/versioned_docs/version-0.10.x/guides/deep-dives/running-on-raspbian-lite-via-drm.md
@@ -3,6 +3,10 @@ id: running-on-raspbian-lite-via-drm
title: Running your Avalonia app on a Raspberry Pi with Raspbian Lite
---
+import RaspbianLiteDrmKmsCubeScreenshot from '/img/guides/deep-dives/running-on-raspbian-lite-via-drm/avalonia-raspbian-lite-drm-kmscube.gif';
+import RaspbianLiteDrmDesktopScreenshot from '/img/guides/deep-dives/running-on-raspbian-lite-via-drm/avalonia-raspbian-lite-drm-desktop.jpg';
+import RaspianLiteRaspberryScreenshot from '/img/guides/deep-dives/running-on-raspbian-lite-via-drm/avalonia-raspbian-lite-drm-run-on-raspberry.jpg';
+
# Running your Avalonia app on a Raspberry Pi with Raspbian Lite
This tutorial shows you how to run your Avalonia app on a Raspberry Pi with Raspbian Lite
@@ -69,9 +73,7 @@ sudo kmscube
````
You should see the spinning cube on your Raspberry pi screen now:
-
-
-
+
### Step 2 - Prepare Avalonia App
@@ -193,9 +195,7 @@ public override void OnFrameworkInitializationCompleted()
Now you can run/debug your app on desktop as usual.
When you start your app you should see this:
-
-
-
+
### Step 3 - Deploy and run on Raspberry
@@ -221,8 +221,6 @@ sudo ./path/to/app/AvaloniaRaspbianLiteDrm --drm
You should see the app running on your Raspberry Pi now:
-
-
-
+
If you have a touch display installed, try to slide the slider control :)
\ No newline at end of file
diff --git a/versioned_docs/version-0.10.x/guides/developer-guides/debugging-previewer.md b/versioned_docs/version-0.10.x/guides/developer-guides/debugging-previewer.md
index 36a313b67..9d78c14fa 100644
--- a/versioned_docs/version-0.10.x/guides/developer-guides/debugging-previewer.md
+++ b/versioned_docs/version-0.10.x/guides/developer-guides/debugging-previewer.md
@@ -3,6 +3,8 @@ id: debugging-previewer
title: Debugging Previewer
---
+import VsAttachDebuggerScreenshot from '/img/guides/developer-guides/debugging-previewer/132686320-958f30a6-49f8-498f-853c-b9dd17262b54.png';
+
By default, even if you would put a breakpoint in Avalonia main repo directly it would not be hit when Previewer executes this code. This is because Previewer is a completely different process usually run by IDE.
**Debugging with JetBrains Rider**
@@ -39,12 +41,10 @@ while (!Debugger.IsAttached)
This code will attach debugger to the previewer programmatically.
-But if you need to place breakpoints in the previewer code you may need to use [dnSpy](https://github.com/dnSpy/dnSpy) or something similar because Visual Studio doesen't support that.
+But if you need to place breakpoints in the previewer code you may need to use [dnSpy](https://github.com/dnSpy/dnSpy) or something similar because Visual Studio doesn't support that.
**How would I understand that I have launched a debugger?**
You should see a window like this.
-
-
-
+
diff --git a/versioned_docs/version-0.10.x/guides/developer-guides/debugging-xamlil.md b/versioned_docs/version-0.10.x/guides/developer-guides/debugging-xamlil.md
index 43e3a3fec..9f3ac7280 100644
--- a/versioned_docs/version-0.10.x/guides/developer-guides/debugging-xamlil.md
+++ b/versioned_docs/version-0.10.x/guides/developer-guides/debugging-xamlil.md
@@ -3,7 +3,9 @@ id: debugging-xamlil
title: Debugging the XAML compiler
---
-You can debug the XAML compiler adding at your's csproj AvaloniaXamlIlDebuggerLaunch property like this:
+import VsAttachDebuggerScreenshot from '/img/guides/developer-guides/debugging-xamlil/132686320-958f30a6-49f8-498f-853c-b9dd17262b54.png';
+
+You can debug the XAML compiler by adding the `AvaloniaXamlIlDebuggerLaunch` property to your .csproj like this:
```xml
@@ -16,8 +18,6 @@ You can debug the XAML compiler adding at your's csproj AvaloniaXamlIlDebuggerLa
If build the project in Visual Studio you should see a window like this:
-
-
-
+
-on other IDEs, a message will appear in the build output window indicating the PID of the process to attach the debugger to and the elapsed time. If within one minute of starting the build no debugger is attacked to the process, a timeout message will be reported and the build will continue as normal.
\ No newline at end of file
+On other IDEs, a message will appear in the build output window indicating the PID of the process to attach the debugger to and the elapsed time. If within one minute of starting the build no debugger is attacked to the process, a timeout message will be reported and the build will continue as normal.
\ No newline at end of file
diff --git a/versioned_docs/version-0.10.x/guides/developer-guides/maintaining-stable-branch-pr-merge-process.md b/versioned_docs/version-0.10.x/guides/developer-guides/maintaining-stable-branch-pr-merge-process.md
index 84690649b..39b00d35a 100644
--- a/versioned_docs/version-0.10.x/guides/developer-guides/maintaining-stable-branch-pr-merge-process.md
+++ b/versioned_docs/version-0.10.x/guides/developer-guides/maintaining-stable-branch-pr-merge-process.md
@@ -3,6 +3,9 @@ id: maintaining-stable-branch-pr-merge-process
title: Maintaining Stable Branch
---
+import NewFeatureMasterMergeScreenshot from '/img/guides/developer-guides/maintaining-stable-branch-pr-merge-process/image (6).png';
+import NewFeatureBackportScreenshot from '/img/guides/developer-guides/maintaining-stable-branch-pr-merge-process/image (13).png';
+
:::warning
This Process MUST be followed during any period that `master` branch is allowing breaking changes.
:::
@@ -24,9 +27,7 @@ Provided the criteria are met:
At this point the git tree should look similar to this.
-
-
-
+
Now we need to get the new PR merged into the stable branch.
@@ -39,8 +40,6 @@ Pay careful attention here, we don't just merge into the stable branch!
The git tree should look like this now.
-
-
-
+
-Please also use the `backport-candidate` and `backported 0.10.x` labels on the PRs themselves.
\ No newline at end of file
+Please also use the `backport-candidate` and `backported 0.10.x` labels on the PRs themselves.
diff --git a/versioned_docs/version-0.10.x/guides/developer-guides/release-process.md b/versioned_docs/version-0.10.x/guides/developer-guides/release-process.md
index a09fe799a..ff90ee1a3 100644
--- a/versioned_docs/version-0.10.x/guides/developer-guides/release-process.md
+++ b/versioned_docs/version-0.10.x/guides/developer-guides/release-process.md
@@ -3,6 +3,12 @@ id: release-process
title: Release Process
---
+import ReleaseGitTreeScreenshot from '/img/guides/developer-guides/release-process/image (4).png';
+import ReleasePipelineScreenshot from '/img/guides/developer-guides/release-process/image (1).png';
+import ReleaseBranchScreenshot from '/img/guides/developer-guides/release-process/image (11).png';
+import ReleaseNugetBadgeScreenshot from '/img/guides/developer-guides/release-process/image (17) (1) (1) (1).png';
+import ReleaseDeployScreenshot from '/img/guides/developer-guides/release-process/image (16).png';
+
* Create a branch named `release/0.10.2` for example. This branch should be level with the `master` commit that the release will be based on.
* Update the version number in the file `SharedVersion.props` i.e. `0.10.2`.
* Push the release branch.
@@ -11,10 +17,7 @@ If this is the first release of a major version change, i.e. `0.9.0` or `0.10.0`
The git tree should now look like this:
-
-
-
-
+
* Now login at `dev.azure.com` to access the azure pipelines. Wait for the CI to finish the build.
* The package for `0.10.2` should now be on the `avalonia-all` nuget feed. You should run a due diligence test on this build to ensure you are happy with the release and the packages work.
@@ -25,25 +28,17 @@ Don't assume the Nuget packages will work just because master was working. In th
* Now click on "Releases" and select "Avalonia (master / release)" pipeline as shown below.
-
-
-
+
* On the release for your release branch `release/0.10.2` click on the badge for "Nuget Release"
-
-
-
+
-
-
-
+
* Then click on `Deploy`.
-
-
-
+
:::info
At this point the packages will deploy to Nuget, it can take between 10 and 20 minutes for them to be indexed and publicly available. [https://www.nuget.org/packages/Avalonia/](https://www.nuget.org/packages/Avalonia/)
diff --git a/versioned_docs/version-0.10.x/input/routed-events.md b/versioned_docs/version-0.10.x/input/routed-events.md
index 34fe929b3..979a1e4bc 100644
--- a/versioned_docs/version-0.10.x/input/routed-events.md
+++ b/versioned_docs/version-0.10.x/input/routed-events.md
@@ -3,6 +3,8 @@ id: routed-events
title: Routed Events
---
+import InputEventRoutingScreenshot from '/img/input/routed-events/input-event-routing.png';
+
Most events in Avalonia are implemented as Routed Events. Routed events are events that are raised on the whole tree rather than just the control that raised the event.
## What Is a Routed Event
@@ -220,10 +222,7 @@ Avalonia input events that come in pairs are implemented so that a single user a
As an illustration of how input event processing works, consider the following input event example. In the following tree illustration, `leaf element #2` is the source of a `PointerPressed` event:
-
-
-
-
+
The order of event processing is as follows:
diff --git a/versioned_docs/version-0.10.x/layout/alignment-margins-and-padding.md b/versioned_docs/version-0.10.x/layout/alignment-margins-and-padding.md
index 55628c326..d7c1631a2 100644
--- a/versioned_docs/version-0.10.x/layout/alignment-margins-and-padding.md
+++ b/versioned_docs/version-0.10.x/layout/alignment-margins-and-padding.md
@@ -3,6 +3,12 @@ id: alignment-margins-and-padding
title: Alignment, Margins and Padding
---
+import LayoutMarginsPaddingAlignmentBasicScreenshot from '/img/layout/alignment-margins-and-padding/layout-margins-padding-alignment-graphic1.png';
+import LayoutMarginsPaddingAlignmentBasicAnnotatedScreenshot from '/img/layout/alignment-margins-and-padding/layout-margins-padding-alignment-graphic2.png';
+import LayoutHorizontalAlignmentScreenshot from '/img/layout/alignment-margins-and-padding/layout-horizontal-alignment-graphic.png';
+import LayoutVerticalAlignmentScreenshot from '/img/layout/alignment-margins-and-padding/layout-vertical-alignment-graphic.png';
+import LayoutMarginsPaddingAlignmentComplexAnnotatedScreenshot from '/img/layout/alignment-margins-and-padding/layout-margins-padding-aligment-graphic3.png';
+
An Avalonia control exposes several properties that are used to precisely position child elements. This topic discusses four of the most important properties: `HorizontalAlignment`, `Margin`, `Padding`, and `VerticalAlignment`. The effects of these properties are important to understand, because they provide the basis for controlling the position of elements in Avalonia applications.
### Introduction to Element Positioning
@@ -11,9 +17,7 @@ There are numerous ways to position elements using Avalonia. However, achieving
The following illustration shows a layout scenario that utilizes several positioning properties.
-
-
-
+
At first glance, the `Button` elements in this illustration may appear to be placed randomly. However, their positions are actually precisely controlled by using a combination of margins, alignments, and padding.
@@ -47,9 +51,7 @@ The following example describes how to create the layout in the preceding illust
The following diagram provides a close-up view of the various positioning properties that are used in the preceding sample. Subsequent sections in this topic describe in greater detail how to use each positioning property.
-
-
-
+
### Understanding Alignment Properties
@@ -79,9 +81,7 @@ The following example shows how to apply the `HorizontalAlignment` property to `
The preceding code yields a layout similar to the following image. The positioning effects of each `HorizontalAlignment` value are visible in the illustration.
-
-
-
+
#### VerticalAlignment Property
@@ -121,9 +121,7 @@ The following example shows how to apply the `VerticalAlignment` property to `Bu
The preceding code yields a layout similar to the following image. The positioning effects of each `VerticalAlignment` value are visible in the illustration.
-
-
-
+
### Understanding Margin Properties
@@ -231,6 +229,4 @@ The following example demonstrates each of the concepts that are detailed in thi
When compiled, the preceding application yields a UI that looks like the following illustration. The effects of the various property values are evident in the spacing between elements, and significant property values for elements in each column are shown within `TextBlock` elements.
-
-
-
\ No newline at end of file
+
diff --git a/versioned_docs/version-0.10.x/styling/troubleshooting.md b/versioned_docs/version-0.10.x/styling/troubleshooting.md
index 109ef2743..5db2ddce7 100644
--- a/versioned_docs/version-0.10.x/styling/troubleshooting.md
+++ b/versioned_docs/version-0.10.x/styling/troubleshooting.md
@@ -85,7 +85,7 @@ The following code example of styles that can be expected to work on top of defa
-
```
diff --git a/versioned_docs/version-0.10.x/templates/data-templates.md b/versioned_docs/version-0.10.x/templates/data-templates.md
index dc1ed9b48..bb7fa48b0 100644
--- a/versioned_docs/version-0.10.x/templates/data-templates.md
+++ b/versioned_docs/version-0.10.x/templates/data-templates.md
@@ -3,6 +3,11 @@ id: data-templates
title: Data Templates
---
+import ControlContentButtonScreenshot from '/img/templates/data-templates/hello-world-button.png';
+import ControlContentStringScreenshot from '/img/templates/data-templates/hello-world-string.png';
+import ControlContentStudentNoTemplateScreenshot from '/img/templates/data-templates/student-no-datatemplate.png';
+import ControlContentStudentScreenshot from '/img/templates/data-templates/student-first-last-name (1) (1) (1) (1) (1).png';
+
Many controls have a `Content` property, such as [`ContentControl.Content`](http://reference.avaloniaui.net/api/Avalonia.Controls/ContentControl/4B02A756). `Window` inherits from [`ContentControl`](../controls/contentcontrol), so lets use that as an example. You're probably familiar with what happens when you put a control in the `Window.Content` property - the window displays the control:
```markup
@@ -15,10 +20,7 @@ Many controls have a `Content` property, such as [`ContentControl.Content`](http
```
-
-
-
-
+
Similarly if you put a string as the window content, the window will display the string:
@@ -29,9 +31,7 @@ Similarly if you put a string as the window content, the window will display the
```
-
-
-
+
But what happens if you try to display an object as the window content?
@@ -60,9 +60,7 @@ namespace Example
```
-
-
-
+
Not very helpful. That's because Avalonia doesn't know _how_ to display an object of type `Student` - because it's not a control it falls back to just calling `.ToString()` on the object. We can tell Avalonia how to display non-control objects by defining a data template.
@@ -89,10 +87,7 @@ The easiest way to do this on `Window` (and any control that inherits from `Cont
```
-
-
-
-
+
The data template for the window content doesn't only come from the `ContentTemplate` property. Every control also has a `DataTemplates` collection into which any number of data templates can be placed. If a control doesn't have a template set locally (e.g. in `ContentTemplate`) then it will look in its `DataTemplates` collection for a matching template. If a match isn't found there it will then go on to search its parent's `DataTemplates`, then its grandparent's, and so on until it reaches the `Window`. If it _still_ hasn't found a match it will then look in `App.xaml`/`App.axaml` for a matching `DataTemplate` and finally when all those options have been exhausted it will simply call `.ToString()` on the object.
diff --git a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/android/build-and-run-your-application-on-a-simulator.md b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/android/build-and-run-your-application-on-a-simulator.md
index e39f4c946..5d95dd9f4 100644
--- a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/android/build-and-run-your-application-on-a-simulator.md
+++ b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/android/build-and-run-your-application-on-a-simulator.md
@@ -5,7 +5,7 @@ title: Build and run your Application on a Simulator
Please ensure you have followed the guide [create-a-cross-platform-solution.md](../create-a-cross-platform-solution.md "mention").
-Assuming you have created a project called `HelloWord`. Enter the directory `HelloWorld.Android` from the command line.
+Assuming you have created a project called `HelloWorld`. Enter the directory `HelloWorld.Android` from the command line.
To build the project for Android run the following command.
diff --git a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/android/setting-up-your-developer-environment-for-android.md b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/android/setting-up-your-developer-environment-for-android.md
index 57b04dcdd..4ca93bcfb 100644
--- a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/android/setting-up-your-developer-environment-for-android.md
+++ b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/android/setting-up-your-developer-environment-for-android.md
@@ -14,8 +14,8 @@ dotnet workload install android
```
:::info
-You may need to run the command with `sudo`\
-\
+You may need to run the command with `sudo`
+
You may also need to uninstall old versions. `dotnet workload remove android`
:::
diff --git a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator.md b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator.md
index 856c10bd1..51958852c 100644
--- a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator.md
+++ b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator.md
@@ -3,9 +3,11 @@ info: build-and-run-your-application-on-a-simulator
title: Build and run your application on a Simulator
---
+import SimulatoriPadScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-a-simulator/image (34).png';
+
Please ensure you have followed the guide [create-a-cross-platform-solution.md](../create-a-cross-platform-solution.md "mention").
-Assuming you have created a project called `HelloWord`. Enter the directory `HelloWorld.iOS` from the command line.
+Assuming you have created a project called `HelloWorld`. Enter the directory `HelloWorld.iOS` from the command line.
To build the project for iOS run the following command.
@@ -19,8 +21,6 @@ To run the project in a simulator, run the following command.
dotnet run
```
-
-
-
+
If you use `JetBrains Rider` or `Visual Studio for Mac` you can open the solution and run, build and debug your program inside the simulator.
\ No newline at end of file
diff --git a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad.md b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad.md
index 8ddfd7cd8..23d0a2c08 100644
--- a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad.md
+++ b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad.md
@@ -3,72 +3,65 @@ info: build-and-run-your-application-on-your-iphone-or-ipad
title: Build and Run your Application on your iPhone or iPad
---
+import BuildiOSOpenXcodeScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/Screenshot 2022-03-17 at 12.09.54.png';
+import BuildiOSCreateXcodeProjectScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (36).png';
+import BuildiOSSelectProjectOptionsScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (30).png';
+import BuildiOSSelectAnyDeviceScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (35).png';
+import BuildiOSAddAdditionalSimulatorsScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (32).png';
+import BuildiOSProvisionPhoneScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/Screenshot 2022-03-17 at 12.19.06.png';
+import BuildiOSSelectDeviceScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (24).png';
+import BuildiOSChangeBundleIdentifierScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (18).png';
+import BuildiOSCertScreenshot from '/img/tutorials/developing-for-mobile/ios/build-and-run-your-application-on-your-iphone-or-ipad/image (33).png';
+
In order to allow dotnet to sideload your application to your iphone or ipad you must first use Xcode to provision your device.
Before continuing follow this guide to create a free Apple developer signing certificate.
-[Free Provisiong for Xamarin.iOS Applications](https://docs.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/free-provisioning)
+[Free Provisioning for Xamarin.iOS Applications](https://docs.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/free-provisioning)
This has to be done by creating an Xcode app project that has the same `bundle identifier` that you will use in your application.
1. Open Xcode
-
-
-
-
+
-2\. Select Create a new Xcode project
+2. Select Create a new Xcode project
-
-
-
+
-3\. Select iOS and App and click Next.
+3. Select iOS and App and click Next.
-
-
-
+
-4\. Type in a name for your project and Organisation. Keep all the rest of the information the same.
+4. Type in a name for your project and Organisation. Keep all the rest of the information the same.
-5\. Choose a directory to save the project. You will not need to keep the project so don't worry too much about where.
+5. Choose a directory to save the project. You will not need to keep the project so don't worry too much about where.
-6\. In the status bar at the top click on the "Any device (arm64)"
+6. In the status bar at the top click on the "Any device (arm64)"
-
-
-
+
-7\. At the bottom of the list click "Add Additional Simulators..."
+7. At the bottom of the list click "Add Additional Simulators..."
-
-
-
+
-8\. Click on devices and connect your iPhone or iPad with the USB cable. Xcode will start to provision your phone for development.
+8. Click on devices and connect your iPhone or iPad with the USB cable. Xcode will start to provision your phone for development.
-
-
-
+
-9\. Select you iPhone or iPad from the device list.
+9. Select you iPhone or iPad from the device list.
-
-
-
+
-10\. Click the play button and the app will be installed and run on your phone.
+10. Click the play button and the app will be installed and run on your phone.
If successful you may return to your IDE of choice and open the `info.plist` file from the iOS project.
-11\. Change the bundle identifier to the same as the one you choose in Xcode in step 3.
+11. Change the bundle identifier to the same as the one you choose in Xcode in step 3.
-
-
-
+
-12\. Now edit the `.iOS.csproj` file.
+12. Now edit the `.iOS.csproj` file.
```xml
ios-arm64
@@ -85,9 +78,7 @@ Add a `` tag.
To find the value for this open the application `KeyChain Access`. In the search box search for development.
-
-
-
+
Set the value exactly as the bold text at the top of the window on your selected development certificate.
diff --git a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/setting-up-your-developer-environment-for-ios.md b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/setting-up-your-developer-environment-for-ios.md
index 5629430b6..5a3534715 100644
--- a/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/setting-up-your-developer-environment-for-ios.md
+++ b/versioned_docs/version-0.10.x/tutorials/developing-for-mobile/ios/setting-up-your-developer-environment-for-ios.md
@@ -18,8 +18,8 @@ dotnet workload install ios
```
:::info
-You may need to run the command with `sudo`\
-\
+You may need to run the command with `sudo`
+
You may also need to uninstall old versions. `dotnet workload remove ios`
:::
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/add-and-layout-controls.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/add-and-layout-controls.md
index 2322210c6..ed4885fd5 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/add-and-layout-controls.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/add-and-layout-controls.md
@@ -3,6 +3,10 @@ id: add-and-layout-controls
title: Add and Layout Controls
---
+import MusicStoreBuyButtonScreenshot from '/img/tutorials/music-store-app/add-and-layout-controls/buy-button.png';
+import MusicStoreAddStylesScreenshot from '/img/tutorials/music-store-app/add-and-layout-controls/add-styles.png';
+import MusicStorePrettyButtonScreenshot from '/img/tutorials/music-store-app/add-and-layout-controls/pretty-button.png';
+
## Add and Layout some Controls
Let's start by adding a `Button` to the `MainWindow`. The button will allow the `user` to purchase music in order to add to their collection.
@@ -60,9 +64,7 @@ public class MainWindowViewModel : ViewModelBase
Pressing the `Debug Button` again to run the program we can see we have a button and when clicked setting a breakpoint inside the `BuyMusicCommand` code we can see that the code is executed when it's hit.
-
-
-
+
Let's position the button to the top right of the screen and make it look a bit nicer.
@@ -94,9 +96,7 @@ Let's create a file just for Icons.
In Rider right click on the project and select `Add` → `Avalonia Styles`
-
-
-
+
Enter the name `Icons` when prompted and press `Enter`.
@@ -156,6 +156,4 @@ Return to `MainWindow.axaml`, we can add the Icon to the Button like so...
Running the application we now have a nice button.
-
-
-
\ No newline at end of file
+
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/add-content-to-dialog.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/add-content-to-dialog.md
index 13ebde540..d1d4fb6dd 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/add-content-to-dialog.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/add-content-to-dialog.md
@@ -3,6 +3,10 @@ id: add-content-to-dialog
title: Add Content to Dialog
---
+import MusicStoreMockSearchScreenshot from '/img/tutorials/music-store-app/add-content-to-dialog/text-list.png';
+import MusicStoreBeforeWrapPanelScreenshot from '/img/tutorials/music-store-app/add-content-to-dialog/image-20210310010932979.png';
+import MusicStoreWrapPanelScreenshot from '/img/tutorials/music-store-app/add-content-to-dialog/image-20210310011526700.png';
+
## Adding Content to the Dialog
Inside the dialog we would like the user to search for albums, and then select an album to buy.
@@ -275,10 +279,7 @@ Your `MusicStoreWindow.axaml` should look like this.
Run the application:
-
-
-
-
+
Our items are showing in the List... but not very visual.
@@ -333,9 +334,7 @@ We shall come back to the `Bindings` in a moment, for now lets run the applicati
As can be seen the albums are displayed vertically. However it would be nice to have them horizontally and wrap around.
-
-
-
+
Luckily `ListBox` provides a solution to this with something called `ItemsPanelTemplate`. By default the `ListBox` has its `ItemPanel` property set to an `ItemsPanelTemplate` which contains a `StackPanel`, we can change this to a `WrapPanel` like so.
@@ -351,9 +350,7 @@ Luckily `ListBox` provides a solution to this with something called `ItemsPanelT
Now when we run the application we get:
-
-
-
+
As our list gets more items, that will wrap around onto the next line, and the user will be able to scroll.
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/add-items-to-users-collection.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/add-items-to-users-collection.md
index 23ce7a6ab..83df24ebd 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/add-items-to-users-collection.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/add-items-to-users-collection.md
@@ -3,6 +3,8 @@ id: add-items-to-users-collection
title: Add Items to User Collection
---
+import MusicStoreAddedAlbumsScreenshot from '/img/tutorials/music-store-app/add-items-to-users-collection/image-20210310175949319.png';
+
## Adding Albums to the Users Collection
Ok so now the user can find albums to purchase, it would be nice if the user could see which albums are in their collection. To do this we can add a similar UI to the MainWindow.
@@ -112,8 +114,6 @@ Notice we check the result for `null`, this is because the `user` may have cance
Lets run the program and see if it works.
-
-
-
+
For the finishing touch we simply need to add persistence to the application.
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/creating-a-modern-looking-window.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/creating-a-modern-looking-window.md
index 9d8d85c8f..e365f2484 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/creating-a-modern-looking-window.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/creating-a-modern-looking-window.md
@@ -3,6 +3,10 @@ info: creating-a-modern-looking-window
title: Creating a Modern looking Window
---
+import MusicStoreDarkModePreviewScreenshot from '/img/tutorials/music-store-app/creating-a-modern-looking-window/dark-mode-preview.png';
+import MusicStoreAcrylicMaterialScreenshot from '/img/tutorials/music-store-app/creating-a-modern-looking-window/acrylic-material.png';
+import MusicStoreFullAcrylicWindowScreenshot from '/img/tutorials/music-store-app/creating-a-modern-looking-window/full-acrylic-window.png';
+
## Use Dark Mode and Add a little Acrylic
Let's try and make this look a little more modern by applying `Dark` mode and some `Acrylic` styling to the Window.
@@ -30,9 +34,7 @@ Let's try and make this look a little more modern by applying `Dark` mode and so
The previewer knows about changes you make to the file your editing, but it doesn't know about changes in other files. This is why you need to build the project if another file was changed.
-
-
-
+
1. After where it says `Title="Avalonia.MusicStore"` add the following code:
@@ -90,11 +92,9 @@ Now click the `Debug` `Button` to run the application again.
Notice we have a nice acrylic window effect. Shame about the titlebar, though. Let's see how we can make that blend in a bit more.
-
-
-
+
-\*Note, Linux users can not yet take advantage of this due to limitations of X11. The code will run and the window will still work on Linux, but the full effect will not be realised.
+*Note, Linux users can not yet take advantage of this due to limitations of X11. The code will run and the window will still work on Linux, but the full effect will not be realised.
1. It is possible to have Avalonia render into the `titlebar`, allowing us to create a more blended look. Modern web browsers tend to render tabs into the titlebar with this technique.
@@ -120,9 +120,6 @@ Notice we have a nice acrylic window effect. Shame about the titlebar, though. L
Press the `Debug` button again to run.
-
-
-
-
+
Perfect, a modern looking Window, Avalonia is able to render every pixel.
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/creating-the-project.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/creating-the-project.md
index 8f40bcf7d..92d67f8fe 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/creating-the-project.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/creating-the-project.md
@@ -3,6 +3,11 @@ id: creating-the-project
title: Create the Project
---
+import MusicStoreCreateSolutionScreenshot from '/img/tutorials/music-store-app/creating-the-project/CreateSolution.png';
+import MusicStoreProjectStructureScreenshot from '/img/tutorials/music-store-app/creating-the-project/project-structure.png';
+import MusicStoreRiderDebugButtonScreenshot from '/img/tutorials/music-store-app/creating-the-project/debug-button.png';
+import MusicStoreNewAppScreenshot from '/img/tutorials/music-store-app/creating-the-project/image-20210310192926578.png';
+
### Creating a New Project
From the Rider Welcome Screen, click on `New Solution`. This will open a dialog with Project Types on the left and some input fields on the right.
@@ -11,15 +16,11 @@ At the bottom on the left hand side under the heading `Other` you will see `Aval
Click the `Create` button.
-
-
-
+
A new project will be created with the following structure.
-
-
-
+
The folders are:
@@ -45,14 +46,10 @@ Some of the important files are:
Press the debug button top right of the IDE to compile and run the project.
-
-
-
+
This will show a Window that looks like:
-
-
-
+
A little plain but we now have a running application, and a blank canvas to start from.
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/displaying-images.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/displaying-images.md
index a1e7e32e8..dcc33f1bf 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/displaying-images.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/displaying-images.md
@@ -3,6 +3,8 @@ info: displaying-images
title: Displaying Images
---
+import MusicStoreDisplayingImagesScreenshot from '/img/tutorials/music-store-app/displaying-images/image-20210310173858088.png';
+
## Displaying Album Cover Images
So we have the Albums showing with the Artist name and Title, however, if we can download the Album art and display it, this will really bring the app alive.
@@ -162,6 +164,4 @@ Now run the application and search for your favourite artist.
Notice how the Albums covers load one by one, but that the UI remains responsive.
-
-
-
\ No newline at end of file
+
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/index.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/index.md
index 7dc804baf..7eedb0d9e 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/index.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/index.md
@@ -1,5 +1,8 @@
# Music Store App
+import MusicStoreFinishedAppScreenshot from '/img/tutorials/music-store-app/image-20210310184538120.png';
+import MusicStoreMvvmDiagram from '/img/tutorials/music-store-app/mvvm.png';
+
:::info
The completed project can be found at [https://github.com/AvaloniaUI/Avalonia.MusicStore](https://github.com/AvaloniaUI/Avalonia.MusicStore).
@@ -12,10 +15,7 @@ This guide has instructions for Rider on macOS, however the steps will be almost
Our livestream assumes some knowledge of [XAML](../../guides/basics/introduction-to-xaml.md), [MVVM ](../../guides/basics/mvvm.md)development, however this guide should fill in the gaps for beginners.
-
-
-
-
+
## A little background to Avalonia
@@ -39,9 +39,7 @@ MVVM is simply a way to enforce [Separation of concerns](https://en.wikipedia.or
Following the MVVM approach will alleviate these difficulties and help keep your UI code scalable.
-
-
-
+
**How does MVVM work?**
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/load-data-at-startup.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/load-data-at-startup.md
index 9e8e3fcaf..d145a5746 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/load-data-at-startup.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/load-data-at-startup.md
@@ -3,6 +3,8 @@ info: load-data-at-startup
title: Load data at Startup
---
+import MusicStoreLoadedDataStartScreenshot from '/img/tutorials/music-store-app/load-data-at-startup/image-20210310184202271.png';
+
## Loading Albums on Startup
Our backend code provides a nice way to load the users collection from disk.
@@ -38,6 +40,4 @@ As you can see it firstly uses the business logic apis to load the list of `Albu
Note we then re-iterate over the `Albums` and asynchronously load each cover. Note that we do this after adding all the albums to the list, as its more important to quickly show the user all the albums available and then load the images.
-
-
-
\ No newline at end of file
+
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/opening-a-dialog.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/opening-a-dialog.md
index 2730f6567..8a8b60a00 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/opening-a-dialog.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/opening-a-dialog.md
@@ -3,6 +3,9 @@ id: opening-a-dialog
title: Opening a Dialog
---
+import MusicStoreAddWindowScreenshot from '/img/tutorials/music-store-app/opening-a-dialog/add-window.png';
+import MusicStoreDialogOpenedScreenshot from '/img/tutorials/music-store-app/opening-a-dialog/dialog-opened.png';
+
## Opening a Dialog
Opening a dialog is an advanced topic, if you are very new to Avalonia, try not to get too stuck on this section, you may want to just copy in the code and move on. Then come back once you have a better understanding of some of the basics.
@@ -13,9 +16,7 @@ First we need to add a Window to the project, right click on the `Views` folder
When prompted name this MusicStoreWindow and press the `Enter` key.
-
-
-
+
This will add the following code:
@@ -196,8 +197,6 @@ Also set `Width` and `Height` properties of the `MusicStoreWindows` `` e
Now run the application and click the Store button.
-
-
-
+
As you can see the dialog window is opened perfectly centered inside the MainWindow.
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/searching-for-albums.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/searching-for-albums.md
index 88923c2b3..91b24e8d1 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/searching-for-albums.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/searching-for-albums.md
@@ -3,6 +3,9 @@ info: searching-for-albums
title: Searching for Albums
---
+import MusicStoreiTunesSearchNugetScreenshot from '/img/tutorials/music-store-app/searching-for-albums/image-20210310013703557.png';
+import MusicStoreAlbumViewScreenshot from '/img/tutorials/music-store-app/searching-for-albums/image-20210310110401944.png';
+
## Searching For Albums
In order for our application to work we are going to need some business logic. This code is not relevant to the tutorial, except for the fact that it will provide the following services:
@@ -19,9 +22,7 @@ This will open the `Packages` tool at the bottom of the IDE, like so.
Search for `ItunesSearch` and press the green `+` button on the right hand side to install it.
-
-
-
+
1. In the `Models` folder add a new class called `Album` and paste in the following code.
@@ -211,6 +212,4 @@ SearchResults.Add(new AlbumViewModel());
Now run the application and click the store button, then search for an artist or album name. If all has gone to plan you should see the progressbar animating whilst the server is busy processing the request and then you should see some results appear in the list.
-
-
-
+
diff --git a/versioned_docs/version-0.10.x/tutorials/music-store-app/setup-development-environment.md b/versioned_docs/version-0.10.x/tutorials/music-store-app/setup-development-environment.md
index 15b31b7f9..e3bcf78f8 100644
--- a/versioned_docs/version-0.10.x/tutorials/music-store-app/setup-development-environment.md
+++ b/versioned_docs/version-0.10.x/tutorials/music-store-app/setup-development-environment.md
@@ -3,6 +3,11 @@ id: setup-development-environment
title: Setup Development Environment
---
+import MusicStoreRiderWelcomeScreenshot from '/img/tutorials/music-store-app/setup-development-environment/rider-welcome.png';
+import MusicStoreConfigurePluginReposScreenshot from '/img/tutorials/music-store-app/setup-development-environment/configure-plugin-repos.png';
+import MusicStoreEnterPluginRepoScreenshot from '/img/tutorials/music-store-app/setup-development-environment/enter-plugin-repo.png';
+import MusicStorePluginInstallScreenshot from '/img/tutorials/music-store-app/setup-development-environment/plugin-install.png';
+
### Setting up your development environment
1. Download and install .NET 5 SDK [Download .NET \(Linux, macOS, and Windows\) \(microsoft.com\)](https://dotnet.microsoft.com/download)
@@ -41,27 +46,18 @@ Examples:
Once Rider loads you will see the Welcome Screen. Click the `Configure` dropdown and select `Plugins`.
-
-
-
+
A new Preferences Screen will open up. Click the `Settings` icon as shown and select `Manage Plugin Repositories...`
-
-
-
+
Click the `+` icon and enter the URL `https://plugins.jetbrains.com/plugins/dev/14839`then click `OK`
-
-
-
+
Now click on the `Marketplace` tab and search for `Avalonia`. Select `AvaloniaRider` and click `Install` then once that's done, click the `Restart IDE` button that will appear.
-
-
-
-
+
Now Rider should be ready to develop Avalonia applications.
diff --git a/versioned_docs/version-0.10.x/tutorials/running-in-the-browser.md b/versioned_docs/version-0.10.x/tutorials/running-in-the-browser.md
index ecf19c0d2..c0c18966e 100644
--- a/versioned_docs/version-0.10.x/tutorials/running-in-the-browser.md
+++ b/versioned_docs/version-0.10.x/tutorials/running-in-the-browser.md
@@ -32,7 +32,7 @@ dotnet new avalonia.xplat
5. In order to run simply do:
```bash
-cd WebTest.Web
+cd WebTest.Browser
dotnet run
```
@@ -50,4 +50,4 @@ Legacy Blazor backend is still available for compatability and can be referenced
## Troubleshooting
-If you have not performed the step to install required workloads, you will encounter errors when running the app in your browser later (e.g. `System.DllNotFoundException: libSkiaSharp`) and you will need to rebuild again before the app will run.
\ No newline at end of file
+If you have not performed the step to install required workloads, you will encounter errors when running the app in your browser later (e.g. `System.DllNotFoundException: libSkiaSharp`) and you will need to rebuild again before the app will run.
diff --git a/versioned_docs/version-0.10.x/tutorials/todo-list-app/adding-new-items.md b/versioned_docs/version-0.10.x/tutorials/todo-list-app/adding-new-items.md
index c4649787a..e5c6f180f 100644
--- a/versioned_docs/version-0.10.x/tutorials/todo-list-app/adding-new-items.md
+++ b/versioned_docs/version-0.10.x/tutorials/todo-list-app/adding-new-items.md
@@ -3,6 +3,10 @@ id: adding-new-items
title: Adding new Items
---
+import ToDoAddNewItemsEmptyScreenshot from '/img/tutorials/todo-list-app/adding-new-items/adding-new-items-view.png';
+import ToDoAddNewItemNavigationScreenshot from '/img/tutorials/todo-list-app/adding-new-items/adding-new-item-run.gif';
+import ToDoAddNewItemResultScreenshot from '/img/tutorials/todo-list-app/adding-new-items/adding-new-items-2-run.gif';
+
When we originally created the `TodoListView` we added an "Add an item" button. It's time now to make that button do something. When the button is clicked we want to replace the list of items with a new view which will allow the user to enter the description of a new item.
### Create the view
@@ -30,9 +34,7 @@ Views/AddItemView.axaml
This gives us a view which looks like this:
-
-
-
+
The only new thing here is the `` control which is a control that allows a user to input text. We set three properties on it:
@@ -164,9 +166,7 @@ If you're familiar with WPF or UWP you may think it strange that we're binding `
If you now run the application and click the "Add an item" button you should see the new view appear.
-
-
-
+
Now we have the "Add new item" view appearing we need to make it work. In particular we need to enable/disable the OK button depending on whether the user has typed anything in the `Description`.
@@ -369,7 +369,4 @@ Finally we subscribe to the result of the observable sequence. If the command re
### Run the application
-
-
-
-
\ No newline at end of file
+
diff --git a/versioned_docs/version-0.10.x/tutorials/todo-list-app/creating-a-new-project.md b/versioned_docs/version-0.10.x/tutorials/todo-list-app/creating-a-new-project.md
index af74ff5ab..1e00973cf 100644
--- a/versioned_docs/version-0.10.x/tutorials/todo-list-app/creating-a-new-project.md
+++ b/versioned_docs/version-0.10.x/tutorials/todo-list-app/creating-a-new-project.md
@@ -3,13 +3,13 @@ id: creating-a-new-project
title: Creating a new project
---
+import ToDoVsCreateNewProjectScreenshot from '/img/tutorials/todo-list-app/creating-a-new-project/image (5).png';
+
## Visual Studio
The easiest way to get started with Avalonia from Visual Studio is to [install the extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) from the Visual Studio Marketplace. Once that is installed, you can create an Avalonia MVVM application:
-
-
-
+
- Start Visual Studio
- Select "Create a new project" from the start window or `File -> New -> Project` from the main menu
diff --git a/versioned_docs/version-0.10.x/tutorials/todo-list-app/creating-a-view.md b/versioned_docs/version-0.10.x/tutorials/todo-list-app/creating-a-view.md
index b1e584ab5..0b02c63f8 100644
--- a/versioned_docs/version-0.10.x/tutorials/todo-list-app/creating-a-view.md
+++ b/versioned_docs/version-0.10.x/tutorials/todo-list-app/creating-a-view.md
@@ -3,6 +3,9 @@ id: creating-a-view
title: Creating a View
---
+import ToDoViewPreviewerScreenshot from '/img/tutorials/todo-list-app/creating-a-view/creating-a-view-todolistview.png';
+import ToDoViewScreenshot from '/img/tutorials/todo-list-app/creating-a-view/creating-a-view-run.png';
+
Let's first create a view to display a list of TODO items together with a button to add a new item.
Because this is a first tutorial, we're going to first just populate the view with some hard-coded data. In later steps we'll use the MVVM pattern to populate this view.
@@ -93,9 +96,7 @@ Edit the contents of `Views/TodoListView.axaml` to contain the following:
If you're using the Visual Studio extension you should see the contents of the control displayed in the previewer after completing a build:
-
-
-
+
### What does it all mean?
@@ -195,8 +196,5 @@ Using the XML namespace we've just declared we now place the `TodoListView` cont
If you now run the application (by pressing `F5` in Visual Studio or executing `dotnet run` in .NET Core) you should see the application running in all its glory:
-
-
-
-
+
\ No newline at end of file
diff --git a/versioned_docs/version-0.10.x/tutorials/todo-list-app/index.md b/versioned_docs/version-0.10.x/tutorials/todo-list-app/index.md
index a0dfe4086..2d4ef6641 100644
--- a/versioned_docs/version-0.10.x/tutorials/todo-list-app/index.md
+++ b/versioned_docs/version-0.10.x/tutorials/todo-list-app/index.md
@@ -1,14 +1,14 @@
# ToDo List App
+import ToDoFinishedAppScreenshot from '/img/tutorials/todo-list-app/image (14).png';
+
In this tutorial we're going to be creating a simple TODO application in Avalonia using the Model-View-ViewModel \(MVVM\) pattern.
:::info
You can find the code for the completed application [here](https://github.com/grokys/todo-tutorial).
:::
-
-
-
+
## Model-View-ViewModel \(MVVM\)
diff --git a/versioned_docs/version-0.10.x/tutorials/todo-list-app/wiring-up-the-views.md b/versioned_docs/version-0.10.x/tutorials/todo-list-app/wiring-up-the-views.md
index 454da9c6f..155469eba 100644
--- a/versioned_docs/version-0.10.x/tutorials/todo-list-app/wiring-up-the-views.md
+++ b/versioned_docs/version-0.10.x/tutorials/todo-list-app/wiring-up-the-views.md
@@ -3,6 +3,8 @@ id: wiring-up-the-views
title: Wiring up the Views
---
+import ToDoWiredViewScreenshot from '/img/tutorials/todo-list-app/wiring-up-the-views/wiring-up-views-run.png';
+
Now that we've got the view models set up, we need to make our views use these view models. We do this by making use of Avalonia's [data binding](../../getting-started/programming-with-avalonia/data-binding) feature.
## Update MainWindow
@@ -97,6 +99,4 @@ How each item is displayed is controlled by the `ItemTemplate`. The `ItemTemplat
If you now run the application you will see the items in the \(fake\) database displayed.
-
-
-
\ No newline at end of file
+
diff --git a/versioned_docs/version-0.10.x/wpf-developer-tips/datatemplates.md b/versioned_docs/version-0.10.x/wpf-developer-tips/datatemplates.md
index e0a317e97..6a72f8960 100644
--- a/versioned_docs/version-0.10.x/wpf-developer-tips/datatemplates.md
+++ b/versioned_docs/version-0.10.x/wpf-developer-tips/datatemplates.md
@@ -1,6 +1,6 @@
---
info: datatemplates
-title: DataTempaltes
+title: DataTemplates
---
As styles aren't stored in `Resources`, neither are `DataTemplates`. Instead, `DataTemplates` are placed in a `DataTemplates` collection on each control \(and on `Application`\):
@@ -25,4 +25,4 @@ Data templates in Avalonia can also target interfaces and derived classes \(whic
## DataTemplateSelector
-In WPF you can create a `DataTemplateSelector` to select or create a `DataTemplate` based on the provided data. In Avalonia you cannot do this, but you can implement `IDataTemplate` which can be seen as a good replacement for the `DataTemplateSelector`. Please find a sample [here](https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/DataTemplates/IDataTemplateSample).
\ No newline at end of file
+In WPF you can create a `DataTemplateSelector` to select or create a `DataTemplate` based on the provided data. In Avalonia you cannot do this, but you can implement `IDataTemplate` which can be seen as a good replacement for the `DataTemplateSelector`. Please find a sample [here](https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/DataTemplates/IDataTemplateSample).
diff --git a/versioned_docs/version-0.10.x/wpf-developer-tips/index.md b/versioned_docs/version-0.10.x/wpf-developer-tips/index.md
index edfe2a77b..65c700f41 100644
--- a/versioned_docs/version-0.10.x/wpf-developer-tips/index.md
+++ b/versioned_docs/version-0.10.x/wpf-developer-tips/index.md
@@ -86,7 +86,7 @@ private void OnControl_Unloaded(object sender, RoutedEventArgs e)
**Avalonia**
```
TemplateApplied += OnControl_Loaded;
-private void BuildControl_Loaded(object sender, RoutedEventArgs e)
+private void OnControl_Loaded(object sender, RoutedEventArgs e)
{
}
@@ -129,4 +129,4 @@ TextRunProperties.SetTextDecorations(TextDecorations.Underline);
**Avalonia**
```csharp
TextRunProperties.Underline = true;
-```
\ No newline at end of file
+```