让我们说比如我有以下非常简单的窗口:
<Window x:Class="CalendarGenerator.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1"
Height="300"
Width="447">
<Grid>
<ListBox Margin="12,40,0,12"
Name="eventList"
HorizontalAlignment="Left"
Width="134" />
</Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)
一个简单的列表定义为:
List<String> ListOfNames = new List<String>();
Run Code Online (Sandbox Code Playgroud)
并且假设列表中有多个名称.我将如何去使用尽可能多的列表绑定到ListBox代码隐藏的可能吗?
我刚刚在混合中创建了一个新的WPF项目,在git上推送它,添加了mqsql驱动程序,休息服务和nfc sdk并突然混合告诉我
<Application x:Class="desktop_client.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:desktop_client"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
不受支持.错误导致我App.xaml完全未经编辑,看起来像这样:
<Application x:Class="desktop_client.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:desktop_client"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
实际上任何标签都是如此.无论是Style,Setter,ControlTemplate,Canvas,Path.什么都不支持.比较xaml和c#文件到我刚刚完成的另一个项目,它工作得很好,没有区别(除了命名空间和路径,自然)
我绝对傻眼了
我有一个图片框,如果我使用__CODE__那么我只能将图像粘贴到Paint和MS word之类的东西上.我无法将其作为文件粘贴到文件夹/桌面.
那么如何将图像复制到剪贴板,如果粘贴到文件夹,那么它就变成了文件?