Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion dotnet-desktop-guide/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ items:
- name: Windows Presentation Foundation
expanded: true
items:
- name: ".NET 5 (and .NET Core 3.1)"
href: net/wpf/index.yml?view=netdesktop-5.0&preserve-view=true
- name: .NET Framework
href: framework/wpf/index.md?view=netframeworkdesktop-4.8&preserve-view=true

- name: XAML language reference
href: xaml-services/?view=&preserve-view=true
15 changes: 12 additions & 3 deletions dotnet-desktop-guide/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,32 @@
"ms.author": "adegeo"
},
"fileMetadata": {
"breadcrumb_path": {
"xaml-services/**/**.md": "/dotnet/desktop/xaml-services/breadcrumb/toc.json"
},
"titleSuffix": {
"framework/winforms/**/**.md": "Windows Forms .NET Framework",
"net/winforms/**/**.md": "Windows Forms .NET",
"framework/wpf/**/**.md": "WPF .NET Framework",
"net/wpf/**/**.md": "WPF .NET"
"net/wpf/**/**.md": "WPF .NET",
"xaml-services/**/*.md": "XAML"
},
"ms.technology": {
"framework/winforms/**/**.md": "dotnet-winforms",
"framework/wpf/**/**.md": "dotnet-wpf",
"net/winforms/**/**.md": "dotnet-winforms",
"net/wpf/**/**.md": "dotnet-wpf"
"net/wpf/**/**.md": "dotnet-wpf",
"xaml-services/**/*.md": "dotnet-wpf"
},
"ms.prod": {
"framework/winforms/**/**.md": "dotnet-framework",
"framework/wpf/**/**.md": "dotnet-framework",
"net/winforms/**/**.md": "dotnet-desktop",
"net/wpf/**/**.md": "dotnet-desktop"
"net/wpf/**/**.md": "dotnet-desktop",
"xaml-services/**/*.md": "dotnet-desktop"
},
"ms.topic": {
"xaml-services/**/*.md": "reference"
}
},
"template": [],
Expand Down
12 changes: 6 additions & 6 deletions dotnet-desktop-guide/framework/breadcrumb/toc.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
items:
- name: Docs
tocHref: /?view=&preserve-view=true
topicHref: /?view=&preserve-view=true
tocHref: /
topicHref: /
items:
- name: .NET
tocHref: /dotnet/?view=&preserve-view=true
topicHref: /dotnet/index?view=&preserve-view=true
tocHref: /dotnet/
topicHref: /dotnet/index
items:
- name: Desktop Guide
tocHref: /dotnet/desktop?view=&preserve-view=true
topicHref: /dotnet/desktop/index?view=&preserve-view=true
tocHref: /dotnet/desktop
topicHref: /dotnet/desktop/index
items:
- name: .NET Framework
items:
Expand Down
25 changes: 19 additions & 6 deletions dotnet-desktop-guide/net/breadcrumb/toc.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
items:
- name: Docs
tocHref: /?view=&preserve-view=true
topicHref: /?view=&preserve-view=true
tocHref: /
topicHref: /
items:
- name: .NET
tocHref: /dotnet/?view=&preserve-view=true
topicHref: /dotnet/index?view=&preserve-view=true
tocHref: /dotnet/
topicHref: /dotnet/index
items:
- name: Desktop Guide
tocHref: /dotnet/desktop?view=&preserve-view=true
topicHref: /dotnet/desktop/index?view=&preserve-view=true
tocHref: /dotnet/desktop
topicHref: /dotnet/desktop/index
items:
- name: ".NET 5 (and .NET Core 3.1)"
items:
- name: Windows Forms
tocHref: /dotnet/desktop/winforms/
topicHref: /dotnet/desktop/winforms/index
- name: Windows Presentation Foundation
tocHref: /dotnet/desktop/wpf/
topicHref: /dotnet/desktop/wpf/index
items:
- name: Get started
tocHref: /visualstudio/get-started/csharp/tutorial-wpf
topicHref: /dotnet/desktop/wpf/getting-started/index
- name: Migration
tocHref: /dotnet/desktop/wpf/migration
topicHref: /dotnet/desktop/wpf/migration/index
- name: Data binding
tocHref: /dotnet/desktop/wpf/data
topicHref: /dotnet/desktop/wpf/data/index
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

> [!IMPORTANT]
> The Desktop Guide documentation for .NET 5 (and .NET Core) and later versions is under construction and hasn't been published yet.
> The Desktop Guide documentation for .NET 5 (and .NET Core) and is under construction.
445 changes: 445 additions & 0 deletions dotnet-desktop-guide/net/wpf/data/data-binding-overview.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="bindings.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:bindings"
StartupUri="DataValidation.xaml">
<Application.Resources>

