Cómo crear obj desde la clase que hace referencia al elemento xaml

El escenario:
1. have a class inside the project
2. Have a few controls in the XAML .Ie textBlock call txtBlkLoading.Text =" Loading...."

El problema:

  1. On Page load event : Set the txtBlkLoading.Text ="Loading....."

  2. Click a button to Create object from the class

Use the object to do tasks. after the task has been completed. How do I reference the txtBlkLoading and set it to txtBlkLoading =" Data Loaded." in the object which created from the class?


preguntado el 31 de enero de 12 a las 08:01

You need to learn the basics of C# , such as classes and properties. -

Yes Claus guru, do you have the solution? How come you dont know to provide the basic solution or unless..... -

I dont know your intention. I came here as a learner to learn windows phone. Luckily, I got help from generous and kind guru here. But you, I dont know what to say. If I know the answer, will I post the question here??? So, please , dont stop me from learning windows phone unless you own the whole company. -

@MilkBottle we are NOT here to GIVE you answers. Try it and if you get stuck ill help. -

@MyKuLLSKI: He has been on a number of occasion using sarcastics tone on my questions. Sometimes, it hurts. Help is appreciated but not that kind of tone that make you afraid to ask question. C'on, this is a community, we should help one another. Do you know why Apple iphone sell so well and overtake Windows phone? Why Steve job can stay ahead of competition? He has a good attitude to learn and not afraid to ask stupid question : Stay hungry stay foolish. -

1 Respuestas

In the future, you may want to provide more detail about what you are trying to accomplish and how you are currently attempting to solve your own problem. I have to say your question isn't very clear and that clarity can help you get better/more positive responses from the community.

That being said, it sounds like you can simply implement the button_onclick event.

private void MyButton_Click(object sender, EventArgs e)
    var newobject = new MyObject();

    txtBlkLoading.Text = "Data Loaded"

Respondido 01 Feb 12, 00:02

Thanks for the info. I have done this already. This is not what I wanted. Sometimes, it is hard to express the problem. I want to reference the XAML element in the class after it is used to created object to do task. - Botella de leche

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.