Skip to content

Dev #33

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

Merged
merged 31 commits into from
Apr 16, 2023
Merged

Dev #33

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
de11407
Update AcrylicBlurWindowExample.xaml
yanjinhuagood Apr 9, 2023
fca03ed
Update BarrageExample.xaml
yanjinhuagood Apr 9, 2023
800dc6e
Update ChatEmojiExample.xaml
yanjinhuagood Apr 9, 2023
4bf164b
Update MaskExample.xaml
yanjinhuagood Apr 9, 2023
27472be
Update SelectorExample.xaml
yanjinhuagood Apr 9, 2023
2204d90
Update WPFDevelopers.Samples40.csproj
yanjinhuagood Apr 9, 2023
c6cbbf3
Update WPFDevelopers.Samples45x.csproj
yanjinhuagood Apr 9, 2023
6ac47d7
Update WPFDevelopers.SamplesCode.csproj
yanjinhuagood Apr 9, 2023
b5632ff
Update Styles.CheckBox.xaml
yanjinhuagood Apr 9, 2023
c063f67
Update Styles.ComboBox.xaml
yanjinhuagood Apr 9, 2023
def0137
Update Styles.DatePicker.xaml
yanjinhuagood Apr 9, 2023
a7934e4
Update Styles.PasswordBox.xaml
yanjinhuagood Apr 9, 2023
f1a118c
Update Styles.RadioButton.xaml
yanjinhuagood Apr 9, 2023
01c0ce9
Update Styles.TextBox.xaml
yanjinhuagood Apr 9, 2023
3c8666c
Update MainWindow.xaml
yanjinhuagood Apr 9, 2023
6d82f0f
Update BasicControlsExample.xaml
yanjinhuagood Apr 9, 2023
a5716ec
Update ElementHelper.cs
yanjinhuagood Apr 9, 2023
4defe74
Create DatePickerHelper.cs
yanjinhuagood Apr 9, 2023
410557f
Update MultiSelectComboBox.xaml
yanjinhuagood Apr 9, 2023
8790315
Create DatePickerToCurrentConverter.cs
yanjinhuagood Apr 9, 2023
57d0e01
Update WPFDevelopers.Shared.projitems
yanjinhuagood Apr 16, 2023
9e457d9
Update Styles.DatePicker.xaml
yanjinhuagood Apr 16, 2023
c9b2bb9
Update Styles.DataGrid.xaml
yanjinhuagood Apr 16, 2023
07937b5
Update BasicControlsExample.xaml
yanjinhuagood Apr 16, 2023
3faa084
Update MenuEnum.cs
yanjinhuagood Apr 16, 2023
e67976a
Update MainVM.cs
yanjinhuagood Apr 16, 2023
2873237
Delete WPFDevelopers.Samples.Shared - 副本.projitems
yanjinhuagood Apr 16, 2023
c1edcd0
Update DatePickerToCurrentConverter.cs
yanjinhuagood Apr 16, 2023
8e559da
update MultiSelectComboBox
yanjinhuagood Apr 16, 2023
7f01d10
add in MultiSelectionSearchComboBox
yanjinhuagood Apr 16, 2023
33dfc14
Update BasicControlsExample.xaml
yanjinhuagood Apr 16, 2023
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
374 changes: 259 additions & 115 deletions src/WPFDevelopers.Net40/Themes/Theme.xaml

Large diffs are not rendered by default.

