英文:
Convert a MAUI-C# control to xaml-string
问题
这是您要翻译的内容:
"i know i can load a control from xaml-code like this:
string navigationButtonXAML = "<Button Text="Navigate" />";
Button navigationButton = new Button().LoadFromXaml(navigationButtonXAML);
But is it possible to covert my C# control to xaml, in the end it should look somehow like this:
string myControl = new MyControl.WriteToXAML();"
请注意,代码部分未被翻译。
英文:
i know i can load a control from xaml-code like this:
string navigationButtonXAML = "<Button Text=\"Navigate\" />";
Button navigationButton = new Button().LoadFromXaml(navigationButtonXAML);
But is it possible to covert my C# control to xaml, in the end it should look somehow like this:
string myControl = new MyControl.WriteToXAML();
答案1
得分: 0
No, it can't covert C# control to xaml in MAUI or Xamarin.
I tested the code and searched related content about it, but there is no workaround to achieve it.
For more info about XAML, you can refer to the official doc.
英文:
>But is it possible to covert my C# control to xaml, in the end it should look somehow like this: string myControl = new MyControl.WriteToXAML();
No, it can't covert C# control to xaml in MAUI or Xamarin.
I tested the code and searched related content about it, but there is no workaround to achieve it.
For more info about XAML, you can refer to the official doc.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论