public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/Segator.Loms.Modules.Dispatcher.Silverlight;component/Silverlight/Suppliers/Supp" + "lierView.xaml", System.UriKind.Relative)); this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); this.viewSupplier = ((Segator.Loms.Modules.Supplier.Silverlight.SupplierView)(this.FindName("viewSupplier"))); }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/Segator.Loms.Modules.Supplier.Silverlight;component/Silverlight/SupplierModuleVi" + "ew.xaml", System.UriKind.Relative)); this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); this.StatusBar = ((System.Windows.Controls.Border)(this.FindName("StatusBar"))); this.UserName = ((System.Windows.Controls.TextBlock)(this.FindName("UserName"))); this.viewSupplier = ((Segator.Loms.Modules.Supplier.Silverlight.SupplierView)(this.FindName("viewSupplier"))); }
private void Page_Loaded(object sender, RoutedEventArgs e) { int id = int.Parse(this.NavigationContext.QueryString["id"]); Segator.Loms.Modules.Supplier.Silverlight.SupplierView view = null; if (_views.ContainsKey(id)) view = _views[id]; else { view = new Segator.Loms.Modules.Supplier.Silverlight.SupplierView(); // ((SupplierViewModel)view.DataContext).SupplierId = id; _views[id] = view; } LayoutRoot.Children.Clear(); LayoutRoot.Children.Add(view); }