大佬教程收集整理的这篇文章主要介绍了对象名称在 .XAML 中定义,但无法识别为 .fs,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
对象名称在 .XAML 中定义,但在 .fs 中无法识别。 请评论如何解决问题。
遇到错误信息
FS0039: the value,namespace,type,module 'mymap' is not defined
@H_320_5@mainPage.xaml
<controls:mymainpageMap x:name="mymap"
GrID.Row="0"
IsShowingUser="true"
MapType="Street" />
FS0039: the value,module 'mymap' is not defined.
mymap.MovetoRegion( ......
UPATE(.fs 类声明以及命名空间)
namespace AwesomeApp.pages
open Xamarin.Forms
open Xamarin.Forms.Xaml
type MainPage() =
inherit ContentPage()
let _ = base.LoadFromXaml(typeof<MainPage>)
overrIDe this.OnAppearing() =
base.onAppearing()
mymap.MovetoRegion( ...... )
根据Charles Petzold,我找到了解决问题的方法
override this.OnAppearing() =
base.onAppearing()
// get references to the object in the XAML file that have x:Name** attributes:
let mymap = base.FindByName<mymainpageMap>("mymap")
mymap.MoveToRegion( ...... )
以上是大佬教程为你收集整理的对象名称在 .XAML 中定义,但无法识别为 .fs全部内容,希望文章能够帮你解决对象名称在 .XAML 中定义,但无法识别为 .fs所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。