Skip to content

Commit 735db85

Browse files
user135711mairaw
authored andcommitted
Force serif font to distinguish l from I (#6489)
* Force serif font to distinguish l from I The sans serif I looks like l and halfway through the tutorial I realized the mistake, but all the references were wrong in my version so I couldn't copy and paste code making a mess/waste of time. I propose using the inline code delimiter on the code names in order to be explicit. * typo
1 parent cee45ec commit 735db85

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

docs/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ For more information about installing the latest version of Visual Studio, see [
4444

4545
The first step is to create the application infrastructure, which includes an application definition, two pages, and an image.
4646

47-
1. Create a new WPF Application project in Visual Basic or Visual C# named **ExpenseIt**:
47+
1. Create a new WPF Application project in Visual Basic or Visual C# named **`ExpenseIt`**:
4848

4949
1. Open Visual Studio and select **File** > **New** > **Project**.
5050

5151
The **New Project** dialog opens.
5252

5353
2. Under the **Installed** category, expand either the **Visual C#** or **Visual Basic** node, and then select **Windows Classic Desktop**.
5454

55-
3. Select the **WPF App (.NET Framework)** template. Enter the name **ExpenseIt** and then select **OK**.
55+
3. Select the **WPF App (.NET Framework)** template. Enter the name **`ExpenseIt`** and then select **OK**.
5656

5757
![New Project dialog with WPF app selected](media/new-project-dialog.png)
5858

@@ -91,7 +91,7 @@ The first step is to create the application infrastructure, which includes an ap
9191

9292
5. Change the following properties on the <xref:System.Windows.Navigation.NavigationWindow> element:
9393

94-
- Set the <xref:System.Windows.Window.Title%2A> property to "ExpenseIt".
94+
- Set the <xref:System.Windows.Window.Title%2A> property to "`ExpenseIt`".
9595

9696
- Set the <xref:System.Windows.FrameworkElement.Width%2A> property to 500 pixels.
9797

@@ -125,17 +125,17 @@ The first step is to create the application infrastructure, which includes an ap
125125

126126
In this section, you'll add two pages and an image to the application.
127127

128-
1. Add a new WPF page to the project, and name it *ExpenseItHome.xaml*:
128+
1. Add a new WPF page to the project, and name it *`ExpenseItHome.xaml`*:
129129

130-
1. In **Solution Explorer**, right-click on the **ExpenseIt** project node and choose **Add** > **Page**.
130+
1. In **Solution Explorer**, right-click on the **`ExpenseIt`** project node and choose **Add** > **Page**.
131131

132-
1. In the **Add New Item** dialog, the **Page (WPF)** template is already selected. Enter the name **ExpenseItHome**, and then select **Add**.
132+
1. In the **Add New Item** dialog, the **Page (WPF)** template is already selected. Enter the name **`ExpenseItHome`**, and then select **Add**.
133133

134134
This page is the first page that's displayed when the application is launched. It will show a list of people to select from, to show an expense report for.
135135

136-
2. Open *ExpenseItHome.xaml*.
136+
2. Open *`ExpenseItHome.xaml`*.
137137

138-
3. Set the <xref:System.Windows.Controls.Page.Title%2A> to "ExpenseIt - Home".
138+
3. Set the <xref:System.Windows.Controls.Page.Title%2A> to "`ExpenseIt - Home`".
139139

140140
Your XAML should look like this in Visual Basic:
141141

@@ -147,9 +147,9 @@ In this section, you'll add two pages and an image to the application.
147147

148148
4. Open *MainWindow.xaml*.
149149

150-
5. Set the <xref:System.Windows.Navigation.NavigationWindow.Source%2A> property on the <xref:System.Windows.Navigation.NavigationWindow> to "ExpenseItHome.xaml".
150+
5. Set the <xref:System.Windows.Navigation.NavigationWindow.Source%2A> property on the <xref:System.Windows.Navigation.NavigationWindow> to "`ExpenseItHome.xaml`".
151151

152-
This sets *ExpenseItHome.xaml* to be the first page opened when the application starts. Your XAML should look like this in Visual Basic:
152+
This sets *`ExpenseItHome.xaml`* to be the first page opened when the application starts. Your XAML should look like this in Visual Basic:
153153

154154
[!code-xaml[ExpenseIt#7_A](../../../../samples/snippets/visualbasic/VS_Snippets_Wpf/ExpenseIt/VB/ExpenseIt1_A/MainWindow.xaml#7_a)]
155155

@@ -164,15 +164,15 @@ In this section, you'll add two pages and an image to the application.
164164
165165
6. Add another new WPF page to the project, and name it *ExpenseReportPage.xaml*::
166166

167-
1. In **Solution Explorer**, right-click on the **ExpenseIt** project node and choose **Add** > **Page**.
167+
1. In **Solution Explorer**, right-click on the **`ExpenseIt`** project node and choose **Add** > **Page**.
168168

169169
1. In the **Add New Item** dialog, the **Page (WPF)** template is already selected. Enter the name **ExpenseReportPage**, and then select **Add**.
170170

171-
This page will show the expense report for the person that is selected on the **ExpenseItHome** page.
171+
This page will show the expense report for the person that is selected on the **`ExpenseItHome`** page.
172172

173173
7. Open *ExpenseReportPage.xaml*.
174174

175-
8. Set the <xref:System.Windows.Controls.Page.Title%2A> to "ExpenseIt - View Expense".
175+
8. Set the <xref:System.Windows.Controls.Page.Title%2A> to "`ExpenseIt - View Expense`".
176176

177177
Your XAML should look like this in Visual Basic:
178178

@@ -186,7 +186,7 @@ In this section, you'll add two pages and an image to the application.
186186

187187
When you create a new Page file, Visual Studio automatically creates a *code-behind* file. These code-behind files handle the logic for responding to user input.
188188

189-
Your code should look like this for **ExpenseItHome**:
189+
Your code should look like this for **`ExpenseItHome`**:
190190

191191
[!code-csharp[ExpenseIt#2_5](../../../../samples/snippets/csharp/VS_Snippets_Wpf/ExpenseIt/CSharp/ExpenseIt2/ExpenseItHome.xaml.cs#2_5)]
192192
[!code-vb[ExpenseIt#2_5](../../../../samples/snippets/visualbasic/VS_Snippets_Wpf/ExpenseIt/VB/ExpenseIt1_A/ExpenseItHome.xaml.vb#2_5)]
@@ -223,14 +223,14 @@ Layout provides an ordered way to place UI elements, and also manages the size a
223223
- <xref:System.Windows.Controls.VirtualizingStackPanel>
224224
- <xref:System.Windows.Controls.WrapPanel>
225225

226-
Each of these layout controls supports a special type of layout for its child elements. ExpenseIt pages can be resized, and each page has elements that are arranged horizontally and vertically alongside other elements. Consequently, the <xref:System.Windows.Controls.Grid> is the ideal layout element for the application.
226+
Each of these layout controls supports a special type of layout for its child elements. `ExpenseIt` pages can be resized, and each page has elements that are arranged horizontally and vertically alongside other elements. Consequently, the <xref:System.Windows.Controls.Grid> is the ideal layout element for the application.
227227

228228
> [!TIP]
229229
> For more information about <xref:System.Windows.Controls.Panel> elements, see [Panels overview](../../../../docs/framework/wpf/controls/panels-overview.md). For more information about layout, see [Layout](../../../../docs/framework/wpf/advanced/layout.md).
230230
231-
In the section, you create a single-column table with three rows and a 10-pixel margin by adding column and row definitions to the <xref:System.Windows.Controls.Grid> in *ExpenseItHome.xaml*.
231+
In the section, you create a single-column table with three rows and a 10-pixel margin by adding column and row definitions to the <xref:System.Windows.Controls.Grid> in *`ExpenseItHome.xaml`*.
232232

233-
1. Open *ExpenseItHome.xaml*.
233+
1. Open *`ExpenseItHome.xaml`*.
234234

235235
2. Set the <xref:System.Windows.FrameworkElement.Margin%2A> property on the <xref:System.Windows.Controls.Grid> element to "10,0,10,10", which corresponds to left, top, right and bottom margins:
236236

@@ -257,15 +257,15 @@ In the section, you create a single-column table with three rows and a 10-pixel
257257

258258
In this section, you'll update the home page UI to show a list of people that a user can select from to show the expense report for. Controls are UI objects that allow users to interact with your application. For more information, see [Controls](../../../../docs/framework/wpf/controls/index.md).
259259

260-
To create this UI, you'll add the following elements to *ExpenseItHome.xaml*:
260+
To create this UI, you'll add the following elements to *`ExpenseItHome.xaml`*:
261261

262262
- <xref:System.Windows.Controls.ListBox> (for the list of people).
263263
- <xref:System.Windows.Controls.Label> (for the list header).
264264
- <xref:System.Windows.Controls.Button> (to click to view the expense report for the person that is selected in the list).
265265

266266
Each control is placed in a row of the <xref:System.Windows.Controls.Grid> by setting the <xref:System.Windows.Controls.Grid.Row%2A?displayProperty=nameWithType> attached property. For more information about attached properties, see [Attached Properties Overview](../../../../docs/framework/wpf/advanced/attached-properties-overview.md).
267267

268-
1. Open *ExpenseItHome.xaml*.
268+
1. Open *`ExpenseItHome.xaml`*.
269269

270270
2. Add the following XAML somewhere between the <xref:System.Windows.Controls.Grid> tags:
271271

@@ -284,7 +284,7 @@ The following illustration shows the controls you just created:
284284

285285
In this section, you'll update the home page UI with an image and a page title.
286286

287-
1. Open *ExpenseItHome.xaml*.
287+
1. Open *`ExpenseItHome.xaml`*.
288288

289289
2. Add another column to the <xref:System.Windows.Controls.Grid.ColumnDefinitions%2A> with a fixed <xref:System.Windows.Controls.ColumnDefinition.Width%2A> of 230 pixels:
290290

@@ -318,13 +318,13 @@ The following illustration shows the results of what you just added:
318318

319319
## Add code to handle events
320320

321-
1. Open *ExpenseItHome.xaml*.
321+
1. Open *`ExpenseItHome.xaml`*.
322322

323323
2. Add a <xref:System.Windows.Controls.Primitives.ButtonBase.Click> event handler to the <xref:System.Windows.Controls.Button> element. For more information, see [How to: Create a simple event handler](http://msdn.microsoft.com/library/b1456e07-9dec-4354-99cf-18666b64f480).
324324

325325
[!code-xaml[ExpenseIt#15](../../../../samples/snippets/csharp/VS_Snippets_Wpf/ExpenseIt/CSharp/ExpenseIt6/ExpenseItHome.xaml#15)]
326326

327-
3. Open *ExpenseItHome.xaml.vb* or *ExpenseItHome.xaml.cs*.
327+
3. Open *`ExpenseItHome.xaml.vb`* or *`ExpenseItHome.xaml.cs`*.
328328

329329
4. Add the following code to the `ExpenseItHome` class to add a button click event handler. The event handler opens the **ExpenseReportPage** page.
330330

@@ -333,15 +333,15 @@ The following illustration shows the results of what you just added:
333333

334334
## Create the UI for ExpenseReportPage
335335

336-
*ExpenseReportPage.xaml* displays the expense report for the person that's selected on the **ExpenseItHome** page. In this section, you'll controls and create the UI for **ExpenseReportPage**. You'll also add background and fill colors to the various UI elements.
336+
*ExpenseReportPage.xaml* displays the expense report for the person that's selected on the **`ExpenseItHome`** page. In this section, you'll create the UI for **ExpenseReportPage**. You'll also add background and fill colors to the various UI elements.
337337

338338
1. Open *ExpenseReportPage.xaml*.
339339

340340
2. Add the following XAML between the <xref:System.Windows.Controls.Grid> tags:
341341

342342
[!code-xaml[ExpenseIt#17](../../../../samples/snippets/csharp/VS_Snippets_Wpf/ExpenseIt/CSharp/ExpenseIt6/ExpenseReportPage.xaml#17)]
343343

344-
This UI is similar to *ExpenseItHome.xaml*, except the report data is displayed in a <xref:System.Windows.Controls.DataGrid>.
344+
This UI is similar to *`ExpenseItHome.xaml`*, except the report data is displayed in a <xref:System.Windows.Controls.DataGrid>.
345345

346346
3. Build and run the application.
347347

@@ -378,11 +378,11 @@ The appearance of various elements is often the same for all elements of the sam
378378

379379
- `listHeaderTextStyle`: To format the list header <xref:System.Windows.Controls.Label>.
380380

381-
- `buttonStyle`: To format the <xref:System.Windows.Controls.Button> on ExpenseItHome.xaml.
381+
- `buttonStyle`: To format the <xref:System.Windows.Controls.Button> on `ExpenseItHome.xaml`.
382382

383383
Notice that the styles are resources and children of the <xref:System.Windows.Application.Resources%2A?displayProperty=nameWithType> property element. In this location, the styles are applied to all the elements in an application. For an example of using resources in a .NET Framework application, see [Use Application Resources](../../../../docs/framework/wpf/advanced/how-to-use-application-resources.md).
384384

385-
3. Open *ExpenseItHome.xaml*.
385+
3. Open *`ExpenseItHome.xaml`*.
386386

387387
4. Replace everything between the <xref:System.Windows.Controls.Grid> elements with the following XAML:
388388

@@ -402,7 +402,7 @@ The appearance of various elements is often the same for all elements of the sam
402402

403403
In this section, you'll create the XML data that is bound to various controls.
404404

405-
1. Open *ExpenseItHome.xaml*.
405+
1. Open *`ExpenseItHome.xaml`*.
406406

407407
2. After the opening <xref:System.Windows.Controls.Grid> element, add the following XAML to create an <xref:System.Windows.Data.XmlDataProvider> that contains the data for each person:
408408

@@ -428,7 +428,7 @@ In this section, you'll create the XML data that is bound to various controls.
428428

429429
## Connect data to controls
430430

431-
Next, you'll add code to retrieve the name that's selected on the **ExpenseItHome** page and pass it to the constructor of **ExpenseReportPage**. **ExpenseReportPage** sets its data context with the passed item, which is what the controls defined in *ExpenseReportPage.xaml* bind to.
431+
Next, you'll add code to retrieve the name that's selected on the **`ExpenseItHome`** page and pass it to the constructor of **ExpenseReportPage**. **ExpenseReportPage** sets its data context with the passed item, which is what the controls defined in *ExpenseReportPage.xaml* bind to.
432432

433433
1. Open *ExpenseReportPage.xaml.vb* or *ExpenseReportPage.xaml.cs*.
434434

@@ -437,7 +437,7 @@ Next, you'll add code to retrieve the name that's selected on the **ExpenseItHom
437437
[!code-csharp[ExpenseIt#26](../../../../samples/snippets/csharp/VS_Snippets_Wpf/ExpenseIt/CSharp/ExpenseIt8/ExpenseReportPage.xaml.cs#26)]
438438
[!code-vb[ExpenseIt#26](../../../../samples/snippets/visualbasic/VS_Snippets_Wpf/ExpenseIt/VB/ExpenseIt8/ExpenseReportPage.xaml.vb#26)]
439439

440-
3. Open *ExpenseItHome.xaml.vb* or *ExpenseItHome.xaml.cs*.
440+
3. Open *`ExpenseItHome.xaml.vb`* or *`ExpenseItHome.xaml.cs`*.
441441

442442
4. Change the <xref:System.Windows.Controls.Primitives.ButtonBase.Click> event handler to call the new constructor passing the expense report data of the selected person.
443443

@@ -466,7 +466,7 @@ In this section, you'll update the UI for each item in the data-bound lists by u
466466

467467
6. Select a person and then select the **View** button.
468468

469-
The following illustration shows both pages of the ExpenseIt application with controls, layout, styles, data binding, and data templates applied:
469+
The following illustration shows both pages of the `ExpenseIt` application with controls, layout, styles, data binding, and data templates applied:
470470

471471
![ExpenseIt sample screen shots](../../../../docs/framework/wpf/getting-started/media/gettingstartedfigure5.png)
472472

0 commit comments

Comments
 (0)