Skip to content

Commit 2d4bf4b

Browse files
committed
Merged main into live
2 parents 212b134 + 05909cd commit 2d4bf4b

File tree

6 files changed

+7
-73
lines changed

6 files changed

+7
-73
lines changed

hub/apps/desktop/modernize/modernize-wpf-tutorial-1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.custom: RS5, 19H1
1111
# Part 1: Migrate the Contoso Expenses app to .NET Core 3
1212

1313
This is the first part of a tutorial that demonstrates how to modernize a sample WPF desktop app named Contoso Expenses. For an overview of the tutorial, prerequisites, and instructions for downloading the sample app, see [Tutorial: Modernize a WPF app](modernize-wpf-tutorial.md).
14-
14+
1515
In this part of the tutorial, you will migrate the entire Contoso Expenses app from the .NET Framework 4.7.2 to [.NET Core 3](modernize-wpf-tutorial.md#net-core-3). Before you start this part of the tutorial, make sure you [open and build the ContosoExpenses sample](modernize-wpf-tutorial.md#get-the-contoso-expenses-sample-app) in Visual Studio 2019.
1616

1717
> [!NOTE]
@@ -57,7 +57,7 @@ The **ContosoExpenses.Core.csproj** includes the following elements:
5757

5858
## Migrate the ContosoExpenses.Data project to .NET Standard
5959

60-
The **ContosoExpenses** solution includes a **ContosoExpenses.Data** class library that contains models and interfaces for services and targets .NET 4.7.2. .NET Core 3.0 apps can use .NET Framework libraries, as long as they don't use APIs which aren't available in .NET Core. However, the best modernization path is to move your libraries to .NET Standard. This will make sure that your library is fully supported by your .NET Core 3.0 app. Additionally, you can reuse the library also with other platforms, such as web (through ASP.NET Core) and mobile (through Xamarin).
60+
The **ContosoExpenses** solution includes a **ContosoExpenses.Data** class library that contains models and interfaces for services and targets .NET 4.7.2. .NET Core 3.0 apps can use .NET Framework libraries, as long as they don't use APIs which aren't available in .NET Core. However, the best modernization path is to move your libraries to .NET Standard. This will make sure that your library is fully supported by your .NET Core 3.0 app. Additionally, you can reuse the library also with other platforms, such as web (through ASP.NET Core).
6161

6262
To migrate the **ContosoExpenses.Data** project to .NET Standard:
6363

@@ -221,7 +221,7 @@ If you now try to compile the **ContosoExpenses.Core** and **ContosoExpenses.Dat
221221

222222
These errors are a result of converting the **ContosoExpenses.Data** project from a .NET Framework library (which is specific for Windows) to a .NET Standard library, which can run on multiple platforms including Linux, Android, iOS, and more. The **ContosoExpenses.Data** project contains a class called **RegistryService**, which interacts with the registry, a Windows-only concept.
223223

224-
To resolve these errors, install the [Windows Compatibility](https://www.nuget.org/packages/Microsoft.Windows.Compatibility) NuGet package. This package provides support for many Windows-specific APIs to be used in a .NET Standard library. The library will no longer be cross-platform after using this package, but it will still target .NET Standard.
224+
To resolve these errors, install the [Windows Compatibility](https://www.nuget.org/packages/Microsoft.Windows.Compatibility) NuGet package. This package provides support for many Windows-specific APIs to be used in a .NET Standard library. The library will no longer be cross-platform after using this package, but it will still target .NET Standard.
225225

226226
1. Right-click on the **ContosoExpenses.Data** project.
227227
2. Choose **Manage NuGet Packages**.
@@ -274,4 +274,4 @@ Now that the projects are building successfully, you are ready to run and test t
274274
At this point in the tutorial, you have successfully migrated the Contoso Expenses app to .NET Core 3. You are now ready for [Part 2: Add a UWP InkCanvas control using XAML Islands](modernize-wpf-tutorial-2.md).
275275

276276
> [!NOTE]
277-
> If you have a high resolution screen, you may notice that the app looks very small. You'll address this problem in the next step of the tutorial.
277+
> If you have a high resolution screen, you may notice that the app looks very small. You'll address this problem in the next step of the tutorial.

uwp/enterprise/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ See [Use a SQL Server database in a UWP app](../data-access/sql-server-databases
7676
<a id="MSIX"></a>
7777
### MSIX deployment
7878

79-
MSIX is a Windows app package format that combines the best features of MSI, .appx, App-V, and ClickOnce to provide a modern and reliable packaging experience to all Windows apps. The MSIX package format preserves the functionality of existing app packages and install files in addition to enabling modern packaging and deployment features to Win32, WPF, and Windows Forms apps.
79+
MSIX is a Windows app package format that combines the best features of MSI, .appx, App-V, and ClickOnce to provide a modern and reliable packaging experience to all Windows apps. The MSIX package format preserves the functionality of existing app packages and install files in addition to enabling modern packaging and deployment features to Win32, WPF, and Windows Forms apps.
8080

8181
![MSIX Icon](images/MSIX-App-Package.ico)
8282

@@ -134,7 +134,6 @@ Many users today are bringing their own phone or tablet to work, which have vary
134134
|-------|-------------|
135135
| [Guide to UWP apps](../get-started/universal-application-platform-guide.md) | In this introductory guide, you'll get acquainted with the Windows UWP platform, including: what a device family is and how to decide which one to target, new UI controls and panels that allow you to adapt your UI to different device form factors, and how to understand and control the API surface that is available to your app. |
136136
| [Adaptive XAML UI code sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/XamlUIBasics) | This code sample shows all the possible layout options and controls for your app, regardless of device type, and allows you to interact with the panels to show how to achieve any layout you are looking for. In addition to showing how each control responds to different form factors, the app itself is responsive and shows various methods for achieving adaptive UI. |
137-
| [Xamarin topic](/xamarin/) | Xamarin for targeting phone |
138137

139138
## Deployment
140139

@@ -156,7 +155,7 @@ You have options for distributing apps to your organization’s users using MSIX
156155

157156
## Patterns and practices
158157

159-
Code bases for large scale, enterprise-grade apps can become unwieldy. Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Windows 10 UWP, and Xamarin Forms. Prism provides an implementation of a collection of design patterns that are helpful in writing well-structured and maintainable XAML applications, including MVVM, dependency injection, commands, EventAggregator, and others.
158+
Code bases for large scale, enterprise-grade apps can become unwieldy. Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, and Windows 10 UWP. Prism provides an implementation of a collection of design patterns that are helpful in writing well-structured and maintainable XAML applications, including MVVM, dependency injection, commands, EventAggregator, and others.
160159

161160
For more information on Prism, see the [GitHub repo](https://github.com/PrismLibrary/Prism).
162161

uwp/porting/desktop-to-uwp-migrate.md

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For more information, see [Use Windows Runtime APIs in desktop apps](/windows/ap
2525

2626
## Migrate a .NET Framework app to a UWP app
2727

28-
If your application runs on the .NET Framework, you can migrate it to a UWP app by leveraging .NET Standard 2.0. Move as much code as you can into .NET Standard 2.0 class libraries, and then create a UWP app that references your .NET Standard 2.0 libraries.
28+
If your application runs on the .NET Framework, you can migrate it to a UWP app by leveraging .NET Standard 2.0. Move as much code as you can into .NET Standard 2.0 class libraries, and then create a UWP app that references your .NET Standard 2.0 libraries.
2929

3030
### Share code in a .NET Standard 2.0 library
3131

@@ -210,71 +210,6 @@ public sealed partial class MainPage : Page
210210

211211
To get started with UWP, see [What's a UWP app](../get-started/universal-application-platform-guide.md).
212212

213-
### Reach iOS and Android devices
214-
215-
You can reach Android and iOS devices by adding Xamarin projects.
216-
217-
> [!NOTE]
218-
>For new cross-platform projects, please consider using .NET MAUI.
219-
220-
![An image that shows an Android device and a i O S device displaying Xamarin apps.](images/desktop-to-uwp/xamarin-apps.png)
221-
222-
These projects let you use C# to build Android and iOS apps with full access to platform-specific and device-specific APIs. These apps leverage platform-specific hardware acceleration, and are compiled for native performance.
223-
224-
They have access to the full spectrum of functionality exposed by the underlying platform and device, including platform-specific capabilities like iBeacons and Android Fragments and you'll use standard native user interface controls to build UIs that look and feel the way that users expect them to.
225-
226-
Just like UWPs, the cost to add an Android or iOS app is lower because you can reuse business logic in a .NET Standard 2.0 class library. You'll have to design your UI pages in XAML and write any device or platform-specific code.
227-
228-
#### Add a Xamarin project
229-
230-
First, add an **Android**, **iOS**, or **Cross-Platform** project to your solution.
231-
232-
You can find these templates in the **Add New Project** dialog box under the **Visual C#** group.
233-
234-
![Screenshot of the Add New Project dialog box showing Installed > Visual C sharp selected and Android, Cross Platform, and i O S options called out.](images/desktop-to-uwp/xamarin-projects.png)
235-
236-
>[!NOTE]
237-
>Cross-platform projects are great for apps with little platform-specific functionality. You can use them to build one native XAML-based UI that runs on iOS, Android, and Windows. Learn more [here](/xamarin/xamarin-forms/).
238-
239-
Then, from your Android, iOS, or cross-platform project, add a reference the class library project.
240-
241-
![Screenshot of the Solution Explorer pane that calls out the reference to the Class library reference for the Android, i O S, or cross-platform project.](images/desktop-to-uwp/class-library-reference3.png)
242-
243-
#### Build your pages
244-
245-
Our example shows a list of customers in an Android app.
246-
247-
![Android app](images/desktop-to-uwp/android-app.png)
248-
249-
```xml
250-
<?xml version="1.0" encoding="utf-8"?>
251-
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
252-
android:layout_width="fill_parent"
253-
android:layout_height="fill_parent"
254-
android:padding="10dp" android:textSize="16sp"
255-
android:id="@android:id/list">
256-
</TextView>
257-
```
258-
259-
```csharp
260-
[Activity(Label = "MyAndroidApp", MainLauncher = true)]
261-
public class MainActivity : ListActivity
262-
{
263-
protected override void OnCreate(Bundle savedInstanceState)
264-
{
265-
base.OnCreate(savedInstanceState);
266-
267-
SqlClientFactory factory = SqlClientFactory.Instance;
268-
269-
var customers = (string[])Northwind.GetCustomerNames(factory).ToArray(typeof(string));
270-
271-
ListAdapter = new ArrayAdapter<string>(this, Resource.Layout.list_item, customers);
272-
}
273-
}
274-
```
275-
276-
To get started with Android, iOS, and cross-platform projects, see the [Xamarin developer portal](/xamarin).
277-
278213
## Next steps
279214

280215
**Find answers to your questions**
-39.4 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)