c# - Silverlight UserControl -


I have 2 user controls on my main page control and my editing tasks control to upgrade my editing control database to WCF Once it has been done, I need to reload the control of the manipoint control, which, by editing the editing functions, searches the database to see the crazy changes.

I redirected to the main page in an asp.net project - do you know how it is done in Silverlight?

OK, I did this by creating a button at the top of my main page that would reload Is panna I then used Visual Tree Assistant to get the button and implemented it. I did this:

  1. Create a class to find the controls: Public Stable Class ControlFinder {Public Static Search Finder (UIElement control) where T: UIElement {UIElement p = VisualTreeHelper GetParent (Control) as UIElement; If (p! = Null) {if (pt is) in the form of return p; And Return ControlFinder.FindParent (P); } Return tap; }

  2. Find the buttons in Control:

    UserControl uc = ControlFinder.FindParent (this); UserControl mainControls = ControlFinder.FindParent (UK); Var Pagegrid = VisualTriehaller Gate Chald (Main Control, 0); Var StackPennell = VisibleTriehelfer Gate Chald (PageGrid, 0); Button Refresh Button = (Button) VisualTreeHelper.GetChild (StackPanel, 0);

  3. Refresh the button event, refresh button AutomationPier button atupir = new button Automation Butter (Refresh button); IInvokeProvider invokeProvider = buttonAutoPeer.GetPattern (PatternInterface.Invoke) as the IInvokeProvider; InvokeProvider.Invoke ();

Comments