</Application.Resources>
</Application>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace bindings
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public ObservableCollection<AuctionItem> AuctionItems { get; } = new ObservableCollection<AuctionItem>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace bindings
{
public class AuctionItem : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;

public int CurrentPrice { get; set; } = 0;

public int StartPrice { get; set; } = 50;

public DateTime StartDate { get; set; } = DateTime.Now;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<UserControl x:Class="bindings.AutoConvertPropertyToColor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:bindings"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<StackPanel>
<!-- <BindAutoConvertColor> -->
<DockPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:SDKSample">
<DockPanel.Resources>
<c:MyData x:Key="myDataSource"/>
</DockPanel.Resources>
<DockPanel.DataContext>
<Binding Source="{StaticResource myDataSource}"/>
</DockPanel.DataContext>
<Button Background="{Binding Path=ColorName}"
Width="150" Height="30">
I am bound to be RED!
</Button>
</DockPanel>
<!-- </BindAutoConvertColor> -->
<!-- <BindAutoConvertColorCompactBinding> -->
<DockPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:SDKSample">
<DockPanel.Resources>
<c:MyData x:Key="myDataSource"/>
</DockPanel.Resources>
<Button Background="{Binding Source={StaticResource myDataSource}, Path=ColorName}"
Width="150" Height="30">
I am bound to be RED!
</Button>
</DockPanel>
<!-- </BindAutoConvertColorCompactBinding> -->
</StackPanel>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace bindings
{
/// <summary>
/// Interaction logic for DockPanelBindRedExample.xaml
/// </summary>
public partial class AutoConvertPropertyToColor : UserControl
{
public AutoConvertPropertyToColor()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<Window x:Class="bindings.CollectionView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:src="clr-namespace:bindings"
xmlns:local="clr-namespace:bindings"
mc:Ignorable="d"
Title="CollectionView" Height="450" Width="800" Loaded="Window_Loaded">
<!-- <CollectionView> -->
<Window.Resources>
<CollectionViewSource
Source="{Binding Source={x:Static Application.Current}, Path=AuctionItems}"
x:Key="listingDataView" />
</Window.Resources>
<!-- </CollectionView> -->
<Grid>
<Grid.Resources>
<!-- <AuctionItemDataTemplate> -->
<DataTemplate DataType="{x:Type src:AuctionItem}">
<Border BorderThickness="1" BorderBrush="Gray"
Padding="7" Name="border" Margin="3" Width="500">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20"/>
<ColumnDefinition Width="86"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<Polygon Grid.Row="0" Grid.Column="0" Grid.RowSpan="4"
Fill="Yellow" Stroke="Black" StrokeThickness="1"
StrokeLineJoin="Round" Width="20" Height="20"
Stretch="Fill"
Points="9,2 11,7 17,7 12,10 14,15 9,12 4,15 6,10 1,7 7,7"
Visibility="Hidden" Name="star"/>

<TextBlock Grid.Row="0" Grid.Column="1" Margin="0,0,8,0"
Name="descriptionTitle"
Style="{StaticResource smallTitleStyle}">Description:</TextBlock>

<TextBlock Name="DescriptionDTDataType" Grid.Row="0" Grid.Column="2"
Text="{Binding Path=Description}"
Style="{StaticResource textStyleTextBlock}"/>

<TextBlock Grid.Row="1" Grid.Column="1" Margin="0,0,8,0"
Name="currentPriceTitle"
Style="{StaticResource smallTitleStyle}">Current Price:</TextBlock>

<StackPanel Grid.Row="1" Grid.Column="2" Orientation="Horizontal">
<TextBlock Text="$" Style="{StaticResource textStyleTextBlock}"/>
<TextBlock Name="CurrentPriceDTDataType"
Text="{Binding Path=CurrentPrice}"
Style="{StaticResource textStyleTextBlock}"/>
</StackPanel>
</Grid>
</Border>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=SpecialFeatures}">
<DataTrigger.Value>
<src:SpecialFeatures>Color</src:SpecialFeatures>
</DataTrigger.Value>
<DataTrigger.Setters>
<Setter Property="BorderBrush" Value="DodgerBlue" TargetName="border" />
<Setter Property="Foreground" Value="Navy" TargetName="descriptionTitle" />
<Setter Property="Foreground" Value="Navy" TargetName="currentPriceTitle" />
<Setter Property="BorderThickness" Value="3" TargetName="border" />
<Setter Property="Padding" Value="5" TargetName="border" />
</DataTrigger.Setters>
</DataTrigger>
<DataTrigger Binding="{Binding Path=SpecialFeatures}">
<DataTrigger.Value>
<src:SpecialFeatures>Highlight</src:SpecialFeatures>
</DataTrigger.Value>
<Setter Property="BorderBrush" Value="Orange" TargetName="border" />
<Setter Property="Foreground" Value="Navy" TargetName="descriptionTitle" />
<Setter Property="Foreground" Value="Navy" TargetName="currentPriceTitle" />
<Setter Property="Visibility" Value="Visible" TargetName="star" />
<Setter Property="BorderThickness" Value="3" TargetName="border" />
<Setter Property="Padding" Value="5" TargetName="border" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
<!-- </AuctionItemDataTemplate> -->
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<StackPanel>
<CheckBox Checked="AddSortCheckBox_Checked">Add Sorting</CheckBox>
<CheckBox Checked="AddFilteringCheckBox_Checked">Add Filtering</CheckBox>
<CheckBox Checked="AddGroupingCheckBox_Checked">Add Grouping</CheckBox>
</StackPanel>

<!-- <ListBoxContentControl> -->
<!-- <ListBoxCollectionView> -->
<ListBox Name="Master" Grid.Row="2" Grid.ColumnSpan="3" Margin="8"
ItemsSource="{Binding Source={StaticResource listingDataView}}" />
<!-- </ListBoxCollectionView> -->
<ContentControl Name="Detail" Grid.Row="3" Grid.ColumnSpan="3"
Content="{Binding Source={StaticResource listingDataView}}"
ContentTemplate="{StaticResource detailsProductListingTemplate}"
Margin="9,0,0,0"/>
<!-- </ListBoxContentControl> -->
</Grid>
</Window>
Loading