Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RU] Перевод Create and Run a Project #257

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: create-a-project
title: Create and Run a Project
title: Создание и Запуск Проекта
---

import Tabs from '@theme/Tabs';
Expand All @@ -13,94 +13,96 @@ import VsNewAvaloniaProjectScreenshot from '/img/get-started/test-drive/vs-new-a
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):
Перед началом работы, убедитесь, что у вас [установлены шаблоны Avalonia](../install.md):

```bash
dotnet new install Avalonia.Templates
```

## Create the Project
## Создание проекта

To get started, we're going to use the simplest Avalonia template: `Avalonia Application` (or `avalonia.app` in the CLI).
В начале, мы выберем самый простой шаблон Avalonia: `Avalonia Application` (или `avalonia.app` в CLI).

<Tabs>
<TabItem value="cli" label="Command Line" default>
Run the command:
Выполните команду:

```bash
dotnet new avalonia.app -o GetStartedApp
```

This will create a new folder called `GetStartedApp` containing the new project.
Команда создаст новый проект в папке `GetStartedApp` (если папки с таким именем нет, то она будет создана).
</TabItem>
<TabItem value="rider" label="Rider">

- On the Rider startup screen, select **New Solution**
- В окне запуска Rider, выберите **New Solution**

<img className="center" src={RiderSplashScreenshot} width="600"/>

- In the sidebar, scroll down and select **Avalonia App**
- Type `GetStartedApp` in the **Solution Name** field
- Click **Create**
- В боковой панели скрольте вниз и выберите **Avalonia App**
- В поле **Solution Name** введите `GetStartedApp`
- Нажмите **Create**

The template will create a new solution and project.
Шаблон создаст новое решение и проект.

<img className="center" src={RiderSolutionScreenshot} width="600"/>

</TabItem>
<TabItem value="vs" label="Visual Studio">

- In **Visual Studio**, click **Create a new project**.
- Type `Avalonia` in the search box.
- Click **Avalonia Application** then click **Next**.
- В **Visual Studio** нажмите **Create a new project**.
- В поле поиска введите `Avalonia`.
- Выберите **Avalonia Application** и нажмите **Next**.

<img className="center" src={VsFindAvaloniaTemplateScreenshot} />

- Name the project `GetStartedApp`, and click **Create**.
- Укажите название проекта `GetStartedApp`, затем нажмите **Create**.

- The next screen allows selecting the platforms you wish to target: click **Desktop** then click **Next**.
- На следующем экране вы можете выберать целевые платформы: нажмите **Desktop**, а затем **Next**.

- The next screen allows selecting a design pattern: click **ReactiveUI** then click **Create**.
- На следубщем экране вы можете выбрать шаблон проектирования: нажмите **ReactiveUI**, а затем **Create**.

The template will create a new solution and two new projects. `GetStartedApp` is the main project that is shared between each platform. `GetStartedApp.Desktop` is the platform-specific project for the desktop platform.
Шаблон создаст решение и два новых проекта.
`GetStartedApp` - основной проект, совместно используемый каждой платформой.
`GetStartedApp.Desktop` - платформо-зависимый проект, в данном случае для `Desktop`

<img className="center" src={VsNewAvaloniaProjectScreenshot} />

</TabItem>
</Tabs>

## Run the Project
## Запуск проекта

We're now ready to run the project!
Теперь вы можете запустить проект!

<Tabs>
<TabItem value="cli" label="Command Line" default>
Go into the `GetStartedApp` directory and run:
Выберите и запустите проект `GetStartedApp`:

```bash
dotnet run
```
</TabItem>
<TabItem value="rider" label="Rider">

Press the **Run** button in the Rider toolbar:
В Rider нажмите **Run** на панели инструментов:

<img className="center" src={RiderRunScreenshot} />

</TabItem>
<TabItem value="vs" label="Visual Studio">

Right-click on the `GetStartedApp.Desktop` project and select **Set as Startup Project**.
Нажмите правой кнопкой мыши по проекту `GetStartedApp.Desktop`, выберите **Set as Startup Project**.

Hit `F5` to run the project.
Для запуска проекта нажмите `F5`.

</TabItem>
</Tabs>

The solution will build and run.
Решение будет собрано и запущено.

You should now be running your first Avalonia application!
Теперь вы можете запустить ваше первое приложение на Avalonia!

<img className="center" src={InitialWindowScreenshot} />