410 changes: 275 additions & 135 deletions src/WPFDevelopers.Net45x/Themes/Theme.xaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/WPFDevelopers.Net45x/WPFDevelopers.Net45x.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<RootNamespace>WPFDevelopers</RootNamespace>
<TargetFrameworks>net45;net46;net47;net48;net5.0-windows;net6.0-windows;netcoreapp3.0</TargetFrameworks>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<PackageId>WPFDevelopers</PackageId>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<StackPanel Grid.Row="1" Margin="40,0,40,0"
x:Name="MyStackPanelContent">
<Image Source="/WPFDevelopers.ico" Width="80" Height="80"/>
<TextBox wpfdev:ElementHelper.IsWatermark="True" wpfdev:ElementHelper.Watermark="账户" Margin="0,20,0,0" Cursor="Hand"/>
<PasswordBox wpfdev:ElementHelper.IsWatermark="True" wpfdev:ElementHelper.Watermark="密码" Margin="0,20,0,0" Cursor="Hand"/>
<TextBox wpfdev:ElementHelper.Watermark="账户" Margin="0,20,0,0" Cursor="Hand"/>
<PasswordBox wpfdev:ElementHelper.Watermark="密码" Margin="0,20,0,0" Cursor="Hand"/>
<Button x:Name="LoginButton"
Content="登 录"
Margin="0,20,0,0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox wpfdev:ElementHelper.IsWatermark="True"
<TextBox
x:Name="tbBarrage"
wpfdev:ElementHelper.Watermark="请弹幕内容"/>
<Button Grid.Column="1" Style="{StaticResource PrimaryButton}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,20 @@
</WrapPanel>
<TextBlock Text="MessageBox" FontSize="20" Margin="0,20,0,0"/>
<WrapPanel Margin="0,10">
<Button x:Name="btnInformation" Content="Info" Click="btnInformation_Click"/>
<Button x:Name="btnWarning" Content="Warning" Margin="10,0" Click="btnWarning_Click"/>
<Button x:Name="btnError" Content="Error" Click="btnError_Click"/>
<Button x:Name="btnQuestion" Content="Question" Margin="10,0" Click="btnQuestion_Click"/>
<Button x:Name="btnInformation" Content="Info"
Style="{StaticResource SuccessPrimaryButton}"
Click="btnInformation_Click"/>
<Button x:Name="btnWarning" Content="Warning"
Style="{StaticResource WarningPrimaryButton}"
Margin="10,0" Click="btnWarning_Click"/>
<Button x:Name="btnError" Content="Error"
Click="btnError_Click"
Style="{StaticResource DangerPrimaryButton}"/>
<Button x:Name="btnQuestion"
Content="Question"
Style="{StaticResource PrimaryButton}"
Margin="10,0"
Click="btnQuestion_Click"/>
</WrapPanel>
<TextBlock Text="RadioButton" FontSize="20" Margin="0,20,0,0"/>
<WrapPanel Margin="0,10">
Expand All @@ -148,32 +158,32 @@
<WrapPanel Margin="0,10">
<TextBox />
<TextBox Margin="10,0"
wpfdev:ElementHelper.IsWatermark="True"
wpfdev:ElementHelper.Watermark="请输入内容"/>
wpfdev:ElementHelper.Watermark="TextBox"/>
<TextBox IsEnabled="False"/>
</WrapPanel>
<TextBlock Text="PasswordBox" FontSize="20" Margin="0,20,0,0"/>
<WrapPanel Margin="0,10">
<PasswordBox />
<PasswordBox Margin="10,0" wpfdev:ElementHelper.IsWatermark="true" wpfdev:ElementHelper.Watermark="请输入密码"/>
<PasswordBox Margin="10,0" wpfdev:ElementHelper.Watermark="PasswordBox"/>
<PasswordBox IsEnabled="False"/>
<PasswordBox x:Name="myPasswordBox"
wpfdev:PasswordBoxHelper.IsMonitoring="True"
Margin="10,0"
wpfdev:ElementHelper.IsWatermark="True"
wpfdev:ElementHelper.Watermark="请输入密码"/>
wpfdev:ElementHelper.Watermark="PasswordBox"/>
</WrapPanel>
<TextBlock Text="ComboBox" FontSize="20" Margin="0,20,0,0"/>
<WrapPanel Margin="0,10">
<ComboBox Width="200" Background="LightYellow">
<ComboBox Width="200" Background="LightYellow"
wpfdev:ElementHelper.Watermark="ComboBox">
<ComboBoxItem>Option 1</ComboBoxItem>
<ComboBoxItem>Option 2</ComboBoxItem>
<ComboBoxItem>Option 3</ComboBoxItem>
<ComboBoxItem>Option 4</ComboBoxItem>
<ComboBoxItem>Option 5</ComboBoxItem>
</ComboBox>
<ComboBox Width="200" Margin="10,0" IsEnabled="False"/>
<ComboBox Width="200" IsEditable="True">
<ComboBox Width="200" IsEditable="True"
wpfdev:ElementHelper.Watermark="ComboBox">
<ComboBoxItem>Option 1</ComboBoxItem>
<ComboBoxItem>Option 2</ComboBoxItem>
<ComboBoxItem>Option 3</ComboBoxItem>
Expand All @@ -190,9 +200,25 @@

