Replace /docs/next/ with /docs/
This commit is contained in:
Родитель
7ba6578df6
Коммит
e7e1a4096d
|
@ -50,7 +50,7 @@ ContentControl:: This control inherits `TemplatedControl`, but adds the ability
|
|||
|
||||
TIP: You can also extend existing controls like `Button`, `TextBox` or `CheckBox`, if you want to use their functionality but adding your own logic on top.
|
||||
|
||||
For more information about the types of controls please visit the https://docs.avaloniaui.net/docs/next/basics/user-interface/controls/creating-controls/choosing-a-custom-contro-type[[Documentation\]].
|
||||
For more information about the types of controls please visit the https://docs.avaloniaui.net/docs/basics/user-interface/controls/creating-controls/choosing-a-custom-contro-type[[Documentation\]].
|
||||
|
||||
|
||||
|
||||
|
@ -64,7 +64,7 @@ DirectProperty:: A `DirectProperty` is a property which can only be read and set
|
|||
|
||||
AttachedProperty:: An `AttachedProperty` is a property that can be set on any `Control`, even it doesn't define the property on it's own (e.g.: `Grid.Row`, `DockPanel.Dock`, ...)
|
||||
|
||||
If you want to learn more about `AvaloniaProperties` please visit the https://docs.avaloniaui.net/docs/next/basics/user-interface/controls/creating-controls/defining-properties[[Documentation\]]
|
||||
If you want to learn more about `AvaloniaProperties` please visit the https://docs.avaloniaui.net/docs/basics/user-interface/controls/creating-controls/defining-properties[[Documentation\]]
|
||||
|
||||
|
||||
=== ControlTemplates
|
||||
|
@ -75,7 +75,7 @@ TemplateParts::
|
|||
Some `Controls` require specific `Controls` inside the the `ControlTemplate`, which also needs to have a defined name in order to reference them inside the code behind. By convention these controls have a name with the prefix `"PART_"`. For example, you can use this to listen to events of these template parts.
|
||||
|
||||
TemplateBinding::
|
||||
Inside `ControlTemplates` you can make use of a special `Binding` called `TemplateBinding`. To learn more about them, please visit the https://docs.avaloniaui.net/docs/next/guides/custom-controls/how-to-create-templated-controls#data-binding[[Documentation\]].
|
||||
Inside `ControlTemplates` you can make use of a special `Binding` called `TemplateBinding`. To learn more about them, please visit the https://docs.avaloniaui.net/docs/guides/custom-controls/how-to-create-templated-controls#data-binding[[Documentation\]].
|
||||
|
||||
|
||||
=== The concept of the Rating-Control
|
||||
|
@ -538,8 +538,8 @@ NOTE: In Avalonia 11.x `Styles`(see https://github.com/AvaloniaUI/Avalonia.Sampl
|
|||
|
||||
.Reference
|
||||
****
|
||||
* https://docs.avaloniaui.net/docs/next/basics/user-interface/styling/styles[Styles]
|
||||
* https://docs.avaloniaui.net/docs/next/basics/user-interface/styling/control-themes[Control Themes]
|
||||
* https://docs.avaloniaui.net/docs/basics/user-interface/styling/styles[Styles]
|
||||
* https://docs.avaloniaui.net/docs/basics/user-interface/styling/control-themes[Control Themes]
|
||||
****
|
||||
|
||||
=== Step 9: Theme Variant
|
||||
|
|
|
@ -37,7 +37,7 @@ You should have a basic knowledge about string format in `C#` and about the `MVV
|
|||
|
||||
=== DataTemplates
|
||||
|
||||
In Avalonia you can use https://docs.avaloniaui.net/docs/next/basics/data/data-templates[[`DataTemplates`\]] to control how your data is shown. You can define the `DataType` which the `DataTemplate` is made for. The `DataType` can be any `class` or `interface`.
|
||||
In Avalonia you can use https://docs.avaloniaui.net/docs/basics/data/data-templates[[`DataTemplates`\]] to control how your data is shown. You can define the `DataType` which the `DataTemplate` is made for. The `DataType` can be any `class` or `interface`.
|
||||
|
||||
=== ToString
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ For the `ToolTip` we create a binding in the controls constructor. In that case
|
|||
[!MyProperty] = new Binding("The Binding Path");
|
||||
----
|
||||
|
||||
Read more about binding in code in the https://docs.avaloniaui.net/docs/next/guides/data-binding/binding-from-code#using-xaml-bindings-from-code[[Docs\]]
|
||||
Read more about binding in code in the https://docs.avaloniaui.net/docs/guides/data-binding/binding-from-code#using-xaml-bindings-from-code[[Docs\]]
|
||||
===============================
|
||||
|
||||
We can now add our `FuncDataTemplate` which will consume the function we wrote above:
|
||||
|
|
|
@ -23,7 +23,7 @@ MVVM, Model-View-ViewModel, ReactiveUI, INotifyPropertyChanged, XAML, Binding
|
|||
== Before we start
|
||||
|
||||
=== Prepare your IDE
|
||||
Please make sure you have setup your IDE according to the [https://docs.avaloniaui.net/docs/next/get-started/set-up-an-editor[docs,window=_blank]]. Moreover you should have read the [https://docs.avaloniaui.net/docs/next/welcome[Getting Started guide,window=_blank]].
|
||||
Please make sure you have setup your IDE according to the [https://docs.avaloniaui.net/docs/get-started/set-up-an-editor[docs,window=_blank]]. Moreover you should have read the [https://docs.avaloniaui.net/docs/welcome[Getting Started guide,window=_blank]].
|
||||
|
||||
=== The MVVM Pattern in short
|
||||
|
||||
|
@ -40,7 +40,7 @@ ViewModel:: The `ViewModel` can be seen as a mediator between the `View` and the
|
|||
|
||||
The `MVVM` pattern helps us to focus on either of the three parts. If we get new values in our `Model`, the `ViewModel` will notify the `View` about it and the `View` can update itself. We don't have to do it manually. If you want to read more about it, here is a collection of useful links:
|
||||
|
||||
- https://docs.avaloniaui.net/docs/next/concepts/the-mvvm-pattern/[[Avalonia Docs\],window=_blank]
|
||||
- https://docs.avaloniaui.net/docs/concepts/the-mvvm-pattern/[[Avalonia Docs\],window=_blank]
|
||||
- https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel[[Wikipedia\],window=_blank]
|
||||
- https://www.codeproject.com/Articles/278901/MVVM-Pattern-Made-Simple[[CodeProject\],window=_blank]
|
||||
- https://www.tutorialspoint.com/mvvm/index.htm[[tutorialspoint\],window=_blank]
|
||||
|
@ -64,9 +64,9 @@ More: https://docs.microsoft.com/en-US/dotnet/api/system.componentmodel.inotifyp
|
|||
|
||||
=== Bindings
|
||||
|
||||
Avalonia uses `Controls` to represent functional components of a GUI Layout. Example `Controls` include https://docs.avaloniaui.net/docs/next/reference/controls/scrollbar[[`ScrollBar`\]], [https://docs.avaloniaui.net/docs/next/reference/controls/buttons/button[[`Button`,window=_blank]], and [https://docs.avaloniaui.net/docs/next/reference/controls/detailed-reference/textbox[`TextBox`,window=_blank]]. `Properties` (like the `Text`-property of a `TextBox`) describe and allow interaction with the `Controls`.
|
||||
Avalonia uses `Controls` to represent functional components of a GUI Layout. Example `Controls` include https://docs.avaloniaui.net/docs/reference/controls/scrollbar[[`ScrollBar`\]], [https://docs.avaloniaui.net/docs/reference/controls/buttons/button[[`Button`,window=_blank]], and [https://docs.avaloniaui.net/docs/reference/controls/detailed-reference/textbox[`TextBox`,window=_blank]]. `Properties` (like the `Text`-property of a `TextBox`) describe and allow interaction with the `Controls`.
|
||||
|
||||
We need a way to connect the `Properties` of our controls with the `Properties` in our `ViewModel`. Luckily we have [https://docs.avaloniaui.net/docs/next/basics/data/data-binding/[`Bindings`,window=_blank]] which will do this for us. The `Binding` will update the `View` whenever the `ViewModel` reports changes and will also update the `ViewModel` whenever the user interacts with the `View`.
|
||||
We need a way to connect the `Properties` of our controls with the `Properties` in our `ViewModel`. Luckily we have [https://docs.avaloniaui.net/docs/basics/data/data-binding/[`Bindings`,window=_blank]] which will do this for us. The `Binding` will update the `View` whenever the `ViewModel` reports changes and will also update the `ViewModel` whenever the user interacts with the `View`.
|
||||
|
||||
=== Create a new Project
|
||||
|
||||
|
@ -182,7 +182,7 @@ public string Greeting
|
|||
|
||||
=== Step 3: Add SimpleViewModel to MainWindowViewModel
|
||||
|
||||
Remember that the `View` implements the User Interface. Our view will only consist of one [https://docs.avaloniaui.net/docs/next/concepts/toplevel[`Window`,window=_blank]] called `MainWindow`. Its [https://docs.avaloniaui.net/docs/next/basics/data/data-binding/data-context[`DataContext`,window=_blank]], which describes the default location where controls should look values when binding, is the class `MainWindowViewModel` which was already added by the template when we first created our project. We will just add an instance of our `SimpleViewModel` to it. Add the following code to the `MainWindowViewlModel` class in `MainWindowViewModel.cs`.
|
||||
Remember that the `View` implements the User Interface. Our view will only consist of one [https://docs.avaloniaui.net/docs/concepts/toplevel[`Window`,window=_blank]] called `MainWindow`. Its [https://docs.avaloniaui.net/docs/basics/data/data-binding/data-context[`DataContext`,window=_blank]], which describes the default location where controls should look values when binding, is the class `MainWindowViewModel` which was already added by the template when we first created our project. We will just add an instance of our `SimpleViewModel` to it. Add the following code to the `MainWindowViewlModel` class in `MainWindowViewModel.cs`.
|
||||
|
||||
```cs
|
||||
// Add our SimpleViewModel.
|
||||
|
@ -414,6 +414,6 @@ Even though Avalonia ships ReactiveUI by default, you are not tied to it. You ca
|
|||
|
||||
Are you looking for more advanced tutorials? Find them here:
|
||||
|
||||
- https://docs.avaloniaui.net/docs/next/tutorials/todo-list-app/[[ToDo List App\],window=_blank]
|
||||
- https://docs.avaloniaui.net/docs/next/tutorials/music-store-app/[[Music Store App\],window=_blank]
|
||||
- https://docs.avaloniaui.net/docs/tutorials/todo-list-app/[[ToDo List App\],window=_blank]
|
||||
- https://docs.avaloniaui.net/docs/tutorials/music-store-app/[[Music Store App\],window=_blank]
|
||||
- https://github.com/AvaloniaCommunity/awesome-avalonia#tutorials[[Awesome-Avalonia\],window=_blank]
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
Title="BasicMvvmSample">
|
||||
|
||||
<!--We are using Compiled bindings. This is not mandatory but makes life easier. Read more about it here:-->
|
||||
<!-- https://docs.avaloniaui.net/docs/next/basics/data/data-binding/compiled-bindings -->
|
||||
<!-- https://docs.avaloniaui.net/docs/basics/data/data-binding/compiled-bindings -->
|
||||
|
||||
<Design.DataContext>
|
||||
<vm:MainWindowViewModel/>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
|
||||
// Write a short summary here what this examples does
|
||||
This example will show you how to https://docs.avaloniaui.net/docs/next/guides/development-guides/data-validation[[validate properties\]] and display an error message to the user, if the entered values are invalid. For example if the user should enter their e-mail address into a `TextBox`, the "@"-character is required and the `TextBox` may not be empty.
|
||||
This example will show you how to https://docs.avaloniaui.net/docs/guides/development-guides/data-validation[[validate properties\]] and display an error message to the user, if the entered values are invalid. For example if the user should enter their e-mail address into a `TextBox`, the "@"-character is required and the `TextBox` may not be empty.
|
||||
|
||||
|
||||
|
||||
|
@ -298,7 +298,7 @@ In your IDE hit `Run` or `Debug` to see the result:
|
|||
image::_docs/option2.png[Result Option 2]
|
||||
|
||||
|
||||
NOTE: Some `MVVM`-frameworks like the https://learn.microsoft.com/en-us/windows/communitytoolkit/mvvm/observablevalidator[[Windows MVVM Community Toolkit\]] implement the `INotifyDataErrorInfo`-interface and are using https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.validationattribute[[`DataAnnotations`\]] to run the validation. In this case you may end up seeing your validation twice. If you are facing such an issue, you can https://docs.avaloniaui.net/docs/next/guides/development-guides/data-validation#manage-validationplugins[[disable one of the validators\]] in your App.
|
||||
NOTE: Some `MVVM`-frameworks like the https://learn.microsoft.com/en-us/windows/communitytoolkit/mvvm/observablevalidator[[Windows MVVM Community Toolkit\]] implement the `INotifyDataErrorInfo`-interface and are using https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.validationattribute[[`DataAnnotations`\]] to run the validation. In this case you may end up seeing your validation twice. If you are facing such an issue, you can https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins[[disable one of the validators\]] in your App.
|
||||
|
||||
|
||||
== Approach 3 : Validate a Property using Exceptions inside setters
|
||||
|
|
|
@ -172,4 +172,4 @@ While setting text directly is the easiest way, it doesn't really how user would
|
|||
|
||||
While this sample was pretty simple, Headless platform provides more features such as taking a screenshot of the control, so it can be compared with expected, or having input extension methods.
|
||||
|
||||
For more information please visit detailed documentation page: https://docs.avaloniaui.net/docs/next/concepts/headless/
|
||||
For more information please visit detailed documentation page: https://docs.avaloniaui.net/docs/concepts/headless/
|
|
@ -172,4 +172,4 @@ While setting text directly is the easiest way, it doesn't really how user would
|
|||
|
||||
While this sample was pretty simple, Headless platform provides more features such as taking a screenshot of the control, so it can be compared with expected, or having input extension methods.
|
||||
|
||||
For more information please visit detailed documentation page: https://docs.avaloniaui.net/docs/next/concepts/headless/
|
||||
For more information please visit detailed documentation page: https://docs.avaloniaui.net/docs/concepts/headless/
|
Загрузка…
Ссылка в новой задаче