[UWP] [C#]错误:CS0029_Cannot隐式转换类型“string”到“Windows.UI.Xaml.Controls.Grid”请帮忙!!! [英] [UWP][C#]ERROR: CS0029_Cannot implicitly convert type "string" to "Windows.UI.Xaml.Controls.Grid" PLEASE HELP!!!

查看:167
本文介绍了[UWP] [C#]错误:CS0029_Cannot隐式转换类型“string”到“Windows.UI.Xaml.Controls.Grid”请帮忙!!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我得到了这个错误:


有什么问题?这是我的代码。我想为我的应用添加流畅。

// ---------------------------- -----------------------------------------------

//

//< copyright file =" AboutPage.xaml.cs" company =" Microsoft">

//    Microsoft Corporation版权所有(C)2015。 保留所有权利。

//< / copyright>

//

//< createdOn> 5/12/2017 2: 16:26 PM< / createdOn>

//

// ---------------------- -------------------------------------------------- ---

解决方案

有什么问题?


我会给你的关于什么是错误的基本411,以便你将来理解它。


你不能让代码告诉字符串对象它将成为网格对象。


字符串对象具有一个具有属性和方法的类 定义字符串对象。网格有一个类,用于定义网格对象及其属性和方法。


https://msdn.microsoft.com/en-us/library/system.string(v = vs.110).aspx


网格类适用于Windows,但基本上使用类定义的任何网格的原则都是相同的。


https://msdn.microsoft.com/en-us/library/system.windows.controls.grid( v = vs.110).aspx


正如您所看到的,如果您查看了这两个链接,那么两个类都无法使用属性和方法定义每个对象因为每个类甚至接近彼此匹配。


所以你不能告诉一个对象它将成为另一个对象。这就像说一匹马,你现在将成为火箭。 :)


Java或.NET的原则与面向对象编程相同。


https://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/


您没有说明正在爆炸的代码行。


 



Hi i got this error:

What is wrong? This is my code. I want to add fluent to my app.

//---------------------------------------------------------------------------
//
// <copyright file="AboutPage.xaml.cs" company="Microsoft">
//    Copyright (C) 2015 by Microsoft Corporation.  All rights reserved.
// </copyright>
//
// <createdOn>5/12/2017 2:16:26 PM</createdOn>
//
//---------------------------------------------------------------------------

解决方案

What is wrong?

I'll give you the basic 411 as to what is wrong so you understand it in the future.

You can't have code that is going to tell the string object that it is going to be a grid object.

A string object has a class that has properties and methods that  defines the string object. A grid has a class that defines the grid object with its properties and methods.

https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx

The grid class is for Windows but the principles are the same for any grid basically with it class definition's.

https://msdn.microsoft.com/en-us/library/system.windows.controls.grid(v=vs.110).aspx

As you can see if you have looked at both links is the two classes that define each object in no way with the properties and methods for each class even come close to matching each other.

So you can't tell one object that it's going to be another object. It's like saying a horse you are now going to be a rocket. :)

Java or .NET the principles are the same for Object Oriented Programming.

https://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/

You give no indication of what line of code is blowing up.

 


这篇关于[UWP] [C#]错误:CS0029_Cannot隐式转换类型“string”到“Windows.UI.Xaml.Controls.Grid”请帮忙!!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