diff --git a/testWPFDevelopers.sln b/testWPFDevelopers.sln new file mode 100644 index 0000000..9d49047 --- /dev/null +++ b/testWPFDevelopers.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34525.116 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testWPFDevelopers", "testWPFDevelopers\testWPFDevelopers.csproj", "{0003FC75-7BBF-4BF1-B3A6-55D2D7C792DD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0003FC75-7BBF-4BF1-B3A6-55D2D7C792DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0003FC75-7BBF-4BF1-B3A6-55D2D7C792DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0003FC75-7BBF-4BF1-B3A6-55D2D7C792DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0003FC75-7BBF-4BF1-B3A6-55D2D7C792DD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {78A48234-9673-425C-912D-1A983319881B} + EndGlobalSection +EndGlobal diff --git a/testWPFDevelopers/App.xaml b/testWPFDevelopers/App.xaml new file mode 100644 index 0000000..206b107 --- /dev/null +++ b/testWPFDevelopers/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/testWPFDevelopers/App.xaml.cs b/testWPFDevelopers/App.xaml.cs new file mode 100644 index 0000000..4368829 --- /dev/null +++ b/testWPFDevelopers/App.xaml.cs @@ -0,0 +1,14 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace testWPFDevelopers +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } + +} diff --git a/testWPFDevelopers/AssemblyInfo.cs b/testWPFDevelopers/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/testWPFDevelopers/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/testWPFDevelopers/MainViewModel.cs b/testWPFDevelopers/MainViewModel.cs new file mode 100644 index 0000000..bcca541 --- /dev/null +++ b/testWPFDevelopers/MainViewModel.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace testWPFDevelopers +{ + public class MainViewModel + { + private ObservableCollection myVar; + + public ObservableCollection MyProperty + { + get { return myVar; } + set { myVar = value; } + } + public MainViewModel() + { + myVar = new ObservableCollection(); + myVar.Add("a001"); + myVar.Add("保001"); + myVar.Add("保德03"); + myVar.Add("dc04"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + myVar.Add("保德03"); + } + } +} diff --git a/testWPFDevelopers/MainWindow.xaml b/testWPFDevelopers/MainWindow.xaml new file mode 100644 index 0000000..e569251 --- /dev/null +++ b/testWPFDevelopers/MainWindow.xaml @@ -0,0 +1,22 @@ + + + + + diff --git a/testWPFDevelopers/MainWindow.xaml.cs b/testWPFDevelopers/MainWindow.xaml.cs new file mode 100644 index 0000000..686fda5 --- /dev/null +++ b/testWPFDevelopers/MainWindow.xaml.cs @@ -0,0 +1,36 @@ +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 testWPFDevelopers +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + List list = new List { "aa", "bb", "abc", "csd", "sdlfks", "osdi", "awd" , "aa", "bb", "abc", "csd", "sdlfks", "osdi", "awd", "aa", "bb", "abc", "csd", "sdlfks", "osdi", "awd" }; + public MainWindow() + { + InitializeComponent(); + this.DataContext=new MainViewModel(); + comboBox1.ItemsSource = list; + } + private void comboBox1_KeyUp(object sender, KeyEventArgs e) + { + + List mylist = new List(); + mylist = list.FindAll(delegate (string s) { return s.Contains(comboBox1.Text.Trim()); }); + comboBox1.ItemsSource = mylist; + comboBox1.IsDropDownOpen = true; + } + } + +} \ No newline at end of file diff --git a/testWPFDevelopers/testWPFDevelopers.csproj b/testWPFDevelopers/testWPFDevelopers.csproj new file mode 100644 index 0000000..18b9a12 --- /dev/null +++ b/testWPFDevelopers/testWPFDevelopers.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net6.0-windows + enable + enable + true + + +