private static int Fibonoci(int n) {
static int first=0;
static int second=1;
static int sum;
if(n>0)
Run Code Online (Sandbox Code Playgroud)
我收到错误"非法修饰符",如果我删除静态关键字没有错误,我需要这些变量是静态的
以下xaml代码将"Image"与datagrid模板列绑定.
<DataGridTemplateColumn Header="">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding Path=Image}" Height="16" Width="16" VerticalAlignment="Top" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
The same thing need to be done in codebehind (c# code)
DataGridTemplateColumn im = new DataGridTemplateColumn();
im.Header = "";
Binding items1 = new Binding();
Run Code Online (Sandbox Code Playgroud)
这就是我试过的......如何将datagridtemplate列绑定到图像?
BitmapImage im = new BitmapImage();
string path1 = @"C:\abc.png";
im.UriSource=new Uri(path1);
DataGridTemplateColumn one = new DataGridTemplateColumn();
this.dataGrid1.Columns.Add(one);
Run Code Online (Sandbox Code Playgroud)
现在我必须在datagridTemplateColumn中添加BitmapImage im.
如何在列中添加图像?
Dictionary<string,object> dict = new Dictionary <string,object>();
Run Code Online (Sandbox Code Playgroud)
我可以dict用其他一些对象实例化" "吗?
例如:
dict = new Dictionary<string,bitmap>();
Run Code Online (Sandbox Code Playgroud)
要么:
dict = new Dictionary<string, Image>();
Run Code Online (Sandbox Code Playgroud) c# ×2
binding ×1
code-behind ×1
datagrid ×1
dictionary ×1
function ×1
java ×1
new-operator ×1
static ×1
wpf ×1