<TextBlock Text="DatePicker" FontSize="20" Margin="0,20,0,0"/>
<WrapPanel Margin="0,10">
<DatePicker Width="200"/>
<DatePicker Width="200" SelectedDateFormat="Long" Margin="10,0"/>
<DatePicker Width="200" IsEnabled="False"/>
<DatePicker Width="200" wpfdev:DatePickerHelper.Watermark="日期 yyyy/MM/dd"/>
<DatePicker Width="200" SelectedDateFormat="Long" Margin="10,0"
wpfdev:DatePickerHelper.Watermark="DatePicker"/>
<DatePicker Width="200" wpfdev:DatePickerHelper.Watermark="{x:Null}">
<DatePicker.BlackoutDates>
<CalendarDateRange Start="2023-03-31" End="2023-04-07" />
</DatePicker.BlackoutDates>
</DatePicker>
</WrapPanel>

<TextBlock Text="Calendar" FontSize="20" Margin="0,20,0,0"/>
<WrapPanel Margin="0,10">
<Calendar/>
<Calendar Margin="10,0" SelectionMode="SingleRange"/>
<Calendar SelectionMode="MultipleRange">
<Calendar.BlackoutDates>
<CalendarDateRange Start="2023-03-31" End="2023-04-07" />
</Calendar.BlackoutDates>
</Calendar>
</WrapPanel>

<TextBlock Text="Slider" FontSize="20" Margin="0,20,0,0"/>
Expand Down Expand Up @@ -242,7 +268,7 @@
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox Margin="10,0,0,0" IsChecked="{Binding IsChecked}"/>
<CheckBox Margin="4,0,0,0" IsChecked="{Binding IsChecked}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="LeftInput" wpfdev:ElementHelper.IsWatermark="True" wpfdev:ElementHelper.Watermark="请输入内容"/>
<TextBox x:Name="LeftInput" wpfdev:ElementHelper.Watermark="请输入内容"/>
<Button Grid.Column="1" Content="发送" x:Name="LeftSend" Click="LeftSend_Click" Style="{StaticResource PrimaryButton}"></Button>
</Grid>
</Grid>
Expand Down Expand Up @@ -124,7 +124,7 @@
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="RightInput" wpfdev:ElementHelper.IsWatermark="True" wpfdev:ElementHelper.Watermark="请输入内容"/>
<TextBox x:Name="RightInput" wpfdev:ElementHelper.Watermark="请输入内容"/>
<Button Grid.Column="1" Content="发送" x:Name="RightSend" Click="RightSend_Click" Style="{StaticResource PrimaryButton}"></Button>
</Grid>
</Grid>
Expand Down
19 changes: 13 additions & 6 deletions src/WPFDevelopers.Samples.Shared/ExampleViews/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@
<!--<StackPanel HorizontalAlignment="Right" shell:WindowChrome.IsHitTestVisibleInChrome="True">
<Button Content="Close" Width="50" Height="25" Command="{Binding CloseCommand}"/>
</StackPanel>-->
<Grid Margin="10" Grid.Row="1">

<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="150"/>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Margin="0,0,10,0" Background="{DynamicResource BackgroundSolidColorBrush}"
<Border Margin="0,0,5,0" Background="{DynamicResource BackgroundSolidColorBrush}"
CornerRadius="4,0,0,4"
Effect="{StaticResource NormalShadowDepth}">
<wpfdev:NavigateMenu ItemsSource="{Binding NavigateMenuModelList}" x:Name="NavigateMenu">
Expand All @@ -103,8 +104,14 @@
</i:Interaction.Triggers>
</wpfdev:NavigateMenu>
</Border>

<Border Grid.Column="1"
<GridSplitter Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ShowsPreview="True"
Width="5"
/>
<Border Grid.Column="2"
Margin="5,0,0,0"
Background="{DynamicResource BackgroundSolidColorBrush}"
CornerRadius="4"
Effect="{StaticResource NormalShadowDepth}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
Margin="10">
<wd:Mask.Child>
<Border>
<TextBox wd:ElementHelper.IsWatermark="True"
wd:ElementHelper.Watermark="我是蒙板输入框"/>
<TextBox wd:ElementHelper.Watermark="我是蒙板输入框"/>
</Border>
</wd:Mask.Child>
<Button Content="Mask"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,51 @@
xmlns:wpfdev="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.Resources>
<model:HospitalList x:Key="myHospitalList"/>
</UserControl.Resources>
<controls:CodeViewer>
<UniformGrid Columns="2">
<wpfdev:MultiSelectComboBox
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button Content="获取选中"
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
Click="Button_Click"
Margin="0,20,0,0"
Style="{StaticResource WarningPrimaryButton}"/>
<UniformGrid Columns="2" Rows="2" Grid.Row="1">
<wpfdev:MultiSelectComboBox
VerticalContentAlignment="Center"
IsSelectAllActive="True"
HorizontalAlignment="Center"
Delimiter="^" Width="200">
<wpfdev:MultiSelectComboBoxItem>Option 1</wpfdev:MultiSelectComboBoxItem>
<wpfdev:MultiSelectComboBoxItem>Option 2</wpfdev:MultiSelectComboBoxItem>
<wpfdev:MultiSelectComboBoxItem>Option 3</wpfdev:MultiSelectComboBoxItem>
<wpfdev:MultiSelectComboBoxItem>Option 4</wpfdev:MultiSelectComboBoxItem>
<wpfdev:MultiSelectComboBoxItem>Option 5</wpfdev:MultiSelectComboBoxItem>
</wpfdev:MultiSelectComboBox>
<wpfdev:MultiSelectComboBox VerticalContentAlignment="Center"
HorizontalAlignment="Center"
ItemsSource="{Binding Source={StaticResource myHospitalList}}"
DisplayMemberPath="DoctorName"
SelectedValuePath="ID" Width="200">

