Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #44

Merged
merged 3 commits into from
Jun 15, 2023
Merged

Dev #44

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
4 changes: 2 additions & 2 deletions src/WPFDevelopers.Net40/Themes/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3809,8 +3809,8 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<Border>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
<Border Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,67 +1,83 @@
<UserControl x:Class="WPFDevelopers.Samples.ExampleViews.MultiSelectSearchComboBoxExample"
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:WPFDevelopers.Samples.ExampleViews"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
xmlns:model="clr-namespace:WPFDevelopers.Sample.Models"
xmlns:vm="clr-namespace:WPFDevelopers.Samples.ViewModels"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl
x:Class="WPFDevelopers.Samples.ExampleViews.MultiSelectSearchComboBoxExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:model="clr-namespace:WPFDevelopers.Sample.Models"
xmlns:vm="clr-namespace:WPFDevelopers.Samples.ViewModels"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Resources>
<model:HospitalList x:Key="myHospitalList"/>
<model:HospitalList x:Key="myHospitalList" />
</UserControl.Resources>
<controls:CodeViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Button Content="获取选中"
VerticalAlignment="Bottom"
<Button
Margin="0,20,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Click="Button_Click"
Content="获取选中"
Style="{StaticResource WD.SuccessPrimaryButton}" />
<UniformGrid
Grid.Row="1"
Columns="2"
Rows="2">
<wd:MultiSelectionSearchComboBox
Width="200"
HorizontalAlignment="Center"
Click="Button_Click"
Margin="0,20,0,0"
Style="{StaticResource WD.SuccessPrimaryButton}"/>
<UniformGrid Columns="2" Rows="2" Grid.Row="1">
VerticalContentAlignment="Center"
Delimiter=","
DisplayMemberPath="Number"
IsSelectAllActive="True"
ItemsSource="{Binding Drawings}"
SelectedValuePath="Index">
<wd:MultiSelectionSearchComboBox.DataContext>
<vm:DrawingExampleVM />
</wd:MultiSelectionSearchComboBox.DataContext>
</wd:MultiSelectionSearchComboBox>
<wd:MultiSelectionSearchComboBox
VerticalContentAlignment="Center"
HorizontalAlignment="Center"
ItemsSource="{Binding Drawings}"
DisplayMemberPath="Number"
SelectedValuePath="Index"
Width="200" Delimiter=","
IsSelectAllActive="True">
Width="200"
HorizontalAlignment="Center"
VerticalContentAlignment="Center"
wd:ElementHelper.Watermark="MultiSelectionSearchComboBox"
Delimiter="^"
DisplayMemberPath="Number"
IsSelectAllActive="True"
ItemsSource="{Binding Drawings}"
SearchWatermark="请输入搜索内容"
SelectedValuePath="Index">
<wd:MultiSelectionSearchComboBox.DataContext>
<vm:DrawingExampleVM/>
<vm:DrawingExampleVM />
</wd:MultiSelectionSearchComboBox.DataContext>
</wd:MultiSelectionSearchComboBox>
<wd:MultiSelectionSearchComboBox
Name="MyMultiSelectionSearchComboBox2"
VerticalContentAlignment="Center"
HorizontalAlignment="Center"
ItemsSource="{Binding Drawings}"
DisplayMemberPath="Number"
SelectedValuePath="Index"
Width="200" Delimiter="^"
IsSelectAllActive="True"
wd:ElementHelper.Watermark="MultiSelectionSearchComboBox"
SearchWatermark="请输入搜索内容">
Width="200"
HorizontalAlignment="Center"
VerticalContentAlignment="Center"
wd:ElementHelper.Watermark="下拉多选搜索"
Delimiter="^"
IsSelectAllActive="True"
SearchWatermark="请输入搜索内容">
<wd:MultiSelectionSearchComboBox.DataContext>
<vm:DrawingExampleVM/>
<vm:DrawingExampleVM />
</wd:MultiSelectionSearchComboBox.DataContext>
</wd:MultiSelectionSearchComboBox>
</UniformGrid>
</Grid>
<controls:CodeViewer.SourceCodes>
<controls:SourceCodeModel
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectSearchComboBoxExample.xaml"
CodeType="Xaml"/>
<controls:SourceCodeModel
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs"
CodeType="CSharp"/>
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectSearchComboBoxExample.xaml" CodeType="Xaml" />
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectSearchComboBoxExample.xaml.cs" CodeType="CSharp" />
</controls:CodeViewer.SourceCodes>
</controls:CodeViewer>
</UserControl>
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Windows;
using ICSharpCode.AvalonEdit.Document;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace WPFDevelopers.Samples.ExampleViews
Expand All @@ -11,6 +14,16 @@ public partial class MultiSelectSearchComboBoxExample : UserControl
public MultiSelectSearchComboBoxExample()
{
InitializeComponent();
Loaded += MultiSelectSearchComboBoxExample_Loaded;
}

private void MultiSelectSearchComboBoxExample_Loaded(object sender, RoutedEventArgs e)
{
var list = new List<string>();
for (int i = 0; i < 10; i++)
list.Add(i.ToString());
MyMultiSelectionSearchComboBox2.ItemsSource = list;
MyMultiSelectionSearchComboBox2.SelectedItems = list.Skip(3).ToList();
}

private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ApplicationIcon>..\WPFDevelopers.Samples.Shared\WPFDevelopers.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WPFDevelopers" Version="1.1.0.1-preview7" />
<PackageReference Include="WPFDevelopers" Version="1.1.0.1-preview8" />
</ItemGroup>
<ItemGroup>
<Reference Include="ICSharpCode.AvalonEdit, Version=6.1.3.50, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
Expand Down
Loading