Skip to content

Commit 5536996

Browse files
Merge pull request #44 from WPFDevelopersOrg/dev
Dev
2 parents bec9215 + 15806ca commit 5536996

File tree

6 files changed

+141
-83
lines changed

6 files changed

+141
-83
lines changed

src/WPFDevelopers.Net40/Themes/Theme.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3809,8 +3809,8 @@
38093809
<Setter Property="Template">
38103810
<Setter.Value>
38113811
<ControlTemplate TargetType="{x:Type Label}">
3812-
<Border>
3813-
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
3812+
<Border Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
3813+
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
38143814
</Border>
38153815
</ControlTemplate>
38163816
</Setter.Value>
Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,83 @@
1-
<UserControl x:Class="WPFDevelopers.Samples.ExampleViews.MultiSelectSearchComboBoxExample"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
7-
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
8-
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
9-
xmlns:model="clr-namespace:WPFDevelopers.Sample.Models"
10-
xmlns:vm="clr-namespace:WPFDevelopers.Samples.ViewModels"
11-
mc:Ignorable="d"
12-
d:DesignHeight="450" d:DesignWidth="800">
1+
<UserControl
2+
x:Class="WPFDevelopers.Samples.ExampleViews.MultiSelectSearchComboBoxExample"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
xmlns:model="clr-namespace:WPFDevelopers.Sample.Models"
10+
xmlns:vm="clr-namespace:WPFDevelopers.Samples.ViewModels"
11+
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
12+
d:DesignHeight="450"
13+
d:DesignWidth="800"
14+
mc:Ignorable="d">
1315
<UserControl.Resources>
14-
<model:HospitalList x:Key="myHospitalList"/>
16+
<model:HospitalList x:Key="myHospitalList" />
1517
</UserControl.Resources>
1618
<controls:CodeViewer>
1719
<Grid>
1820
<Grid.RowDefinitions>
19-
<RowDefinition Height="Auto"/>
20-
<RowDefinition/>
21+
<RowDefinition Height="Auto" />
22+
<RowDefinition />
2123
</Grid.RowDefinitions>
22-
<Button Content="获取选中"
23-
VerticalAlignment="Bottom"
24+
<Button
25+
Margin="0,20,0,0"
26+
HorizontalAlignment="Center"
27+
VerticalAlignment="Bottom"
28+
Click="Button_Click"
29+
Content="获取选中"
30+
Style="{StaticResource WD.SuccessPrimaryButton}" />
31+
<UniformGrid
32+
Grid.Row="1"
33+
Columns="2"
34+
Rows="2">
35+
<wd:MultiSelectionSearchComboBox
36+
Width="200"
2437
HorizontalAlignment="Center"
25-
Click="Button_Click"
26-
Margin="0,20,0,0"
27-
Style="{StaticResource WD.SuccessPrimaryButton}"/>
28-
<UniformGrid Columns="2" Rows="2" Grid.Row="1">
38+
VerticalContentAlignment="Center"
39+
Delimiter=","
40+
DisplayMemberPath="Number"
41+
IsSelectAllActive="True"
42+
ItemsSource="{Binding Drawings}"
43+
SelectedValuePath="Index">
44+
<wd:MultiSelectionSearchComboBox.DataContext>
45+
<vm:DrawingExampleVM />
46+
</wd:MultiSelectionSearchComboBox.DataContext>
47+
</wd:MultiSelectionSearchComboBox>
2948
<wd:MultiSelectionSearchComboBox
30-
VerticalContentAlignment="Center"
31-
HorizontalAlignment="Center"
32-
ItemsSource="{Binding Drawings}"
33-
DisplayMemberPath="Number"
34-
SelectedValuePath="Index"
35-
Width="200" Delimiter=","
36-
IsSelectAllActive="True">
49+
Width="200"
50+
HorizontalAlignment="Center"
51+
VerticalContentAlignment="Center"
52+
wd:ElementHelper.Watermark="MultiSelectionSearchComboBox"
53+
Delimiter="^"
54+
DisplayMemberPath="Number"
55+
IsSelectAllActive="True"
56+
ItemsSource="{Binding Drawings}"
57+
SearchWatermark="请输入搜索内容"
58+
SelectedValuePath="Index">
3759
<wd:MultiSelectionSearchComboBox.DataContext>
38-
<vm:DrawingExampleVM/>
60+
<vm:DrawingExampleVM />
3961
</wd:MultiSelectionSearchComboBox.DataContext>
4062
</wd:MultiSelectionSearchComboBox>
4163
<wd:MultiSelectionSearchComboBox
4264
Name="MyMultiSelectionSearchComboBox2"
43-
VerticalContentAlignment="Center"
44-
HorizontalAlignment="Center"
45-
ItemsSource="{Binding Drawings}"
46-
DisplayMemberPath="Number"
47-
SelectedValuePath="Index"
48-
Width="200" Delimiter="^"
49-
IsSelectAllActive="True"
50-
wd:ElementHelper.Watermark="MultiSelectionSearchComboBox"
51-
SearchWatermark="请输入搜索内容">
65+
Width="200"
66+
HorizontalAlignment="Center"
67+
VerticalContentAlignment="Center"
68+
wd:ElementHelper.Watermark="下拉多选搜索"
69+
Delimiter="^"
70+
IsSelectAllActive="True"
71+
SearchWatermark="请输入搜索内容">
5272
<wd:MultiSelectionSearchComboBox.DataContext>
53-
<vm:DrawingExampleVM/>
73+
<vm:DrawingExampleVM />
5474
</wd:MultiSelectionSearchComboBox.DataContext>
5575
</wd:MultiSelectionSearchComboBox>
5676
</UniformGrid>
5777
</Grid>
5878
<controls:CodeViewer.SourceCodes>
59-
<controls:SourceCodeModel
60-
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectSearchComboBoxExample.xaml"
61-
CodeType="Xaml"/>
62-
<controls:SourceCodeModel
63-
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs"
64-
CodeType="CSharp"/>
79+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectSearchComboBoxExample.xaml" CodeType="Xaml" />
80+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs" CodeType="CSharp" />
6581
</controls:CodeViewer.SourceCodes>
6682
</controls:CodeViewer>
6783
</UserControl>