</wpfdev:MultiSelectComboBox>
</UniformGrid>
<wpfdev:MultiSelectComboBoxItem>Option 1</wpfdev:MultiSelectComboBoxItem>
<wpfdev:MultiSelectComboBoxItem>Option 2</wpfdev:MultiSelectComboBoxItem>
<wpfdev:MultiSelectComboBoxItem>Option 3</wpfdev:MultiSelectComboBoxItem>
<wpfdev:MultiSelectComboBoxItem>Option 4</wpfdev:MultiSelectComboBoxItem>
<wpfdev:MultiSelectComboBoxItem>Option 5</wpfdev:MultiSelectComboBoxItem>
</wpfdev:MultiSelectComboBox>
<wpfdev:MultiSelectComboBox Name="MyMultiSelectComboBox"
VerticalContentAlignment="Center"
HorizontalAlignment="Center"
ItemsSource="{Binding Drawings}"
DisplayMemberPath="Number"
SelectedValuePath="Index"
Width="200"
IsSelectAllActive="True"
wpfdev:ElementHelper.Watermark="MultiSelectComboBox">
<wpfdev:MultiSelectComboBox.DataContext>
<vm:DrawingExampleVM/>
</wpfdev:MultiSelectComboBox.DataContext>
</wpfdev:MultiSelectComboBox>
</UniformGrid>
</Grid>
<controls:CodeViewer.SourceCodes>
<controls:SourceCodeModel
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/MultiSelectComboBoxExample.xaml"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows.Controls;
using System.Windows;
using System.Windows.Controls;

namespace WPFDevelopers.Samples.ExampleViews
{
Expand All @@ -11,5 +12,9 @@ public MultiSelectComboBoxExample()
{
InitializeComponent();
}
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
WPFDevelopers.Controls.MessageBox.Show($"{MyMultiSelectComboBox.Text} \r\n总共选中:{MyMultiSelectComboBox.SelectedItems.Count} 条", "选中内容", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<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.Resources>
<model:HospitalList x:Key="myHospitalList"/>
</UserControl.Resources>
<controls:CodeViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button Content="获取选中"
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
Click="Button_Click"
Margin="0,20,0,0"
Style="{StaticResource SuccessPrimaryButton}"/>
<UniformGrid Columns="2" Rows="2" Grid.Row="1">
<wd:MultiSelectionSearchComboBox
VerticalContentAlignment="Center"
HorizontalAlignment="Center"
ItemsSource="{Binding Drawings}"
DisplayMemberPath="Number"
SelectedValuePath="Index"
Width="200" Delimiter=","
IsSelectAllActive="True">
<wd:MultiSelectionSearchComboBox.DataContext>
<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="请输入搜索内容">
<wd:MultiSelectionSearchComboBox.DataContext>
<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:CodeViewer.SourceCodes>
</controls:CodeViewer>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Windows;
using System.Windows.Controls;

namespace WPFDevelopers.Samples.ExampleViews
{
/// <summary>
/// MultiSelectComboBoxExample.xaml 的交互逻辑
/// </summary>
public partial class MultiSelectSearchComboBoxExample : UserControl
{
public MultiSelectSearchComboBoxExample()
{
InitializeComponent();
}

private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
WPFDevelopers.Controls.MessageBox.Show($"{MyMultiSelectionSearchComboBox2.Text} \r\n总共选中:{MyMultiSelectionSearchComboBox2.SelectedItems.Count} 条","选中内容",MessageBoxButton.OK,MessageBoxImage.Information);
}
}
}
Loading