You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`Programs.cs`: Entry point of the app, uses a `Avaloni.Application` type to build up the program.
4
+
-`App.axaml`: Stores global themes, resources, styles.
5
+
-`App.axaml.cs`: Contains a class inherited from `Avalonia.Application` used as loader.
6
+
-`MainWindow.axaml.cs`: Contains a class inherited from `Avalonia.Controls.Window`, used as a source for `App`
7
+
-`MainWindow.axaml`: The view of `MainWindow`
8
+
-`MainWindowViewModel.cs`: Represents the data context of the main window.
2
9
3
10
## Entry Point - `Program.cs`
4
11
@@ -21,76 +28,47 @@ class Program
21
28
.StartWithClassicDesktopLifetime(args);
22
29
23
30
// Avalonia configuration, don't remove; also used by visual designer.
24
-
// !!! Register configuration from some dependencies here as extension methods
25
31
publicstaticAppBuilderBuildAvaloniaApp()
26
-
=>AppBuilder.Configure<App>()
32
+
=>AppBuilder.Configure<App>()// `App` is child of `Application`// [!code highlight]
27
33
.UsePlatformDetect()
28
34
.WithInterFont()
29
35
.LogToTrace()
30
36
.UseReactiveUI();
31
37
}
32
38
```
33
39
34
-
## ViewLocator
35
-
36
-
The term "locator" in "ViewLocator" refers to the role of the class in **"locating" or finding the appropriate View for a given ViewModel**. In other words, it helps the application determine which View should be used to display the data and operations defined in a ViewModel.
37
-
38
-
Once the `Match` method has determined the correct View type, this type is passed to the `Build` method, which is responsible for creating an instance of the View.
@@ -152,4 +125,41 @@ public partial class App : Application
152
125
153
126
```
154
127
155
-
:::
128
+
## ViewLocator
129
+
130
+
The term "locator" in "ViewLocator" refers to the role of the class in **locating or finding the appropriate View for a given ViewModel**.
131
+
In other words, it helps the application determine which View should be used to display the data and operations defined in a ViewModel.
132
+
133
+
Once the `Match` method has determined the correct View type, this type is passed to the `Build` method, which is responsible for creating an instance of the View.
0 commit comments