Public class modifier for WPF control

戏子无情 提交于 2019-12-05 08:55:19

问题


I'm creating Windows application and Class library. Class library contains WPF control named "InsertForm.xaml"

InsertForm contains TextBox named eUserName.

I'm using the following code to show InsertForm. That's successful. But I can't access eUserName. How to set Textbox modifiers to public?

using System.Windows.Forms.Integration

ElementHost host = new ElementHost();
iform= new Extender.InsertForm();
host.Child = iform;
this.Controls.Add(host);

回答1:


Would this work?

<TextBox Name="eUserName" x:FieldModifier="public"/>


来源:https://stackoverflow.com/questions/2093855/public-class-modifier-for-wpf-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!