mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
Restore WPF .NET Framework content from WPF .NET (#144)
* Copy .NET 5 WPF content back into .NET Framework * Add H1 heading difference for .NET * Fix validation errors
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Data binding overview
|
||||
description: Learn about the different data sources you can add to your project in Windows Presentation Foundation for .NET Core. Data sources can be bound to XAML elements to create dynamic apps.
|
||||
description: Learn about the different data sources you can add to your project in Windows Presentation Foundation for .NET. Data sources can be bound to XAML elements to create dynamic apps.
|
||||
author: adegeo
|
||||
ms.date: 09/19/2019
|
||||
ms.author: adegeo
|
||||
@@ -10,7 +10,7 @@ dev_langs:
|
||||
- "vb"
|
||||
---
|
||||
|
||||
# Data binding overview in WPF
|
||||
# Data binding overview (WPF .NET)
|
||||
|
||||
Data binding in Windows Presentation Foundation (WPF) provides a simple and consistent way for apps to present and interact with data. Elements can be bound to data from a variety of data sources in the form of .NET objects and XML. Any <xref:System.Windows.Controls.ContentControl> such as <xref:System.Windows.Controls.Button> and any <xref:System.Windows.Controls.ItemsControl>, such as <xref:System.Windows.Controls.ListBox> and <xref:System.Windows.Controls.ListView>, have built-in functionality to enable flexible styling of single data items or collections of data items. Sort, filter, and group views can be generated on top of the data.
|
||||
|
||||
@@ -400,7 +400,7 @@ With the custom <xref:System.Windows.Controls.Validation.ErrorTemplate%2A> and t
|
||||
|
||||
If your <xref:System.Windows.Data.Binding> has associated validation rules but you do not specify an <xref:System.Windows.Controls.Validation.ErrorTemplate%2A> on the bound control, a default <xref:System.Windows.Controls.Validation.ErrorTemplate%2A> will be used to notify users when there is a validation error. The default <xref:System.Windows.Controls.Validation.ErrorTemplate%2A> is a control template that defines a red border in the adorner layer. With the default <xref:System.Windows.Controls.Validation.ErrorTemplate%2A> and the <xref:System.Windows.Controls.ToolTip>, the UI of the *StartPriceEntryForm* <xref:System.Windows.Controls.TextBox> looks like the following when there is a validation error.
|
||||
|
||||

|
||||

|
||||
|
||||
For an example of how to provide logic to validate all controls in a dialog box, see the Custom Dialog Boxes section in the [Dialog boxes overview](../../../framework/wpf/app-development/dialog-boxes-overview.md).
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Create a style for a control
|
||||
description: Learn how to create and reference a control style in Windows Presentation Foundation and .NET Core.
|
||||
description: Learn how to create and reference a control style in Windows Presentation Foundation and .NET.
|
||||
author: adegeo
|
||||
ms.author: adegeo
|
||||
ms.date: 09/12/2019
|
||||
@@ -11,7 +11,7 @@ dev_langs:
|
||||
#no-loc: [TextBlock, Setter]
|
||||
---
|
||||
|
||||
# Create a style for a control in WPF
|
||||
# Create a style for a control (WPF .NET)
|
||||
|
||||
With Windows Presentation Foundation (WPF), you can customize an existing control's appearance with your own reusable style. Styles can be applied globally to your app, windows and pages, or directly to controls.
|
||||
|
||||
@@ -37,7 +37,7 @@ A <xref:System.Windows.Style> is a convenient way to apply a set of property val
|
||||
|
||||
[!code-xaml[TextBlocks](./snippets/styles-templates-create-apply-style/csharp/Window1.xaml#SnippetTextBlocks)]
|
||||
|
||||

|
||||

|
||||
|
||||
You can change the default appearance by setting properties, such as <xref:System.Windows.Controls.Control.FontSize%2A> and <xref:System.Windows.Controls.Control.FontFamily%2A>, on each <xref:System.Windows.Controls.TextBlock> element directly. However, if you want your <xref:System.Windows.Controls.TextBlock> elements to share some properties, you can create a <xref:System.Windows.Style> in the `Resources` section of your XAML file, as shown here.
|
||||
|
||||
@@ -47,7 +47,7 @@ When you set the <xref:System.Windows.Style.TargetType%2A> of your style to the
|
||||
|
||||
Now the <xref:System.Windows.Controls.TextBlock> elements appear as follows.
|
||||
|
||||

|
||||

|
||||
|
||||
## Apply a style explicitly
|
||||
|
||||
@@ -63,7 +63,7 @@ To apply the style, set the <xref:System.Windows.FrameworkElement.Style%2A> prop
|
||||
|
||||
Notice that the first <xref:System.Windows.Controls.TextBlock> element has the style applied to it while the second TextBlock element remains unchanged. The implicit style from the previous section was changed to a style that declared the `x:Key` attribute, meaning, the only element affected by the style is the one that referenced the style directly.
|
||||
|
||||

|
||||

|
||||
|
||||
Once a style is applied, explicitly or implicitly, it becomes sealed and can't be changed. If you want to change a style that has been applied, create a new style to replace the existing one. For more information, see the <xref:System.Windows.Style.IsSealed%2A> property.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Styles and templates
|
||||
description: Learn about XAML resources in Windows Presentation Foundation (WPF) for .NET Core. Understand the types of XAML resources related to styles and themes.
|
||||
description: Learn about XAML resources in Windows Presentation Foundation (WPF) for .NET. Understand the types of XAML resources related to styles and themes.
|
||||
author: adegeo
|
||||
ms.author: adegeo
|
||||
ms.date: 09/09/2019
|
||||
@@ -10,7 +10,7 @@ dev_langs:
|
||||
- "vb"
|
||||
---
|
||||
|
||||
# Styles and templates in WPF
|
||||
# Styles and templates (WPF .NET)
|
||||
|
||||
Windows Presentation Foundation (WPF) styling and templating refer to a suite of features that let developers and designers create visually compelling effects and a consistent appearance for their product. When customizing the appearance of an app, you want a strong styling and templating model that enables maintenance and sharing of appearance within and among apps. WPF provides that model.
|
||||
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
---
|
||||
title: Define XAML resources
|
||||
description: Learn about XAML resources in WPF for .NET Core. Understand the types of XAML resources and learn how to define XAML resources.
|
||||
description: Learn about XAML resources in WPF for .NET. Understand the types of XAML resources and learn how to define XAML resources.
|
||||
author: adegeo
|
||||
ms.author: adegeo
|
||||
ms.date: 08/21/2019
|
||||
ms.topic: overview
|
||||
---
|
||||
|
||||
# Overview of XAML resources
|
||||
# Overview of XAML resources (WPF .NET)
|
||||
|
||||
A resource is an object that can be reused in different places in your app. Examples of resources include brushes and styles. This overview describes how to use resources in Extensible Application Markup Language (XAML). You can also create and access resources by using code.
|
||||
|
||||
> [!NOTE]
|
||||
> XAML resources described in this article are different from *app resources* which are generally files added to an app, such as content, data, or embedded files.
|
||||
|
||||
<!-- TODO: File redirect from docs\framework\wpf\advanced\xaml-resources.md -->
|
||||
|
||||
[!INCLUDE [desktop guide under construction](../../includes/desktop-guide-preview-note.md)]
|
||||
|
||||
## Using resources in XAML
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: XAML overview
|
||||
description: Learn how the XAML language is structured and implemented by Windows Presentation Foundation (WPF) for .NET Core.
|
||||
description: Learn how the XAML language is structured and implemented by Windows Presentation Foundation (WPF) for .NET.
|
||||
author: adegeo
|
||||
ms.date: 08/08/2019
|
||||
ms.date: 12/03/2020
|
||||
ms.author: adegeo
|
||||
ms.topic: overview
|
||||
dev_langs:
|
||||
@@ -24,7 +24,7 @@ helpviewer_keywords:
|
||||
- "attribute syntax [XAML]"
|
||||
---
|
||||
|
||||
# XAML overview in WPF
|
||||
# XAML overview (WPF .NET)
|
||||
|
||||
This article describes the features of the XAML language and demonstrates how you can use XAML to write Windows Presentation Foundation (WPF) apps. This article specifically describes XAML as implemented by WPF. XAML itself is a larger language concept than WPF.
|
||||
|
||||
@@ -320,13 +320,11 @@ XAML is a markup language that directly represents object instantiation and exec
|
||||
|
||||
### Code Access Security (CAS) in WPF
|
||||
|
||||
**This section only applies to .NET Framework. WPF for .NET Core doesn't support CAS. For more information, see [Code Access Security differences](../migration/differences-from-net-framework.md#code-access-security).**
|
||||
|
||||
WPF for .NET Framework supports Code Access Security (CAS). This means that WPF content running in the internet zone has reduced execution permissions. "Loose XAML" (pages of noncompiled XAML interpreted at load time by a XAML viewer) and XBAP are usually run in this internet zone and use the same permission set. However, XAML loaded in to a fully trusted application has the same access to the system resources as the hosting application does. For more information, see [WPF Partial Trust Security](../../../framework/wpf/wpf-partial-trust-security.md).
|
||||
Unlike .NET Framework, WPF for .NET doesn't support CAS. For more information, see [Code Access Security differences](../migration/differences-from-net-framework.md#code-access-security).
|
||||
|
||||
## Loading XAML from code
|
||||
|
||||
XAML can be used to define all of the UI, but it is sometimes also appropriate to define just a piece of the UI in XAML. This capability could be used to enable partial customization, local storage of information, using XAML to provide a business object, or a variety of possible scenarios. The key to these scenarios is the <xref:System.Windows.Markup.XamlReader> class and its <xref:System.Windows.Markup.XamlReader.Load%2A> method. The input is a XAML file, and the output is an object that represents all of the run-time tree of objects that was created from that markup. You then can insert the object to be a property of another object that already exists in the app. So long as the property is an appropriate property in the content model that has eventual display capabilities and that will notify the execution engine that new content has been added into the app, you can modify a running app's contents easily by loading in XAML. For .NET Framework, this capability is generally only available in full-trust applications, because of the obvious security implications of loading files into applications as they run.
|
||||
XAML can be used to define all of the UI, but it is sometimes also appropriate to define just a piece of the UI in XAML. This capability could be used to enable partial customization, local storage of information, using XAML to provide a business object, or a variety of possible scenarios. The key to these scenarios is the <xref:System.Windows.Markup.XamlReader> class and its <xref:System.Windows.Markup.XamlReader.Load%2A> method. The input is a XAML file, and the output is an object that represents all of the run-time tree of objects that was created from that markup. You then can insert the object to be a property of another object that already exists in the app. So long as the property is an appropriate property in the content model that has eventual display capabilities and that will notify the execution engine that new content has been added into the app, you can modify a running app's contents easily by loading in XAML.
|
||||
|
||||
## See also
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: Differences between .NET Framework and .NET Core
|
||||
description: Describes the differences between the .NET Framework implementation of Windows Presentation Foundation (WPF) and .NET Core WPF. When migrating your app, you should consider these incompatibilities.
|
||||
title: Differences between .NET Framework and .NET
|
||||
description: Describes the differences between the .NET Framework implementation of Windows Presentation Foundation (WPF) and .NET WPF. When migrating your app, you should consider these incompatibilities.
|
||||
author: adegeo
|
||||
ms.date: 09/21/2019
|
||||
ms.author: adegeo
|
||||
ms.topic: conceptual
|
||||
---
|
||||
|
||||
# Differences in WPF
|
||||
# Differences in WPF .NET
|
||||
|
||||
This article describes the differences between Windows Presentation Foundation (WPF) on .NET Core and .NET Framework. WPF for .NET Core is an [open-source framework](https://github.com/dotnet/wpf) forked from the original WPF for .NET Framework source code.
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
title: What is Windows Presentation Foundation
|
||||
description: This article gives an overview about what Windows Presentation Foundation (WPF) is as it relates to .NET Core and what features are provided.
|
||||
description: This article gives an overview about what Windows Presentation Foundation (WPF) is as it relates to .NET and what features are provided.
|
||||
ms.date: 07/18/2019
|
||||
ms.topic: overview
|
||||
#Customer intent: As a developer, I want to understand the components of WPF so that I can understand the overall picture of WPF.
|
||||
---
|
||||
|
||||
# What is Windows Presentation Foundation
|
||||
# What is Windows Presentation Foundation (WPF .NET)
|
||||
|
||||
Welcome to the Desktop Guide for Windows Presentation Foundation (WPF), a UI framework that creates desktop client applications for Windows. The WPF development platform supports a broad set of application development features, including an application model, controls, graphics, and data binding. WPF uses Extensible Application Markup Language (XAML) to provide a declarative model for application programming.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user