Fix some typos in documentation

This commit is contained in:
Sebastian Buchwald 2022-07-17 22:43:19 +02:00
Родитель 9339dc633e
Коммит ce23fc9b2c
30 изменённых файлов: 56 добавлений и 56 удалений

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 3.2 KiB

После

Ширина:  |  Высота:  |  Размер: 3.2 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 9.7 KiB

После

Ширина:  |  Высота:  |  Размер: 9.7 KiB

Просмотреть файл

@ -38,5 +38,5 @@ If you've found a bug or issue in the framework, you should create an issue on [
If you're looking for help with your app, try engaging our active developer community on [Telegram](https://t.me/Avalonia).
### Commerical Support
### Commercial Support
We have a range of commercial support plans that provide priority assistance from the core contributors. You can learn more from [our website](https://avaloniaui.net/support.html).

Просмотреть файл

@ -26,7 +26,7 @@
| [IndexerDescriptor](http://reference.avaloniaui.net/api/Avalonia.Data/IndexerDescriptor) | Holds a description of a binding for [`AvaloniaObject`](http://reference.avaloniaui.net/api/Avalonia/AvaloniaObject)'s \[\] operator. |
| [InstancedBinding](http://reference.avaloniaui.net/api/Avalonia.Data/InstancedBinding) | Holds the result of calling [`Initiate(IAvaloniaObject, AvaloniaProperty, object, bool)`](http://reference.avaloniaui.net/api/Avalonia.Data/IBinding/BA1DE0B2). |
| [MultiBinding](http://reference.avaloniaui.net/api/Avalonia.Data/MultiBinding) | A XAML binding that calculates an aggregate value from multiple child [`Bindings`](http://reference.avaloniaui.net/api/Avalonia.Data/MultiBinding/A8E43478). |
| [RelativeSource](http://reference.avaloniaui.net/api/Avalonia.Data/RelativeSource) | Describes the the location of a binding source, relative to the binding target. |
| [RelativeSource](http://reference.avaloniaui.net/api/Avalonia.Data/RelativeSource) | Describes the location of a binding source, relative to the binding target. |
| [TemplateBinding](http://reference.avaloniaui.net/api/Avalonia.Data/TemplateBinding) | A XAML binding to a property on a control's templated parent. |
## Interface Types <a id="InterfaceTypes"></a>

Просмотреть файл

@ -4,7 +4,7 @@
| Struct | Summary |
| :--- | :--- |
| [PopupPositionerParameters](http://reference.avaloniaui.net/api/Avalonia.Controls.Primitives.PopupPositioning/PopupPositionerParameters) | The IPopupPositioner provides a collection of rules for the placement of a a popup relative to its parent. Rules can be defined to ensure the popup remains within the visible area's borders, and to specify how the popup changes its position, such as sliding along an axis, or flipping around a rectangle. These positioner-created rules are constrained by the requirement that a popup must intersect with or be at least partially adjacent to its parent surface. |
| [PopupPositionerParameters](http://reference.avaloniaui.net/api/Avalonia.Controls.Primitives.PopupPositioning/PopupPositionerParameters) | The IPopupPositioner provides a collection of rules for the placement of a popup relative to its parent. Rules can be defined to ensure the popup remains within the visible area's borders, and to specify how the popup changes its position, such as sliding along an axis, or flipping around a rectangle. These positioner-created rules are constrained by the requirement that a popup must intersect with or be at least partially adjacent to its parent surface. |
## Enum Types <a id="EnumTypes"></a>

Просмотреть файл

@ -1,6 +1,6 @@
# ContextMenu
The `ContextMenu` control is a menu that can be applied to any control to provide right-click control-specfic menus.
The `ContextMenu` control is a menu that can be applied to any control to provide right-click control-specific menus.
## Reference <a id="reference"></a>

Просмотреть файл

@ -20,7 +20,7 @@ Every [.](./ "mention") can hold multiple `DataGridColumns`. Avalonia has severa
## DataGridTextColumn
This column is used to display text data, normally represented by a `string`. In the normal state the text is displayed in a `TextBlock`. If the user edits the current cell, a `TextBox` will be shown. This column has some properties which can be used to control the appereance like `FontSize` and `FontFamily`.
This column is used to display text data, normally represented by a `string`. In the normal state the text is displayed in a `TextBlock`. If the user edits the current cell, a `TextBox` will be shown. This column has some properties which can be used to control the appearance like `FontSize` and `FontFamily`.
### Example
@ -43,7 +43,7 @@ This column is used to display text data, normally represented by a `string`. In
## DataGridCheckBoxColumn
This column is used to represent a `bool` value. The value is represented by a `CheckBox`, which is disabled in the normal state and endabled in the editing state of the `DataGridCell`. If needed you can ebable the intermediate state by setting the property `IsThreeState` to true.
This column is used to represent a `bool` value. The value is represented by a `CheckBox`, which is disabled in the normal state and enabled in the editing state of the `DataGridCell`. If needed you can enable the intermediate state by setting the property `IsThreeState` to true.
### Example
@ -69,7 +69,7 @@ This column is used to represent a `bool` value. The value is represented by a
This column is used to display any content you like. There are two [datatemplates.md](../../../misc/wpf/datatemplates.md "mention") which you can define, the `CellTemplate` for the normal state and the `CellEditingTemplate` for the editing state of the current `DataGridCell`.&#x20;
{% hint style="info" %}
The DataGridTemplateColumn is editable from Avalonia version 0.10.12 onwoard. If you do not set a `CellEditingTemplate`, the column will stay read-only.
The DataGridTemplateColumn is editable from Avalonia version 0.10.12 onward. If you do not set a `CellEditingTemplate`, the column will stay read-only.
{% endhint %}
### Example

Просмотреть файл

@ -41,7 +41,7 @@ Flyouts are light dismissable containers that show arbitrary UI content. Flyouts
## Flyout Types
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 abitrary UI content.
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.
![Basic Flyout](<../../.gitbook/assets/flyoutpreview.png>)
@ -140,7 +140,7 @@ Although `Flyout`s are not controls themselves, their general appearance can sti
To create a custom flyout type, derive from FlyoutBase. You'll have to override the abstract method `CreatePresenter()` to specify the presenter the `Flyout` should use to display its content. This can be any type of control, but note that this is the root content for the inner popup and should be styled with background, border, corner radius, etc. to match other popups. You can still use a normal `FlyoutPresenter` if you wish
The following examle creates a simple `Flyout` that hosts an image
The following example creates a simple `Flyout` that hosts an image
```C#
public class MyImageFlyout : FlyoutBase

Просмотреть файл

@ -37,7 +37,7 @@ In the above example we have two keywords: __*__ and **Auto**. Here is explanati
* The **"Auto"** keyword is used to have the row or column geometry be determined by the containing control's definitions.
* The __*__ is used for denoting proportional spacing.
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 Colum 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.
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.
![Grid Using Properties and Spanning Columns](../../.gitbook/assets/grid_example.png)
@ -60,11 +60,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.
![Grid Using Asterix Symbols](../../.gitbook/assets/grid_asterix_example.png)
![Grid Using Asterisk Symbols](../../.gitbook/assets/grid_asterisk_example.png)
Now let's fill our grid with some elements, i will fill exery field with button, you can use anything you want.
Now let's fill our grid with some elements, I will fill every field with button, you can use anything you want.
![Grid Using Sterix Symbols Filled With Buttons](../../.gitbook/assets/grid_asterix_example_buttons.png)
![Grid Using Asterisk Symbols Filled With Buttons](../../.gitbook/assets/grid_asterisk_example_buttons.png)
Now our View code look's like this:
@ -86,11 +86,11 @@ Now our View code look's like this:
</Grid>
```
In this moment our **asterix** symbols are forcing our grid to become equal, now let's see what will happen when we replace **asterix** with the **Auto** keyword
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
![Grid Using Auto Keyword](../../.gitbook/assets/grid_auto_example_buttons.png)
As you can see our grid become sticky to it's content, it is very usefull when we have components with variable `Height` propety.
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:

Просмотреть файл

@ -58,7 +58,7 @@ Controls the type of selection that can be made on the `ListBox`:
| :--- | :--- |
| `Single` | Only a single item can be selected \(default\) |
| `Multiple` | Multiple items can be selected |
| `Toggle` | Item selection can be toggled by tapping/spacebar. When not enabled, shift or ctrl must be used to select mutiple items |
| `Toggle` | Item selection can be toggled by tapping/spacebar. When not enabled, shift or ctrl must be used to select multiple items |
| `AlwaysSelected` | An item will always be selected as long as there are items to select. |
These values can be combined, e.g.:

Просмотреть файл

@ -40,7 +40,7 @@ You can also include array/list indexers in binding paths:
## Binding Modes <a id="binding-modes"></a>
You can change the behavior of a `{Binding}` by specifing a binding `Mode`:
You can change the behavior of a `{Binding}` by specifying a binding `Mode`:
```markup
<TextBlock Text="{Binding Name, Mode=OneTime}">

Просмотреть файл

@ -79,9 +79,9 @@ Hiding a `ContentControl` if the bound content is null or empty:
IsVisible="{Binding MyContent, Converter={x:Static ObjectConverters.IsNotNull}}"/>
```
> from now on assume converters are imported as shown in the previus "Binding Converters" section
> from now on assume converters are imported as shown in the previous "Binding Converters" section
Convert text to specifc case from a parameter
Convert text to specific case from a parameter
```markup
<TextBlock Text="{Binding TheContent,
Converter={StaticResource textCaseConverter},
@ -124,7 +124,7 @@ public class TextCaseConverter : IValueConverter
```
Converting a binded object to different target types contextually
Converting a bound object to different target types contextually
```markup
<Image Width="42"

Просмотреть файл

@ -13,7 +13,7 @@ First we have to create our attached property. The method `AvaloniaProperty.Regi
This call ensures that the property has a type, an owner type and one where it may be used.
The verify method can be used to clean up a value that is being set. Either by returning the corrected value or discard the process by returning `AvaloniaProperty.UnsetValue`. Or one can perform special tasks with the element that the property is hosted by. The getter and seter methods should always just set the value an never to anything beyond. In fact they will usually never be called as the Binding system will recognize the convention and set the proerties directly where they are stored.
The verify method can be used to clean up a value that is being set. Either by returning the corrected value or discard the process by returning `AvaloniaProperty.UnsetValue`. Or one can perform special tasks with the element that the property is hosted by. The getter and setter methods should always just set the value and never do anything beyond. In fact they will usually never be called as the Binding system will recognize the convention and set the properties directly where they are stored.
In this example file we create two attached properties that interact with each other: A _Command_ property and a _CommandParameter_ that is used by when invoking the command.
@ -113,7 +113,7 @@ public class DoubleTappedBehav : AvaloniaObject
In the verify method we utilize the routed event system to attach a new handler. Note that the handler should be detached, again. The value of the property is requested by the normal program mechanisms using `GetValue()` method.
This example UI shows how to use the attached property. After making the namespace known to the xaml compiler it can be used by qualifying it with a dot. Then bindings can be used.
This example UI shows how to use the attached property. After making the namespace known to the XAML compiler it can be used by qualifying it with a dot. Then bindings can be used.
```markup
<UserControl xmlns="https://github.com/avaloniaui"

Просмотреть файл

@ -99,7 +99,7 @@ Add other runtime identifiers as necessary. Each one should be separated by a se
### Notes on the `.app` executable file <a id="notes-on-the-app-executable-file"></a>
The file that is actually executed by macOS when starting your `.app` bundle will **not** have the standard `.dll` extension. If your publish folder contents, which go inside the `.app` bundle, do not have both a `MyApp` \(exectuable\) and a `MyApp.dll`, things are probably not generating properly, and macOS will probably not be able to start your `.app` properly.
The file that is actually executed by macOS when starting your `.app` bundle will **not** have the standard `.dll` extension. If your publish folder contents, which go inside the `.app` bundle, do not have both a `MyApp` \(executable\) and a `MyApp.dll`, things are probably not generating properly, and macOS will probably not be able to start your `.app` properly.
[Some recent changes in the way .NET Core is distributed and notarized on macOS](https://docs.microsoft.com/en-us/dotnet/core/install/macos-notarization-issues) have caused the `MyApp` executable \(also called the "app host" in the linked documentation\) to not be generated. **You need this file to be generated in order for your `.app` to function properly.** To make sure this gets generated, do one of the following:
@ -300,7 +300,7 @@ For more information on customizing your notarization workflow and more flags yo
The following steps were modified from [this StackOverflow post](https://stackoverflow.com/a/53121755/3938401):
1. Make sure your `.app` is code signed properly
2. Stick your `.app` in a `.zip` file, e.g. `MyApp.zip`. Note that using `zip` will make notarisation fail, instead use `ditto` like so: `ditto -c -k --sequesterRsrc --keepParent MyApp.app MyApp.zip`
2. Stick your `.app` in a `.zip` file, e.g. `MyApp.zip`. Note that using `zip` will make notarization fail, instead use `ditto` like so: `ditto -c -k --sequesterRsrc --keepParent MyApp.app MyApp.zip`
3. Run `xcrun altool --notarize-app -f MyApp.zip --primary-bundle-id com.unique-identifier-for-this-upload -u username -p password`. You can use a password in your keychain by passing `-p "@keychain:AC_PASSWORD"`, where AC\_PASSWORD is the key. The account has to be registered as an Apple Developer.
4. If the upload is successful, you'll get a UUID back for your request token like this: `28fad4c5-68b3-4dbf-a0d4-fbde8e6a078f`
5. You can check notarization status using that token like this: `xcrun altool --notarization-info 28fad4c5-68b3-4dbf-a0d4-fbde8e6a078f -u username -p password`. This could take some time -- eventually it will succeed or fail.
@ -359,9 +359,9 @@ Your app should be ready for this and do not crash if any folder is read/write p
Your app content should be bundled correctly. [Here's an article from Apple with a lot of useful info](https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle).
Most important rules from the article:
* `.dll` files are not concidered as a code by Apple. So it should be placed inside `/Resources` folder and can be not signed.
* `.dll` files are not considered as a code by Apple. So it should be placed inside `/Resources` folder and can be not signed.
* `/MacOS` files should contain only executable mach-o - you app executable and any other helper executables
* All other mach-o `.dylib` files shoul be inside `Frameworks/` folder.
* All other mach-o `.dylib` files should be inside `Frameworks/` folder.
To satisfy this requirement without a lot of pain you can use relative symlinks from `MacOS/` folder to `Resources/` and `Frameworks/` folders. As an example:
@ -497,7 +497,7 @@ Open a Transporter app, sign in, select your \*.pkg package and wait for validat
If you will receive any errors - fix them, package app again, remove file in Transporter and select it again.
When upload succedes - you will see your package in App Store Connect.
When upload succeeds - you will see your package in App Store Connect.
## Troubleshooting
@ -532,7 +532,7 @@ Note that `CFBundleName` is limited to 15 characters, if your application name i
Building the app in a CI/CD pipeline is straightforward using the `dotnet` command. For code signing and notarization to work a little extra work is required.
`codesign` and `notarytool` read the certificate and credentials to talk to the notarisation service from a Keychain on the build machine:
`codesign` and `notarytool` read the certificate and credentials to talk to the notarization service from a Keychain on the build machine:
```bash
# Create a new keychain
@ -620,7 +620,7 @@ And then add these steps:
> **Note:** `RUNNER_TEMP` is an environment variable provided by GitHub Actions
After code signing the app bundle can now be notarised, by adding this step to the job:
After code signing the app bundle can now be notarized, by adding this step to the job:
```yaml
- name: Notarise app
@ -630,8 +630,8 @@ After code signing the app bundle can now be notarised, by adding this step to t
xcrun stapler staple "$RUNNER_TEMP/MyApp.app"
```
When you run this workflow you will have an app bundle that is signed and notarised, ready for packaging in a disk image or installer.
When you run this workflow you will have an app bundle that is signed and notarized, ready for packaging in a disk image or installer.
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.
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.

Просмотреть файл

@ -43,15 +43,15 @@
![rider-welcome](https://avaloniaui.net/docs/advanced-tutorial/images/rider-welcome.png)
A new Preferenes Screen will open up. Click the `Settings` icon as shown and select `Manage Plugin Repositories...`
A new Preferences Screen will open up. Click the `Settings` icon as shown and select `Manage Plugin Repositories...`
![configure-plugin-repos](https://avaloniaui.net/docs/advanced-tutorial/images/configure-plugin-repos.png)
Click the `+` icon and enter the url `https://plugins.jetbrains.com/plugins/dev/14839` then click `OK`:
Click the `+` icon and enter the URL `https://plugins.jetbrains.com/plugins/dev/14839` then click `OK`:
![enter-plugin-repo](https://avaloniaui.net/docs/advanced-tutorial/images/enter-plugin-repo.png)
Now click on the `Marketplace` tab and search for `Avalonia`. Select `AvaloniaRider` and click `Install`; once thats done, click the `Restart IDE` button that appears.
Now click on the `Marketplace` tab and search for `Avalonia`. Select `AvaloniaRider` and click `Install`; once that's done, click the `Restart IDE` button that appears.
![plugin-install](https://avaloniaui.net/docs/advanced-tutorial/images/plugin-install.png)

Просмотреть файл

@ -76,7 +76,7 @@ Let's imagine a situation in which you might expect a second style to override p
With this code example the `Border` has a Red background normally and Blue when the pointer is over it. This is because as with CSS more specific selectors have precedence. It is an issue, when you want to override default styles of any state (pointerover, pressed or others) with a single style. To achieve it you will need to have new styles for these states as well.&#x20;
{% hint style="info" %}
Visit the Avalonia source code to find the [original templates](https://github.com/AvaloniaUI/Avalonia/tree/master/src/Avalonia.Themes.Fluent/Controls) when this happens and copy and paste the styles with psuedoclasses into your code.
Visit the Avalonia source code to find the [original templates](https://github.com/AvaloniaUI/Avalonia/tree/master/src/Avalonia.Themes.Fluent/Controls) when this happens and copy and paste the styles with pseudoclasses into your code.
{% endhint %}
@ -116,7 +116,7 @@ The reason is hidden in the Button's template. You can find the default template
</Style>
```
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 backgroun 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:
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:
```xml
<!-- Here #PART_ContentPresenter name selector is not necessary, but was added to have more specific style -->

Просмотреть файл

@ -10,7 +10,7 @@ The traditional extension for XAML files is `.xaml` but due to problems with Vis
For more information see [https://github.com/AvaloniaUI/Avalonia/issues/4102](https://github.com/AvaloniaUI/Avalonia/issues/4102).
Both `.xaml` and `.axaml` will be supported going foward, so feel free to use the extension you prefer.
Both `.xaml` and `.axaml` will be supported going forward, so feel free to use the extension you prefer.
## Format of an Avalonia XAML File <a id="format-of-an-avalonia-xaml-file"></a>
@ -25,7 +25,7 @@ A basic Avalonia XAML file looks like this:
There are three parts to this file:
* The root element `Window` - this descibes the type of the root control in the XAML file; in this case [`Window`](http://reference.avaloniaui.net/api/Avalonia.Controls/Window/)
* The root element `Window` - this describes the type of the root control in the XAML file; in this case [`Window`](http://reference.avaloniaui.net/api/Avalonia.Controls/Window/)
* `xmlns="https://github.com/avaloniaui"` - this is the XAML namespace for Avalonia. Without this, the file will not be recognised as an Avalonia XAML document.
* `xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"` - this is the XAML-language XAML namespace. This isn't strictly necessary, but you will probably need it for accessing certain features of the XAML language.
* `x:Class="AvaloniaApplication1.MainWindow"` - this tells the XAML compiler where to find the associated class for this file, defined in [code-behind](https://docs.avaloniaui.net/guides/basics/code-behind)

Просмотреть файл

@ -1,6 +1,6 @@
# ReactiveUI
[ReactiveUI](https://reactiveui.net/) is an advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. Avalonia ships its own fork of [ReactiveUI](https://reactiveui.net/) in the `Avalonia.ReactiveUI` NuGet package. To use ReactiveUI and the the [MVVM Pattern](https://msdn.microsoft.com/en-us/library/hh848246.aspx) in your Avalonia solutions, add the package to your project via NuGet package manager GUI or execute the following command:
[ReactiveUI](https://reactiveui.net/) is an advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. Avalonia ships its own fork of [ReactiveUI](https://reactiveui.net/) in the `Avalonia.ReactiveUI` NuGet package. To use ReactiveUI and the [MVVM Pattern](https://msdn.microsoft.com/en-us/library/hh848246.aspx) in your Avalonia solutions, add the package to your project via NuGet package manager GUI or execute the following command:
```bash
dotnet add package Avalonia.ReactiveUI

Просмотреть файл

@ -152,5 +152,5 @@ Now, we can run the app. If we type some text into the `TextBox`, it will be pre
dotnet run --framework netcoreapp2.1
```
See the "[Saving Routing State to the Disk in a Cross-Platform .NET Core GUI App with ReactiveUI and Avalonia](https://habr.com/ru/post/462307/)" blog post to explore how to combine the data persistance feature with ReactiveUI routing and dependency injection. See also [the source code of the sample app](https://github.com/reactiveui/ReactiveUI.Samples/tree/a7d06759e27fa17f9c6a77018362a2f8e0c30fa6/avalonia) in the ReactiveUI.Samples repository.
See the "[Saving Routing State to the Disk in a Cross-Platform .NET Core GUI App with ReactiveUI and Avalonia](https://habr.com/ru/post/462307/)" blog post to explore how to combine the data persistence feature with ReactiveUI routing and dependency injection. See also [the source code of the sample app](https://github.com/reactiveui/ReactiveUI.Samples/tree/a7d06759e27fa17f9c6a77018362a2f8e0c30fa6/avalonia) in the ReactiveUI.Samples repository.

Просмотреть файл

@ -106,7 +106,7 @@ namespace RoutingExample
**MainWindow.xaml**
Now we need to place the `RoutedViewHost` XAML control to our main view. It will resolve and embedd appropriate views for the view models. Note, that you need to import `rxui` namespace for `RoutedViewHost` to work. Additionally, you can override animations that are played when `RoutedViewHost` changes a view — simply override `RoutedViewHost.PageTransition` property in XAML.
Now we need to place the `RoutedViewHost` XAML control to our main view. It will resolve and embed appropriate views for the view models. Note, that you need to import `rxui` namespace for `RoutedViewHost` to work. Additionally, you can override animations that are played when `RoutedViewHost` changes a view — simply override `RoutedViewHost.PageTransition` property in XAML.
For latest builds from MyGet use `xmlns:rxui="https://reactiveui.net"`, for 0.8.0 release on NuGet use `xmlns:rxui="clr-namespace:Avalonia;assembly=Avalonia.ReactiveUI"` as in the example below.

Просмотреть файл

@ -2,7 +2,7 @@
Originally based on [UWPvsWPF.md](https://github.com/robloo/PublicDocs/blob/master/UWPvsWPF.md) with Avalonia-specific changes. Licensed CC BY-SA 4.0
This section lists the main differences \(primarily from a XAML viewpoint\) between Avaloni, UWP and WPF.
This section lists the main differences \(primarily from a XAML viewpoint\) between Avalonia, UWP and WPF.
Legend:

Просмотреть файл

@ -11,7 +11,7 @@ You can debug the XAML compiler adding at your's csproj AvaloniaXamlIlDebuggerLa
</PropertyGroup>
```
If build the project in Visual Studio you shold see a window like this:
If build the project in Visual Studio you should see a window like this:
![](https://user-images.githubusercontent.com/53405089/132686320-958f30a6-49f8-498f-853c-b9dd17262b54.png)

Просмотреть файл

@ -4,7 +4,7 @@ Please ensure you have followed the guide [create-a-cross-platform-solution.md](
Assuming you have created a project called `HelloWord`. Enter the directory `HelloWorld.Android` from the command line.
To build the project for Andoird run the following command.
To build the project for Android run the following command.
```bash
dotnet build

Просмотреть файл

@ -22,7 +22,7 @@ This has to be done by creating an XCode app project that has the same `bundle i
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 dont 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,7 +6,7 @@ Inside the dialog we would like the user to search for albums, and then select a
To do this we will need to query a web api to return a list of items. This will take some time so the user may need to wait.
The UI in order to acheive this can consist of the following elements.
The UI in order to achieve this can consist of the following elements.
* A `TextBox` for the user to type the album or artist name.
* A `ProgressBar` to tell the user their search request is happening.
@ -17,7 +17,7 @@ Controls can be laid out inside `Panels`. The most common ones are `StackPanel`
A `StackPanel` will stack multiple controls on top of each other or next to each other depending on the `Orientation` that is set. The default being `Vertical`.
A `DockPanel` allows controls to be docked to any side the user wished via the `DockPanel.Dock` attached property. The last control inside a `DockPanel` if it doesnt have a `Dock` specified will fill the remaining space.
A `DockPanel` allows controls to be docked to any side the user wished via the `DockPanel.Dock` attached property. The last control inside a `DockPanel` if it doesn't have a `Dock` specified will fill the remaining space.
Right click on your `Views` folder and select `Add``Avalonia User Control` to add a new `View` to the project.
@ -161,7 +161,7 @@ Notice this property is instantiated with `= new ();`. Forget this and it will b
Since we are using `ObservableCollection` when we `bind` the `ListBox`s `Items` property to it, then the `ListBox` control will start listening to events and keep the `Items` inside the `ListBox` in sync with the `ObservableCollection` on the `ViewModel`.
The `ListBox` will see that the `SearchResults` has an item inside it, it will check the type of the item, which will be `AlbumViewModel`. The `ListBox` will then see if it has a `DataTemplate` for that type, which we dont. However it will find at the root of the application in `App.axaml`
The `ListBox` will see that the `SearchResults` has an item inside it, it will check the type of the item, which will be `AlbumViewModel`. The `ListBox` will then see if it has a `DataTemplate` for that type, which we don't. However it will find at the root of the application in `App.axaml`
```markup
<Application.DataTemplates>

Просмотреть файл

@ -6,7 +6,7 @@ Ok so now the user can find albums to purchase, it would be nice if the user cou
Modify the `MainWindow.axaml` so that it places the existing `Button` inside a panel. We can then add a `TextBlock` that we can show when the user has no music, to prompt them to buy some.
We can then use an `ItemsControl` instead of a `ListBox` as we did before. An `ItemsControl` is the exact same as a `ListBox` except it doesnt allow the user to select anything.
We can then use an `ItemsControl` instead of a `ListBox` as we did before. An `ItemsControl` is the exact same as a `ListBox` except it doesn't allow the user to select anything.
```markup
<Window xmlns="https://github.com/avaloniaui"
@ -111,5 +111,5 @@ Lets run the program and see if it works.
![image-20210310175949319](https://avaloniaui.net/docs/advanced-tutorial/images/image-20210310175949319.png)
For the finishing touch we simply need to add persistance to the application.
For the finishing touch we simply need to add persistence to the application.

Просмотреть файл

@ -26,7 +26,7 @@ Some of the important files are:
| ViewModelBase.cs | This is a base class that all ViewModels should inherit. It implements the way the ViewModels signal changes to the Views to update the UI. \(google `INotifyPropertyChanged` for more on that.\) |
| MainWindowViewModel.cs | This is the ViewModel for your `MainWindow` |
| MainWindow.axaml | This is the `xaml` UI code that describes how the `MainWindow` looks and its contents. |
| App.axaml | This is a `xaml` file that sets up the application, it chooses the the theme the UI will use and declares the `ViewLocator` `DataTemplate`. |
| App.axaml | This is a `xaml` file that sets up the application, it chooses the theme the UI will use and declares the `ViewLocator` `DataTemplate`. |
| Program.cs | `Main` method where the program starts and `Avalonia` is configured and started. |
| ViewLocator.cs | `ViewLocator` is a special `DataTemplate`. When some `Data` appears in the UI, it quickly looks to see if a `View` exists for it. This is done by naming convention. If the datas `Type` is `MyDataViewModel` then the `ViewLocator` will use the `View` named `MyDataView` \(if it exists\) in that part of the UI. This is very powerful for list based controls \(`ItemsControl`, `ListBox`, etc\) and `ContentControl`. |

Просмотреть файл

@ -29,7 +29,7 @@ Register it in the constructor of the same class like:
RxApp.MainThreadScheduler.Schedule(LoadAlbums);
```
As you can see it firstly uses the buisness logic apis to load the list of `Albums`. It then transforms each one into an `AlbumViewModel`. After this we add each `AlbumViewModel` instance to the `ObservableCollection` of `Albums`, this will instantly update the UI.
As you can see it firstly uses the business logic apis to load the list of `Albums`. It then transforms each one into an `AlbumViewModel`. After this we add each `AlbumViewModel` instance to the `ObservableCollection` of `Albums`, this will instantly update the UI.
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.

Просмотреть файл

@ -18,7 +18,7 @@ public ReactiveCommand<Unit, AlbumViewModel?> BuyMusicCommand { get; }
Note we are using `ReactiveCommand` this is where we are using ReactiveUI to provide some of the plumbing for us. Avalonia expects commands to be of type `ICommand` and `ReactiveCommand` implements this interface.
Note that `ReactiveCommand<TParam, TResult>` has some type arguments. Commands can take a parameter, however we do not need a paramter in this case, so we use `Unit` which is kind of a dummy type, it contains no data. Reactive Commands can also return a result. This will be useful for returning the Album the user wants to buy.
Note that `ReactiveCommand<TParam, TResult>` has some type arguments. Commands can take a parameter, however we do not need a parameter in this case, so we use `Unit` which is kind of a dummy type, it contains no data. Reactive Commands can also return a result. This will be useful for returning the Album the user wants to buy.
Now add the following lines to the constructor of `MusicStoreViewModel` in order to instantiate the command and implement the code needed to return a result from the dialog:

Просмотреть файл

@ -40,13 +40,13 @@ Examples:
![rider-welcome](https://avaloniaui.net/docs/advanced-tutorial/images/rider-welcome.png)
A new Preferenes Screen will open up. Click the `Settings` icon as shown and select `Manage Plugin Repositories...`
A new Preferences Screen will open up. Click the `Settings` icon as shown and select `Manage Plugin Repositories...`
![configure-plugin-repos](https://avaloniaui.net/docs/advanced-tutorial/images/configure-plugin-repos.png)
Click the `+` icon and enter the url `https://plugins.jetbrains.com/plugins/dev/14839`then click `OK`![enter-plugin-repo](https://avaloniaui.net/docs/advanced-tutorial/images/enter-plugin-repo.png)
Click the `+` icon and enter the URL `https://plugins.jetbrains.com/plugins/dev/14839`then click `OK`![enter-plugin-repo](https://avaloniaui.net/docs/advanced-tutorial/images/enter-plugin-repo.png)
Now click on the `Marketplace` tab and search for `Avalonia`. Select `AvaloniaRider` and click `Install` then once thats done, click the `Restart IDE` button that will appear.![plugin-install](https://avaloniaui.net/docs/advanced-tutorial/images/plugin-install.png)
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.![plugin-install](https://avaloniaui.net/docs/advanced-tutorial/images/plugin-install.png)
Now Rider should be ready to develop Avalonia applications.