src/WPFDevelopers.Samples.Shared/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using System.Windows;
1+
using ICSharpCode.AvalonEdit.Document;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Windows;
25
using System.Windows.Controls;
36

47
namespace WPFDevelopers.Samples.ExampleViews
@@ -11,6 +14,16 @@ public partial class MultiSelectSearchComboBoxExample : UserControl
1114
public MultiSelectSearchComboBoxExample()
1215
{
1316
InitializeComponent();
17+
Loaded += MultiSelectSearchComboBoxExample_Loaded;
18+
}
19+
20+
private void MultiSelectSearchComboBoxExample_Loaded(object sender, RoutedEventArgs e)
21+
{
22+
var list = new List<string>();
23+
for (int i = 0; i < 10; i++)
24+
list.Add(i.ToString());
25+
MyMultiSelectionSearchComboBox2.ItemsSource = list;
26+
MyMultiSelectionSearchComboBox2.SelectedItems = list.Skip(3).ToList();
1427
}
1528

1629
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)

src/WPFDevelopers.Samples45x/WPFDevelopers.Samples45x.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ApplicationIcon>..\WPFDevelopers.Samples.Shared\WPFDevelopers.ico</ApplicationIcon>
1414
</PropertyGroup>
1515
<ItemGroup>
16-
<PackageReference Include="WPFDevelopers" Version="1.1.0.1-preview7" />
16+
<PackageReference Include="WPFDevelopers" Version="1.1.0.1-preview8" />
1717
</ItemGroup>
1818
<ItemGroup>
1919
<Reference Include="ICSharpCode.AvalonEdit, Version=6.1.3.50, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">

0 commit comments

Comments
 (0)